From owner-svn-src-head@freebsd.org Sun Aug 25 01:05:01 2019 Return-Path: Delivered-To: svn-src-head@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 D59CDD0D2B; Sun, 25 Aug 2019 01:05:01 +0000 (UTC) (envelope-from eugen@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 46GH3x59ztz4MkS; Sun, 25 Aug 2019 01:05:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93873DBD7; Sun, 25 Aug 2019 01:05:01 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7P151Fe070289; Sun, 25 Aug 2019 01:05:01 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P151V0070288; Sun, 25 Aug 2019 01:05:01 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201908250105.x7P151V0070288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 25 Aug 2019 01:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351467 - head/usr.bin/last X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.bin/last X-SVN-Commit-Revision: 351467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 01:05:01 -0000 Author: eugen Date: Sun Aug 25 01:05:01 2019 New Revision: 351467 URL: https://svnweb.freebsd.org/changeset/base/351467 Log: last(1): fix style after r351459 Reported by: cem MFC after: 2 weeks X-MFC-With: 351459 Modified: head/usr.bin/last/last.c Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Sun Aug 25 00:57:51 2019 (r351466) +++ head/usr.bin/last/last.c Sun Aug 25 01:05:01 2019 (r351467) @@ -159,7 +159,7 @@ main(int argc, char *argv[]) (void) setlocale(LC_CTYPE, ""); p = nl_langinfo(CODESET); - if (strcmp (p, "UTF-8") == 0 || strcmp (p, "US-ASCII") == 0) + if (strcmp(p, "UTF-8") == 0 || strcmp(p, "US-ASCII") == 0) noctfix = 1; argc = xo_parse_args(argc, argv); From owner-svn-src-head@freebsd.org Sun Aug 25 02:38:46 2019 Return-Path: Delivered-To: svn-src-head@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 793BCD2D51; Sun, 25 Aug 2019 02:38:46 +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 46GK862ZpRz4RHk; Sun, 25 Aug 2019 02:38:46 +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 3A5DBEC4A; Sun, 25 Aug 2019 02:38:46 +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 x7P2ckE8023406; Sun, 25 Aug 2019 02:38:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P2ckxp023405; Sun, 25 Aug 2019 02:38:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908250238.x7P2ckxp023405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 25 Aug 2019 02:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351469 - head/tests/sys/posixshm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tests/sys/posixshm X-SVN-Commit-Revision: 351469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 02:38:46 -0000 Author: kevans Date: Sun Aug 25 02:38:45 2019 New Revision: 351469 URL: https://svnweb.freebsd.org/changeset/base/351469 Log: tests: shm_open(2): Verify FD_CLOEXEC Motivated by the fact that I'm messing around near the implementation and wanting to ensure this doesn't get messed up in the process. MFC after: 1 week Modified: head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Sun Aug 25 01:09:31 2019 (r351468) +++ head/tests/sys/posixshm/posixshm_test.c Sun Aug 25 02:38:45 2019 (r351469) @@ -609,6 +609,27 @@ ATF_TC_BODY(shm_functionality_across_fork, tc) shm_unlink(test_path); } +ATF_TC_WITHOUT_HEAD(cloexec); +ATF_TC_BODY(cloexec, tc) +{ + int fd; + + gen_test_path(); + + /* shm_open(2) is required to set FD_CLOEXEC */ + fd = shm_open(SHM_ANON, O_RDWR, 0777); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + ATF_REQUIRE((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0); + close(fd); + + /* Also make sure that named shm is correct */ + fd = shm_open(test_path, O_CREAT | O_RDWR, 0600); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + ATF_REQUIRE((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0); + close(fd); +} + + ATF_TP_ADD_TCS(tp) { @@ -630,6 +651,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, unlink_bad_path_pointer); ATF_TP_ADD_TC(tp, unlink_path_too_long); ATF_TP_ADD_TC(tp, object_resize); + ATF_TP_ADD_TC(tp, cloexec); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sun Aug 25 05:11:44 2019 Return-Path: Delivered-To: svn-src-head@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 99056D56BB; Sun, 25 Aug 2019 05:11:44 +0000 (UTC) (envelope-from mjg@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 46GNXc3YZPz4Xwb; Sun, 25 Aug 2019 05:11:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C69D18861; Sun, 25 Aug 2019 05:11:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7P5BiPA016075; Sun, 25 Aug 2019 05:11:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P5BiPl016074; Sun, 25 Aug 2019 05:11:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908250511.x7P5BiPl016074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 25 Aug 2019 05:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351471 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 351471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 05:11:44 -0000 Author: mjg Date: Sun Aug 25 05:11:43 2019 New Revision: 351471 URL: https://svnweb.freebsd.org/changeset/base/351471 Log: vfs: add vholdnz (for already held vnodes) Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21358 Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 25 04:56:33 2019 (r351470) +++ head/sys/kern/vfs_subr.c Sun Aug 25 05:11:43 2019 (r351471) @@ -3018,6 +3018,19 @@ _vhold(struct vnode *vp, bool locked) VI_UNLOCK(vp); } +void +vholdnz(struct vnode *vp) +{ + + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_holdcnt, 1); + VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); +#else + atomic_add_int(&vp->v_holdcnt, 1); +#endif +} + /* * Drop the hold count of the vnode. If this is the last reference to * the vnode we place it on the free list unless it has been vgone'd Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 25 04:56:33 2019 (r351470) +++ head/sys/sys/vnode.h Sun Aug 25 05:11:43 2019 (r351471) @@ -657,6 +657,7 @@ void vgone(struct vnode *vp); #define vhold(vp) _vhold((vp), 0) #define vholdl(vp) _vhold((vp), 1) void _vhold(struct vnode *, bool); +void vholdnz(struct vnode *); void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, off_t length, int blksize); From owner-svn-src-head@freebsd.org Sun Aug 25 05:13:16 2019 Return-Path: Delivered-To: svn-src-head@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 44524D58B9; Sun, 25 Aug 2019 05:13:16 +0000 (UTC) (envelope-from mjg@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 46GNZN11yFz4Y6l; Sun, 25 Aug 2019 05:13:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0503A189C8; Sun, 25 Aug 2019 05:13:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7P5DFD8017825; Sun, 25 Aug 2019 05:13:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P5DFFx017824; Sun, 25 Aug 2019 05:13:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908250513.x7P5DFFx017824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 25 Aug 2019 05:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351472 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 351472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 05:13:16 -0000 Author: mjg Date: Sun Aug 25 05:13:15 2019 New Revision: 351472 URL: https://svnweb.freebsd.org/changeset/base/351472 Log: nullfs: reduce areas protected by vnode interlock Some places only take the interlock to hold the vnode, which was a requiremnt before they started being manipulated with atomics. Use the newly introduced vholdnz to bump the count. Reviewed by: kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21358 Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 2019 (r351471) +++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 2019 (r351472) @@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) * We prevent it from being recycled by holding the vnode * here. */ - vholdl(lvp); + vholdnz(lvp); error = VOP_LOCK(lvp, flags); /* @@ -710,31 +710,16 @@ static int null_unlock(struct vop_unlock_args *ap) { struct vnode *vp = ap->a_vp; - int flags = ap->a_flags; - int mtxlkflag = 0; struct null_node *nn; struct vnode *lvp; int error; - if ((flags & LK_INTERLOCK) != 0) - mtxlkflag = 1; - else if (mtx_owned(VI_MTX(vp)) == 0) { - VI_LOCK(vp); - mtxlkflag = 2; - } nn = VTONULL(vp); if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { - VI_LOCK_FLAGS(lvp, MTX_DUPOK); - flags |= LK_INTERLOCK; - vholdl(lvp); - VI_UNLOCK(vp); - error = VOP_UNLOCK(lvp, flags); + vholdnz(lvp); + error = VOP_UNLOCK(lvp, 0); vdrop(lvp); - if (mtxlkflag == 0) - VI_LOCK(vp); } else { - if (mtxlkflag == 2) - VI_UNLOCK(vp); error = vop_stdunlock(ap); } @@ -845,10 +830,8 @@ null_getwritemount(struct vop_getwritemount_args *ap) VI_LOCK(vp); xp = VTONULL(vp); if (xp && (lowervp = xp->null_lowervp)) { - VI_LOCK_FLAGS(lowervp, MTX_DUPOK); + vholdnz(lowervp); VI_UNLOCK(vp); - vholdl(lowervp); - VI_UNLOCK(lowervp); VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); vdrop(lowervp); } else { From owner-svn-src-head@freebsd.org Sun Aug 25 07:06:53 2019 Return-Path: Delivered-To: svn-src-head@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 64D1DD7B44; Sun, 25 Aug 2019 07:06:53 +0000 (UTC) (envelope-from dougm@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 46GR5T0NsSz4dKx; Sun, 25 Aug 2019 07:06:53 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4BD919DC5; Sun, 25 Aug 2019 07:06:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7P76qb3082322; Sun, 25 Aug 2019 07:06:52 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P76qc1082319; Sun, 25 Aug 2019 07:06:52 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201908250706.x7P76qc1082319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sun, 25 Aug 2019 07:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351476 - in head/sys: security/mac vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: security/mac vm X-SVN-Commit-Revision: 351476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 07:06:53 -0000 Author: dougm Date: Sun Aug 25 07:06:51 2019 New Revision: 351476 URL: https://svnweb.freebsd.org/changeset/base/351476 Log: vm_map_simplify_entry considers merging an entry with its two neighbors, and is used in a way so that if entries a and b cannot be merged, we consider them twice, first not-merging a with its successor b, and then not-merging b with its predecessor a. This change replaces vm_map_simplify_entry with vm_map_try_merge_entries, which compares two adjacent entries only, and uses it to avoid duplicated merge-checks. Tested by: pho Reviewed by: alc Approved by: markj (implicit) Differential Revision: https://reviews.freebsd.org/D20814 Modified: head/sys/security/mac/mac_process.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/security/mac/mac_process.c ============================================================================== --- head/sys/security/mac/mac_process.c Sun Aug 25 06:22:13 2019 (r351475) +++ head/sys/security/mac/mac_process.c Sun Aug 25 07:06:51 2019 (r351476) @@ -363,7 +363,7 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct u } pmap_protect(map->pmap, vme->start, vme->end, vme->protection & ~revokeperms); - vm_map_simplify_entry(map, vme); + vm_map_try_merge_entries(map, vme->prev, vme); } } vm_map_unlock(map); Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Aug 25 06:22:13 2019 (r351475) +++ head/sys/vm/vm_map.c Sun Aug 25 07:06:51 2019 (r351476) @@ -1554,7 +1554,7 @@ charged: map->size += end - prev_entry->end; vm_map_entry_resize(map, prev_entry, end - prev_entry->end); - vm_map_simplify_entry(map, prev_entry); + vm_map_try_merge_entries(map, prev_entry, prev_entry->next); return (KERN_SUCCESS); } @@ -1614,7 +1614,8 @@ charged: * with the previous entry when object is NULL. Here, we handle the * other cases, which are less common. */ - vm_map_simplify_entry(map, new_entry); + vm_map_try_merge_entries(map, prev_entry, new_entry); + vm_map_try_merge_entries(map, new_entry, new_entry->next); if ((cow & (MAP_PREFAULT | MAP_PREFAULT_PARTIAL)) != 0) { vm_map_pmap_enter(map, start, prot, object, OFF_TO_IDX(offset), @@ -2083,34 +2084,24 @@ vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_en } /* - * vm_map_simplify_entry: + * vm_map_try_merge_entries: * - * Simplify the given map entry by merging with either neighbor. This - * routine also has the ability to merge with both neighbors. + * Compare the given map entry to its predecessor, and merge its precessor + * into it if possible. The entry remains valid, and may be extended. + * The predecessor may be deleted. * * The map must be locked. - * - * This routine guarantees that the passed entry remains valid (though - * possibly extended). When merging, this routine may delete one or - * both neighbors. */ void -vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry) +vm_map_try_merge_entries(vm_map_t map, vm_map_entry_t prev, vm_map_entry_t entry) { - vm_map_entry_t next, prev; - if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) != 0) - return; - prev = entry->prev; - if (vm_map_mergeable_neighbors(prev, entry)) { + VM_MAP_ASSERT_LOCKED(map); + if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) == 0 && + vm_map_mergeable_neighbors(prev, entry)) { vm_map_entry_unlink(map, prev, UNLINK_MERGE_NEXT); vm_map_merged_neighbor_dispose(map, prev); } - next = entry->next; - if (vm_map_mergeable_neighbors(entry, next)) { - vm_map_entry_unlink(map, next, UNLINK_MERGE_PREV); - vm_map_merged_neighbor_dispose(map, next); - } } /* @@ -2580,7 +2571,8 @@ again: * [Note that clipping is not necessary the second time.] */ for (current = entry; current->start < end; - vm_map_simplify_entry(map, current), current = current->next) { + vm_map_try_merge_entries(map, current->prev, current), + current = current->next) { if (rv != KERN_SUCCESS || (current->eflags & MAP_ENTRY_GUARD) != 0) continue; @@ -2618,6 +2610,7 @@ again: #undef MASK } } + vm_map_try_merge_entries(map, current->prev, current); vm_map_unlock(map); return (rv); } @@ -2722,8 +2715,9 @@ vm_map_madvise( default: break; } - vm_map_simplify_entry(map, current); + vm_map_try_merge_entries(map, current->prev, current); } + vm_map_try_merge_entries(map, current->prev, current); vm_map_unlock(map); } else { vm_pindex_t pstart, pend; @@ -2837,9 +2831,10 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || new_inheritance != VM_INHERIT_ZERO) entry->inheritance = new_inheritance; - vm_map_simplify_entry(map, entry); + vm_map_try_merge_entries(map, entry->prev, entry); entry = entry->next; } + vm_map_try_merge_entries(map, entry->prev, entry); vm_map_unlock(map); return (KERN_SUCCESS); } @@ -3016,8 +3011,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs entry->eflags &= ~MAP_ENTRY_NEEDS_WAKEUP; need_wakeup = true; } - vm_map_simplify_entry(map, entry); + vm_map_try_merge_entries(map, entry->prev, entry); } + vm_map_try_merge_entries(map, entry->prev, entry); vm_map_unlock(map); if (need_wakeup) vm_map_wakeup(map); @@ -3313,8 +3309,9 @@ done: entry->eflags &= ~MAP_ENTRY_NEEDS_WAKEUP; need_wakeup = true; } - vm_map_simplify_entry(map, entry); + vm_map_try_merge_entries(map, entry->prev, entry); } + vm_map_try_merge_entries(map, entry->prev, entry); if (need_wakeup) vm_map_wakeup(map); return (rv); @@ -3952,8 +3949,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c old_entry->object.vm_object); /* - * As in vm_map_simplify_entry(), the - * vnode lock will not be acquired in + * As in vm_map_merged_neighbor_dispose(), + * the vnode lock will not be acquired in * this call to vm_object_deallocate(). */ vm_object_deallocate(object); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Aug 25 06:22:13 2019 (r351475) +++ head/sys/vm/vm_map.h Sun Aug 25 07:06:51 2019 (r351476) @@ -418,7 +418,8 @@ void vm_map_lookup_done (vm_map_t, vm_map_entry_t); boolean_t vm_map_lookup_entry (vm_map_t, vm_offset_t, vm_map_entry_t *); int vm_map_protect (vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); int vm_map_remove (vm_map_t, vm_offset_t, vm_offset_t); -void vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry); +void vm_map_try_merge_entries(vm_map_t map, vm_map_entry_t prev, + vm_map_entry_t entry); void vm_map_startup (void); int vm_map_submap (vm_map_t, vm_offset_t, vm_offset_t, vm_map_t); int vm_map_sync(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t); From owner-svn-src-head@freebsd.org Sun Aug 25 07:29:09 2019 Return-Path: Delivered-To: svn-src-head@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 1E681D817E; Sun, 25 Aug 2019 07:29:09 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46GRb74b5gz4fHG; Sun, 25 Aug 2019 07:29:07 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x7P7SoEb088355 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Aug 2019 17:28:56 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x7P7Sju4005334 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 25 Aug 2019 17:28:45 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x7P7Sis4005333; Sun, 25 Aug 2019 17:28:44 +1000 (AEST) (envelope-from peter) Date: Sun, 25 Aug 2019 17:28:44 +1000 From: Peter Jeremy To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351187 - head/sys/arm64/rockchip Message-ID: <20190825072844.GA4799@server.rulingia.com> References: <201908180919.x7I9JXGj021325@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <201908180919.x7I9JXGj021325@repo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46GRb74b5gz4fHG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[rulingia.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.11)[asn: 20473(-0.50), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.33)[-0.334,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 07:29:09 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Aug-18 09:19:33 +0000, Michal Meloun wrote: > Improve rk_pinctrl driver: Sorry for the late notice but this breaks my Rock64 (RK3328). I'm using: U-Boot 2017.09-rockchip-ayufan-1035-gd646df03ac (Oct 26 2018 - 08:36:01 +00= 00) At r351452, the kernel boot looks like: =2E.. gic0: mem 0xff811000-0xff811fff,0xff8120= 00-0xff813fff,0xff814000-0xff815fff,0xff816000-0xff817fff irq 48 on ofwbus0 gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 160 rk_pinctrl0: on ofwbus0 rk_pinctrl0: Cannot attach GPIO subdevice: gpio0@ff210000 rk_pinctrl0: Cannot attach GPIO subdevice: gpio1@ff220000 rk_pinctrl0: Cannot attach GPIO subdevice: gpio2@ff230000 rk_pinctrl0: Cannot attach GPIO subdevice: gpio3@ff240000 panic: acquiring blockable sleep lock with spinlock or critical section hel= d (sleep mutex) pmap @ /usr/src/sys/arm64/arm64/pmap.c:5819 cpuid =3D 0 time =3D 1 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc =3D 0xffff00000054c9ac lr =3D 0xffff0000000e2908 sp =3D 0xffff000000010100 fp =3D 0xffff000000010310 db_trace_self_wrapper() at vpanic+0x18c pc =3D 0xffff0000000e2908 lr =3D 0xffff00000027e848 sp =3D 0xffff000000010320 fp =3D 0xffff0000000103c0 vpanic() at panic+0x44 pc =3D 0xffff00000027e848 lr =3D 0xffff00000027e5f8 sp =3D 0xffff0000000103d0 fp =3D 0xffff000000010450 panic() at witness_checkorder+0xa80 pc =3D 0xffff00000027e5f8 lr =3D 0xffff0000002e5348 sp =3D 0xffff000000010460 fp =3D 0xffff0000000104d0 witness_checkorder() at __mtx_lock_flags+0xb0 pc =3D 0xffff0000002e5348 lr =3D 0xffff00000025e574 sp =3D 0xffff0000000104e0 fp =3D 0xffff000000010520 __mtx_lock_flags() at pmap_fault+0x1bc pc =3D 0xffff00000025e574 lr =3D 0xffff000000566c00 sp =3D 0xffff000000010530 fp =3D 0xffff000000010550 pmap_fault() at data_abort+0xc0 pc =3D 0xffff000000566c00 lr =3D 0xffff000000568a68 sp =3D 0xffff000000010560 fp =3D 0xffff000000010610 data_abort() at do_el1h_sync+0x128 pc =3D 0xffff000000568a68 lr =3D 0xffff0000005688a4 sp =3D 0xffff000000010620 fp =3D 0xffff000000010650 do_el1h_sync() at handle_el1h_sync+0x74 pc =3D 0xffff0000005688a4 lr =3D 0xffff00000054f074 sp =3D 0xffff000000010660 fp =3D 0xffff000000010770 handle_el1h_sync() at simple_mfd_syscon_modify_4+0x60 pc =3D 0xffff00000054f074 lr =3D 0xffff0000000fd334 sp =3D 0xffff000000010780 fp =3D 0xffff000000010830 simple_mfd_syscon_modify_4() at rk_pinctrl_configure_pins+0x1b4 pc =3D 0xffff0000000fd334 lr =3D 0xffff0000005795fc sp =3D 0xffff000000010840 fp =3D 0xffff0000000108c0 rk_pinctrl_configure_pins() at pinctrl_configure_children+0x120 pc =3D 0xffff0000005795fc lr =3D 0xffff0000000fc4dc sp =3D 0xffff0000000108d0 fp =3D 0xffff000000010950 pinctrl_configure_children() at fdt_pinctrl_configure_tree+0x20 pc =3D 0xffff0000000fc4dc lr =3D 0xffff0000000fc3a8 sp =3D 0xffff000000010960 fp =3D 0xffff000000010970 fdt_pinctrl_configure_tree() at rk_pinctrl_attach+0x310 pc =3D 0xffff0000000fc3a8 lr =3D 0xffff000000579414 sp =3D 0xffff000000010980 fp =3D 0xffff0000000109e0 rk_pinctrl_attach() at device_attach+0x3f4 pc =3D 0xffff000000579414 lr =3D 0xffff0000002b3f18 sp =3D 0xffff0000000109f0 fp =3D 0xffff000000010a40 device_attach() at bus_generic_new_pass+0x12c pc =3D 0xffff0000002b3f18 lr =3D 0xffff0000002b5ccc sp =3D 0xffff000000010a50 fp =3D 0xffff000000010a80 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff0000002b5ccc lr =3D 0xffff0000002b5c84 sp =3D 0xffff000000010a90 fp =3D 0xffff000000010ac0 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff0000002b5c84 lr =3D 0xffff0000002b5c84 sp =3D 0xffff000000010ad0 fp =3D 0xffff000000010b00 bus_generic_new_pass() at bus_set_pass+0x8c pc =3D 0xffff0000002b5c84 lr =3D 0xffff0000002b1674 sp =3D 0xffff000000010b10 fp =3D 0xffff000000010b40 bus_set_pass() at mi_startup+0x238 pc =3D 0xffff0000002b1674 lr =3D 0xffff000000217b50 sp =3D 0xffff000000010b50 fp =3D 0xffff000000010bb0 mi_startup() at virtdone+0x54 pc =3D 0xffff000000217b50 lr =3D 0xffff000000001084 sp =3D 0xffff000000010bc0 fp =3D 0x0000000000000000 ---- When I revert r351187, I get: =2E.. gic0: mem 0xff811000-0xff811fff,0xff8120= 00-0xff813fff,0xff814000-0xff815fff,0xff816000-0xff817fff irq 48 on ofwbus0 gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 160 rk_pinctrl0: on ofwbus0 rk_i2c0: mem 0xff160000-0xff160fff irq 16 on ofwbus0 iicbus0: on rk_i2c0 gpio0: mem 0xff210000-0xff2100ff irq 51 on = rk_pinctrl0 gpiobus0: on gpio0 gpio1: mem 0xff220000-0xff2200ff irq 52 on = rk_pinctrl0 gpiobus1: on gpio1 gpio2: mem 0xff230000-0xff2300ff irq 53 on = rk_pinctrl0 gpiobus2: on gpio2 gpio3: mem 0xff240000-0xff2400ff irq 54 on = rk_pinctrl0 gpiobus3: on gpio3 rk805_pmu0: at addr 0x30 irq 55 on iicbus0 =2E.. I haven't dug into this further yet. --=20 Peter Jeremy --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl1iOKFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRllA/+N3jpXxqKYRejpt1aa+uEoOiAxFeC+HnX0GUD9tte7td30wBtrDhM+jEH fLKT9DdXEM9YFYB2NVOS3E5xVYYxBuOS6e7wG2m8aGCVowgKbtuC6s19PxzML0QQ 03PhxTNZQzO5e1hBSj7+JPRunFC0zIzYwSLhhxt9148epttGSumNGAzGrAYBh2JR Ufd3aSqr0KCdtNP/FwK9dNYZvhr5oStTNVHlegUQyk8KIwuy57XwVPaBk9I23/vT cbjd2IbTlSQq5XTPTQ/XYgMy1tj1RIs8wWVcc+MYCHRQyY2B7pwQWJS2ZY7GSrxI M/nAhKcffzCDjpgl0gCYHeVAYB/07PVgDkQeLE6uy0fvRo82OiW4hmF68pkdKzTe N/zgJTc+mPeyUi3H9+Fv98w8cB+NiOgEsUr7+mS2BFGl8dfjlaEMzql1938Yp4Gw DyYGVrXEPRw471GfnqYALgMVHsRlYb3JtBsFexS4aNo4Aptr6z80jI7Cd3DxM/2B 6kqZllF33ZDXv/CymV9WGGP6smzz8AF3fen07f98MxjOs17pgw/LRgXt4V6Y3PHw GGmLLQ5Ga00pQLmG/+ppbvzWHgPx3KBftjD+NKBjoESsR90htqAdpRWTNjI525hM Hcr203t30GbJokuMLPFEKD6p5VIh3c2ENVCYmdJeumeiSUmj8yA= =N+9R -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- From owner-svn-src-head@freebsd.org Sun Aug 25 07:50:45 2019 Return-Path: Delivered-To: svn-src-head@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 98A0AD8958; Sun, 25 Aug 2019 07:50:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46GS453Tw0z4g6d; Sun, 25 Aug 2019 07:50:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 581801A516; Sun, 25 Aug 2019 07:50:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7P7ojXS007109; Sun, 25 Aug 2019 07:50:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7P7ojPg007108; Sun, 25 Aug 2019 07:50:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908250750.x7P7ojPg007108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 25 Aug 2019 07:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351477 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 07:50:45 -0000 Author: delphij Date: Sun Aug 25 07:50:44 2019 New Revision: 351477 URL: https://svnweb.freebsd.org/changeset/base/351477 Log: GZIO: Update to use zlib 1.2.11. PR: 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D21408 Modified: head/sys/kern/subr_compressor.c Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Sun Aug 25 07:06:51 2019 (r351476) +++ head/sys/kern/subr_compressor.c Sun Aug 25 07:50:44 2019 (r351477) @@ -66,8 +66,7 @@ SET_DECLARE(compressors, struct compressor_methods); #ifdef GZIO -#include -#include +#include struct gz_stream { uint8_t *gz_buffer; /* output buffer */ @@ -141,7 +140,7 @@ gz_reset(void *stream) s = stream; s->gz_off = 0; - s->gz_crc = ~0U; + s->gz_crc = crc32(0L, Z_NULL, 0); (void)deflateReset(&s->gz_stream); s->gz_stream.avail_out = s->gz_bufsz; @@ -173,9 +172,8 @@ gz_write(void *stream, void *data, size_t len, compres if (len > 0) { s->gz_stream.avail_in = len; s->gz_stream.next_in = data; - s->gz_crc = crc32_raw(data, len, s->gz_crc); - } else - s->gz_crc ^= ~0U; + s->gz_crc = crc32(s->gz_crc, data, len); + } error = 0; do { From owner-svn-src-head@freebsd.org Sun Aug 25 13:26:07 2019 Return-Path: Delivered-To: svn-src-head@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 72608DFC44; Sun, 25 Aug 2019 13:26:07 +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 46GbW32DrQz3xkB; Sun, 25 Aug 2019 13:26:07 +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 2E8D51E2C4; Sun, 25 Aug 2019 13:26:07 +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 x7PDQ6HG007921; Sun, 25 Aug 2019 13:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PDQ63D007919; Sun, 25 Aug 2019 13:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908251326.x7PDQ63D007919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Aug 2019 13:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351478 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 351478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 13:26:07 -0000 Author: kib Date: Sun Aug 25 13:26:06 2019 New Revision: 351478 URL: https://svnweb.freebsd.org/changeset/base/351478 Log: Move OBJT_VNODE specific code from vm_object_terminate() to vnode_destroy_vobject(). Reviewed by: alc, jeff (previous version), markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21357 Modified: head/sys/vm/vm_object.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Aug 25 07:50:44 2019 (r351477) +++ head/sys/vm/vm_object.c Sun Aug 25 13:26:06 2019 (r351478) @@ -653,9 +653,10 @@ doterm: * recursion due to the terminate having to sync data * to disk. */ - if ((object->flags & OBJ_DEAD) == 0) + if ((object->flags & OBJ_DEAD) == 0) { + vm_object_set_flag(object, OBJ_DEAD); vm_object_terminate(object); - else + } else VM_OBJECT_WUNLOCK(object); object = temp; } @@ -746,35 +747,9 @@ vm_object_terminate_pages(vm_object_t object) void vm_object_terminate(vm_object_t object) { - VM_OBJECT_ASSERT_WLOCKED(object); - - /* - * Make sure no one uses us. - */ - vm_object_set_flag(object, OBJ_DEAD); - - /* - * Clean and free the pages, as appropriate. All references to the - * object are gone, so we don't need to lock it. - */ - if (object->type == OBJT_VNODE) { - struct vnode *vp = (struct vnode *)object->handle; - - /* - * Clean pages and flush buffers. - */ - vm_object_page_clean(object, 0, 0, OBJPC_SYNC); - VM_OBJECT_WUNLOCK(object); - - vinvalbuf(vp, V_SAVE, 0, 0); - - BO_LOCK(&vp->v_bufobj); - vp->v_bufobj.bo_flag |= BO_DEAD; - BO_UNLOCK(&vp->v_bufobj); - - VM_OBJECT_WLOCK(object); - } + KASSERT((object->flags & OBJ_DEAD) != 0, + ("terminating non-dead obj %p", object)); /* * wait for the pageout daemon to be done with the object Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Aug 25 07:50:44 2019 (r351477) +++ head/sys/vm/vnode_pager.c Sun Aug 25 13:26:06 2019 (r351478) @@ -200,6 +200,21 @@ vnode_destroy_vobject(struct vnode *vp) * don't double-terminate the object */ if ((obj->flags & OBJ_DEAD) == 0) { + vm_object_set_flag(obj, OBJ_DEAD); + + /* + * Clean pages and flush buffers. + */ + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + + vinvalbuf(vp, V_SAVE, 0, 0); + + BO_LOCK(&vp->v_bufobj); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); + + VM_OBJECT_WLOCK(obj); vm_object_terminate(obj); } else { /* From owner-svn-src-head@freebsd.org Sun Aug 25 17:13:02 2019 Return-Path: Delivered-To: svn-src-head@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 41891E3DE7; Sun, 25 Aug 2019 17:13:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46GhXt11cDz48t5; Sun, 25 Aug 2019 17:13:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF91E20C1C; Sun, 25 Aug 2019 17:13:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PHD1h8044463; Sun, 25 Aug 2019 17:13:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PHD1sp044459; Sun, 25 Aug 2019 17:13:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908251713.x7PHD1sp044459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 25 Aug 2019 17:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351480 - in head: . sys/conf sys/libkern sys/modules/zlib sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: . sys/conf sys/libkern sys/modules/zlib sys/sys X-SVN-Commit-Revision: 351480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 17:13:02 -0000 Author: delphij Date: Sun Aug 25 17:13:00 2019 New Revision: 351480 URL: https://svnweb.freebsd.org/changeset/base/351480 Log: Remove zlib 1.0.4 from kernel. PR: 229763 Reviewed by: emaste, Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D21375 Deleted: head/sys/libkern/zlib.c head/sys/sys/zlib.h head/sys/sys/zutil.h Modified: head/ObsoleteFiles.inc head/sys/conf/files head/sys/modules/zlib/Makefile head/sys/sys/param.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 25 13:36:20 2019 (r351479) +++ head/ObsoleteFiles.inc Sun Aug 25 17:13:00 2019 (r351480) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190825: zlib 1.0.4 removed from kernel +OLD_FILES+=/usr/include/sys/zlib.h +OLD_FILES+=/usr/include/sys/zutil.h # 20190817: pft_ping.py and sniffer.py moved to /usr/tests/sys/netpfil/common OLD_FILES+=usr/tests/sys/netpfil/pf/sniffer.py OLD_FILES+=usr/tests/sys/netpfil/pf/pft_ping.py Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Aug 25 13:36:20 2019 (r351479) +++ head/sys/conf/files Sun Aug 25 17:13:00 2019 (r351480) @@ -3999,8 +3999,6 @@ libkern/strtoul.c standard libkern/strtouq.c standard libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard -libkern/zlib.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | netgraph_deflate | ddb_ctf | gzio contrib/zlib/adler32.c optional crypto | geom_uzip | ipsec | \ ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib contrib/zlib/compress.c optional crypto | geom_uzip | ipsec | \ Modified: head/sys/modules/zlib/Makefile ============================================================================== --- head/sys/modules/zlib/Makefile Sun Aug 25 13:36:20 2019 (r351479) +++ head/sys/modules/zlib/Makefile Sun Aug 25 17:13:00 2019 (r351480) @@ -5,9 +5,6 @@ .PATH: ${SRCTOP}/sys/contrib/zlib KMOD= zlib -# legacy zlib - 1.0.4 -SRCS= zlib.c -# newer zlib - 1.2.11 SRCS+= zcalloc.c SRCS+= zlib_mod.c SRCS+= adler32.c Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Aug 25 13:36:20 2019 (r351479) +++ head/sys/sys/param.h Sun Aug 25 17:13:00 2019 (r351480) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300040 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300041 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Aug 25 17:55:33 2019 Return-Path: Delivered-To: svn-src-head@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 6E3CBE490D; Sun, 25 Aug 2019 17:55:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46GjTx2Htzz4Bgg; Sun, 25 Aug 2019 17:55:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 163D721348; Sun, 25 Aug 2019 17:55:33 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PHtWF3068495; Sun, 25 Aug 2019 17:55:32 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PHtWNF068489; Sun, 25 Aug 2019 17:55:32 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201908251755.x7PHtWNF068489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 25 Aug 2019 17:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351481 - in head: etc/mtree usr.sbin/mixer usr.sbin/mixer/tests X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head: etc/mtree usr.sbin/mixer usr.sbin/mixer/tests X-SVN-Commit-Revision: 351481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 17:55:33 -0000 Author: 0mp (ports committer) Date: Sun Aug 25 17:55:31 2019 New Revision: 351481 URL: https://svnweb.freebsd.org/changeset/base/351481 Log: mixer(8): Report an error if the passed value is an empty string This patch fixes a bug that made the mixer command enter an infinite loop when instructed to set the value of a device to an empty string (e.g., `mixer vol ""`). Additionally, some tests for mixer(8) are being added. PR: 240039 Reviewed by: hselasky, mav Approved by: src (hselasky, mav) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21409 Added: head/usr.sbin/mixer/tests/ head/usr.sbin/mixer/tests/Makefile (contents, props changed) head/usr.sbin/mixer/tests/mixer_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/mixer/Makefile head/usr.sbin/mixer/mixer.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Aug 25 17:13:00 2019 (r351480) +++ head/etc/mtree/BSD.tests.dist Sun Aug 25 17:55:31 2019 (r351481) @@ -821,6 +821,8 @@ .. link .. + mixer + .. mkdir .. mkfifo Modified: head/usr.sbin/mixer/Makefile ============================================================================== --- head/usr.sbin/mixer/Makefile Sun Aug 25 17:13:00 2019 (r351480) +++ head/usr.sbin/mixer/Makefile Sun Aug 25 17:55:31 2019 (r351481) @@ -1,6 +1,11 @@ # $FreeBSD$ +.include + PROG= mixer MAN= mixer.8 + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.sbin/mixer/mixer.c ============================================================================== --- head/usr.sbin/mixer/mixer.c Sun Aug 25 17:13:00 2019 (r351480) +++ head/usr.sbin/mixer/mixer.c Sun Aug 25 17:55:31 2019 (r351481) @@ -241,6 +241,11 @@ main(int argc, char *argv[]) lrel = rrel = 0; if (argc > 1) { m = sscanf(argv[1], "%7[^:]:%7s", lstr, rstr); + if (m == EOF) { + warnx("invalid value: %s", argv[1]); + dusage = 1; + break; + } if (m > 0) { if (*lstr == '+' || *lstr == '-') lrel = rrel = 1; Added: head/usr.sbin/mixer/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mixer/tests/Makefile Sun Aug 25 17:55:31 2019 (r351481) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= mixer_test + +.include Added: head/usr.sbin/mixer/tests/mixer_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mixer/tests/mixer_test.sh Sun Aug 25 17:55:31 2019 (r351481) @@ -0,0 +1,123 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Mateusz Piotrowski <0mp@FreeBSD.org> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# $FreeBSD$ + +mixer_unavailable() +{ + ! { mixer && mixer vol; } >/dev/null 2>&1 +} + +save_mixer_vol() +{ + atf_check -o match:'^[0-9]{1,3}:[0-9]{1,3}$' -o save:saved_vol \ + -x "mixer vol | awk '{print \$7}'" +} + +set_mixer_vol() +{ + atf_check \ + -o match:'^Setting the mixer vol from [0-9]{1,3}:[0-9]{1,3} to 0:0\.$' \ + mixer vol 0 +} + +restore_mixer_vol() +{ + if [ -r "saved_vol" ]; then + mixer vol "$(cat saved_vol)" + fi +} + +atf_test_case s_flag cleanup +s_flag_head() +{ + atf_set "descr" "Verify that the output of the -s flag could be " \ + "reused as command-line arguments to the mixer command" +} +s_flag_body() +{ + if mixer_unavailable; then + atf_skip "This test requires mixer support" + fi + save_mixer_vol + set_mixer_vol + atf_check -o inline:"vol 0:0" -o save:values mixer -s vol + atf_check -o inline:"Setting the mixer vol from 0:0 to 0:0.\n" \ + mixer $(cat values) +} +s_flag_cleanup() +{ + restore_mixer_vol +} + +atf_test_case S_flag cleanup +S_flag_head() +{ + atf_set "descr" "Verify that the output of the -S flag is " \ + "matching the documented behavior" +} +S_flag_body() +{ + if mixer_unavailable; then + atf_skip "This test requires mixer support" + fi + save_mixer_vol + set_mixer_vol + atf_check -o inline:"vol:0:0" mixer -S vol +} +S_flag_cleanup() +{ + restore_mixer_vol +} + +atf_test_case set_empty_value +set_empty_value_head() +{ + atf_set "descr" "Verify that mixer returns when the provided " \ + "value to set is an empty string instead of a number" + atf_set "timeout" "1" +} +set_empty_value_body() +{ + if mixer_unavailable; then + atf_skip "This test requires mixer support" + fi + save_mixer_vol + atf_check -s exit:1 -e inline:"mixer: invalid value: \n" \ + -o match:"^usage:" mixer vol "" +} +set_empty_value_cleanup() +{ + restore_mixer_vol +} + + +atf_init_test_cases() +{ + atf_add_test_case s_flag + atf_add_test_case S_flag + atf_add_test_case set_empty_value +} From owner-svn-src-head@freebsd.org Sun Aug 25 18:46:11 2019 Return-Path: Delivered-To: svn-src-head@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 45139E666E; Sun, 25 Aug 2019 18:46:11 +0000 (UTC) (envelope-from hrs@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 46GkcM0ft0z4HLW; Sun, 25 Aug 2019 18:46:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED18F21C71; Sun, 25 Aug 2019 18:46:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PIkA54002315; Sun, 25 Aug 2019 18:46:10 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PIkAUc002314; Sun, 25 Aug 2019 18:46:10 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201908251846.x7PIkAUc002314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 25 Aug 2019 18:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351482 - head/sys/dev/vmware/vmci X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/sys/dev/vmware/vmci X-SVN-Commit-Revision: 351482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 18:46:11 -0000 Author: hrs Date: Sun Aug 25 18:46:10 2019 New Revision: 351482 URL: https://svnweb.freebsd.org/changeset/base/351482 Log: Add MODULE_PNP_INFO() to vmci(4). This allows devd(8) to load the kernel module automatically when FreeBSD is running on VMware. Reviewed by: mp Differential Revision: https://reviews.freebsd.org/D21182 Modified: head/sys/dev/vmware/vmci/vmci.c Modified: head/sys/dev/vmware/vmci/vmci.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci.c Sun Aug 25 17:55:31 2019 (r351481) +++ head/sys/dev/vmware/vmci/vmci.c Sun Aug 25 18:46:10 2019 (r351482) @@ -73,6 +73,16 @@ static driver_t vmci_driver = { static devclass_t vmci_devclass; DRIVER_MODULE(vmci, pci, vmci_driver, vmci_devclass, 0, 0); MODULE_VERSION(vmci, VMCI_VERSION); +const struct { + uint16_t vendor; + uint16_t device; + const char *desc; +} vmci_ids[] = { + { VMCI_VMWARE_VENDOR_ID, VMCI_VMWARE_DEVICE_ID, + "VMware Virtual Machine Communication Interface" }, +}; +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, vmci, vmci_ids, + nitems(vmci_ids)); MODULE_DEPEND(vmci, pci, 1, 1, 1); @@ -112,10 +122,9 @@ static int vmci_probe(device_t dev) { - if (pci_get_vendor(dev) == VMCI_VMWARE_VENDOR_ID && - pci_get_device(dev) == VMCI_VMWARE_DEVICE_ID) { - device_set_desc(dev, - "VMware Virtual Machine Communication Interface"); + if (pci_get_vendor(dev) == vmci_ids[0].vendor && + pci_get_device(dev) == vmci_ids[0].device) { + device_set_desc(dev, vmci_ids[0].desc); return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@freebsd.org Sun Aug 25 18:52:10 2019 Return-Path: Delivered-To: svn-src-head@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 D8595E6953; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@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 46GklG5D4cz4JdS; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9440721E42; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PIqA3t009797; Sun, 25 Aug 2019 18:52:10 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PIqAnV009796; Sun, 25 Aug 2019 18:52:10 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201908251852.x7PIqAnV009796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 25 Aug 2019 18:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351483 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 351483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 18:52:10 -0000 Author: hrs Date: Sun Aug 25 18:52:10 2019 New Revision: 351483 URL: https://svnweb.freebsd.org/changeset/base/351483 Log: Document soft updates journaling and GEOM-based UFS journaling. Reviewed by: mckusick Modified: head/share/man/man7/ffs.7 Modified: head/share/man/man7/ffs.7 ============================================================================== --- head/share/man/man7/ffs.7 Sun Aug 25 18:46:10 2019 (r351482) +++ head/share/man/man7/ffs.7 Sun Aug 25 18:52:10 2019 (r351483) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2001 +.Dd August 25, 2019 .Dt FFS 7 .Os .Sh NAME @@ -46,6 +46,7 @@ In the kernel configuration file: .Cd "options UFS_DIRHASH" .Cd "options UFS_EXTATTR" .Cd "options UFS_EXTATTR_AUTOSTART" +.Cd "options UFS_GJOURNAL" .Pp In .Xr fstab 5 : @@ -84,20 +85,65 @@ and enforces metadata update dependencies (e.g., updating free block maps) to ensure that the file system remains consistent. .Pp -To enable soft updates on an -.Em unmounted -file system, use the following command: +To create a new file system with the soft updates +enabled, +use +.Xr newfs 8 +command: .Pp -.D1 Nm tunefs Fl n Cm enable Ar fs +.D1 Nm newfs Fl U Ar fs .Pp .Ar fs can be either a mount point listed in .Xr fstab 5 -(e.g., -.Pa /usr ) , +.Pq e.g. , Pa /usr , or a disk device -(e.g., -.Pa /dev/da0a ) . +.Pq e.g., Pa /dev/da0a . +.Pp +It is possible to enable soft updates on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl n Cm enable Ar fs +.Pp +Soft updates can also add journaling that reduces the time spent by +.Xr fsck_ffs 8 +cleaning up a filesystem after a crash from several minutes to a few seconds. +The journal is placed in an inode named +.Pa .sujournal , +and is kept as a circular log of segments containing +records that describe metadata operations. +.Pp +To create a new file system with both the soft updates +and soft updates journaling enabled, +use the following command: +.Pp +.D1 Nm newfs Fl j Ar fs +.Pp +This runs +.Xr tunefs 8 +command after +.Xr newfs 8 +command with +.Fl U +flag enabled. +It is possible to enable soft updates journaling on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl j Cm enable Ar fs +.Pp +This flag automatically enables the soft updates feature +when it is not enabled. +Note that this +.Xr tunefs 8 +command will fail if a file +.Pa .sujournal +already exists before enabling the soft updates journaling. .El .Ss File Ownership Inheritance .Bl -tag -width 2n @@ -155,10 +201,9 @@ extattrctl initattr -p / 388 posix1e.acl_default .Ed .Pp On the next mount of the root file system, -the attributes will be automatically started -(if +the attributes will be automatically started if .Dv UFS_EXTATTR_AUTOSTART -is included in the kernel configuration), +is included in the kernel configuration, and ACLs will be enabled. .Ss Directory Hashing .Bl -tag -width 2n @@ -183,7 +228,52 @@ subdirectory of the file system root during the mount If found, extended attribute support will be automatically started for that file system. .El +.Ss GEOM-based Journaling +.Bl -tag -width 2n +.It Cd "options UFS_GJOURNAL" +Implements a block level journaling of a UFS file system, +which is for both data and metadata. +To enable this, +create a +.Xr gjournal 8 +GEOM provider for a block device by using the +following command: .Pp +.D1 Nm gjournal label Ar da0 +.Pp +In this example, +.Pa /dev/da0 +is used as the target block device, +and +.Pa /dev/da0.journal +is created. +Then create a new file system by using +.Xr newfs 8 +with the block level journaling flag and mount it: +.Pp +.D1 Nm newfs Fl J Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.Pp +.Cm async +option is not mandatory but recommended for better performance +because the journaling guarantees the consistency of an +.Cm async +mount. +.Pp +It is also possible to enable the block level journaling +on an existing file system. +To do so, +use +.Xr gjournal 8 +utility to label the underlying block device and +.Xr tunefs 8 +utility to enable the block level journaling flag: +.Pp +.D1 Nm gjournal label Ar da0 +.D1 Nm tunefs Fl J Cm enable Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.El +.Ss Xr sysctl 8 MIBs The following .Xr sysctl 8 MIBs are defined for use with @@ -192,11 +282,11 @@ MIBs are defined for use with .It Va vfs.ffs.doasyncfree Asynchronously write out modified i-node and indirect blocks upon reallocating file system blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .It Va vfs.ffs.doreallocblks Enable support for the rearrangement of blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .El .Sh SEE ALSO .Xr quota 1 , @@ -204,7 +294,9 @@ to be contiguous. .Xr extattr 3 , .Xr edquota 8 , .Xr extattrctl 8 , -.Xr sysctl 8 +.Xr fsck_ffs 8 , +.Xr sysctl 8 , +.Xr tunefs 8 .Rs .%A M. McKusick .%A W. Joy @@ -223,4 +315,11 @@ to be contiguous. .%T "Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem" .%J "Proceedings of the Freenix Track at the 1999 Usenix Annual Technical Conference" .%P 71-84 +.Re +.Rs +.%A M. McKusick +.%A J. Roberson +.%D May 2010 +.%T "Journaled Soft-updates" +.%J "BSD Canada Conference 2010 (BSDCan)" .Re From owner-svn-src-head@freebsd.org Sun Aug 25 19:22:10 2019 Return-Path: Delivered-To: svn-src-head@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 A1C02E727A; Sun, 25 Aug 2019 19:22:10 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46GlPr515hz4Kxj; Sun, 25 Aug 2019 19:22:07 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x7PJLjxC092903 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Mon, 26 Aug 2019 04:21:56 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1566760925; bh=UqiS9Bk47B4z1rc2OtzTiCrQtHYT7+jPAszJfZUYorY=; h=Date:To:Cc:From:In-Reply-To:References; b=PWKRKG6tMRGjKqg307Dd6syVeKFpoLPzJTcLEFOrqFV0D8cG8iyHTzqI+eC+0hPVS bbXmYFClGx2nB9Bs5/hm5nXmaKR+lMoKDLC4JEGPrxmW8TOZQS+Crk32/2hn0vgS2s RL/pEHy4hGF3bjX8lqHEv6GJu1AyGm4gE8s5IpUc= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x7PJLePY068082 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 26 Aug 2019 04:21:40 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x7PJLemv068078; Mon, 26 Aug 2019 04:21:40 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Mon, 26 Aug 2019 04:20:56 +0900 (JST) Message-Id: <20190826.042056.1329861772202588895.hrs@allbsd.org> To: asomers@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests From: Hiroki Sato In-Reply-To: <201908231522.x7NFMLuJ068037@repo.freebsd.org> References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug_26_04_20_56_2019_001)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 26 Aug 2019 04:22:05 +0900 (JST) X-Rspamd-Queue-Id: 46GlPr515hz4Kxj X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=allbsd.org header.s=20190220 header.b=PWKRKG6t; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrs@allbsd.org designates 2001:2f0:104:e001::41 as permitted sender) smtp.mailfrom=hrs@allbsd.org X-Spamd-Result: default: False [-6.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[allbsd.org:s=20190220]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[allbsd.org]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[allbsd.org:+]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; MID_CONTAINS_FROM(1.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7514, ipnet:2001:2f0::/32, country:JP]; IP_SCORE(-2.03)[ip: (-9.69), ipnet: 2001:2f0::/32(-3.97), asn: 7514(3.52), country: JP(-0.03)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 19:22:10 -0000 ----Security_Multipart(Mon_Aug_26_04_20_56_2019_001)-- Content-Type: Text/Plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Hi, Alan Somers wrote in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: as> Author: asomers as> Date: Fri Aug 23 15:22:20 2019 as> New Revision: 351423 as> URL: https://svnweb.freebsd.org/changeset/base/351423 as> = as> Log: as> ping6: Rename options for better consistency with ping as> = as> Now equivalent options have the same flags, and nonequivalent opt= ions have as> different flags. This is a prelude to merging the two commands. as> = as> Submitted by: J=E1n Su=E8an as> MFC: Never as> Sponsored by: Google LLC (Google Summer of Code 2019) as> Differential Revision: https://reviews.freebsd.org/D21345 I have an objection on renaming the existing option flags in ping6(8) for compatibility with ping(8). Is it sufficient to add INET6 support to ping(8) with consistent flags and keep CLI of ping6(8) backward compatible? People have used ping6(8) for >15 years, so it is too late to rename the flags. I do not think the renaming is useful if "ping -6 localhost" or "ping ::1" works. -- Hiroki ----Security_Multipart(Mon_Aug_26_04_20_56_2019_001)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAl1i35gACgkQTyzT2CeTzy1D9gCgioFFIo6H4j0qGBdmJ1/ctDpL +zgAn0uVdU9nlHhWMaMtV1y7g72DqkDL =L9AM -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug_26_04_20_56_2019_001)---- From owner-svn-src-head@freebsd.org Sun Aug 25 19:27:15 2019 Return-Path: Delivered-To: svn-src-head@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 861B1E74BC; Sun, 25 Aug 2019 19:27:15 +0000 (UTC) (envelope-from hrs@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 46GlWl30vrz4LP3; Sun, 25 Aug 2019 19:27:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD3F223F1; Sun, 25 Aug 2019 19:27:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PJRFaP028381; Sun, 25 Aug 2019 19:27:15 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PJRFZO028380; Sun, 25 Aug 2019 19:27:15 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201908251927.x7PJRFZO028380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 25 Aug 2019 19:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351484 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 351484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 19:27:15 -0000 Author: hrs Date: Sun Aug 25 19:27:14 2019 New Revision: 351484 URL: https://svnweb.freebsd.org/changeset/base/351484 Log: Fix build (r351481). Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Aug 25 18:52:10 2019 (r351483) +++ head/etc/mtree/BSD.tests.dist Sun Aug 25 19:27:14 2019 (r351484) @@ -821,8 +821,6 @@ .. link .. - mixer - .. mkdir .. mkfifo @@ -1081,6 +1079,8 @@ fstyp .. makefs + .. + mixer .. newsyslog .. From owner-svn-src-head@freebsd.org Sun Aug 25 19:31:13 2019 Return-Path: Delivered-To: svn-src-head@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 C262CE7B04; Sun, 25 Aug 2019 19:31:13 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 46GlcJ4ZDHz4LnZ; Sun, 25 Aug 2019 19:31:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f42.google.com with SMTP id u13so761245lfm.9; Sun, 25 Aug 2019 12:31:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AlTvoVLrL4Vj6cRRprxXgTNJ69Va6MoTkcIK7bfcIbM=; b=OGL5MHRJjKa31+fX48JZz50JiFgusgrDZI4Efp09UTdOE5jDkEwdNAOTjk+8pU9edH ZrKDq0fOxsPg5ZtfDybjPdZZ0OULy4VTDZJLgaSJgt5fznU3+9Xe8IduLnEgmZVSJHiW vOb8+BZvI/ReIuzoKXhwC19ym8r/HsyZnheR85/Wh0YSu7cYC0nADJn+e3KBPzQjMuiO wFhqg6h28o4KYWojU+OrBU8ZyIA6Yj4YLuUnnhghyKe8gICyuo9+cBJkRXFdkN8umrCk e8uZInLXtIiZ631GfIXItXoVxS6NYILUaGGvTS+DpvlEH1XzUjBRdrnlVdPWwyt2nZrx zCBA== X-Gm-Message-State: APjAAAXjkbYlG7XtTwM83IHJFJh04eDlG+rIMXvenHIvmmPeKaDAgZXg DQzSMRlAFdlY2Tu67nvEo6ZNWhaT2X5stog5kNU= X-Google-Smtp-Source: APXvYqxn4rDHFsOwCNHymkGzcKAmWRGl1CBW0mL899/XhXvsldet2dWMUoQAAh6aPNIJfL4pjeeoT+aQXFOkH6BGYGI= X-Received: by 2002:a19:cbc4:: with SMTP id b187mr8496748lfg.27.1566761470845; Sun, 25 Aug 2019 12:31:10 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> In-Reply-To: <20190826.042056.1329861772202588895.hrs@allbsd.org> From: Alan Somers Date: Sun, 25 Aug 2019 13:30:59 -0600 Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Hiroki Sato , Jan Sucan Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46GlcJ4ZDHz4LnZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.42 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-4.25 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; RCVD_IN_DNSWL_NONE(0.00)[42.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.26)[ip: (-0.58), ipnet: 209.85.128.0/17(-3.35), asn: 15169(-2.33), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 19:31:13 -0000 On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: > > Hi, > > Alan Somers wrote > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > > as> Author: asomers > as> Date: Fri Aug 23 15:22:20 2019 > as> New Revision: 351423 > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > as> > as> Log: > as> ping6: Rename options for better consistency with ping > as> > as> Now equivalent options have the same flags, and nonequivalent optio= ns have > as> different flags. This is a prelude to merging the two commands. > as> > as> Submitted by: J=C3=A1n Su=C4=8Dan > as> MFC: Never > as> Sponsored by: Google LLC (Google Summer of Code 2019) > as> Differential Revision: https://reviews.freebsd.org/D21345 > > I have an objection on renaming the existing option flags in ping6(8) > for compatibility with ping(8). > > Is it sufficient to add INET6 support to ping(8) with consistent > flags and keep CLI of ping6(8) backward compatible? People have used > ping6(8) for >15 years, so it is too late to rename the flags. I do > not think the renaming is useful if "ping -6 localhost" or "ping ::1" > works. > > -- Hiroki If ping works with inet6, then why would we want to keep a separate tool around? If it's just for the sake of people who don't want to or can't update scripts, would a version in ports suffice? -Alan From owner-svn-src-head@freebsd.org Sun Aug 25 19:39:35 2019 Return-Path: Delivered-To: svn-src-head@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 B21DBE7ED9; Sun, 25 Aug 2019 19:39:35 +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 46Glnz4FT5z4ML2; Sun, 25 Aug 2019 19:39:35 +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 73AC3225BA; Sun, 25 Aug 2019 19:39:35 +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 x7PJdZ5m034362; Sun, 25 Aug 2019 19:39:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PJdVq7034344; Sun, 25 Aug 2019 19:39:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908251939.x7PJdVq7034344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 25 Aug 2019 19:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351485 - in head/sys: arm/conf conf powerpc/conf powerpc/conf/dpaa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/conf conf powerpc/conf powerpc/conf/dpaa X-SVN-Commit-Revision: 351485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 19:39:35 -0000 Author: imp Date: Sun Aug 25 19:39:31 2019 New Revision: 351485 URL: https://svnweb.freebsd.org/changeset/base/351485 Log: Fix bogusly declared WERRORs in kernel build Many arm kernel configs bogusly specified WERROR=-Werror. There's no reason for this because the default is that and there's no reason to override. These date from a time when we needed to add additional warning->error suppression. They are obsolete and were cut and paste propagated from file to file. Comment out all the WERROR=.... lines in powerpc. They aren't bogus, but were appropriate for the old defaults for gcc4.2.1. Now that we've made the policy decision to suppress -Werror by default on these platforms, it is appropriate to comment these out. People wishing to fix these errors can still un-comment them out, or say WERROR=-Werror on the command line. Fix two instances (cut and paste propagation) of hard-coded -Werror in x86 code. Replace with ${WERROR} instead. This is a no-op change except for people who build WERROR=-Wno-error :). This should fix tinderbox / CI breakage. Modified: head/sys/arm/conf/ALPINE head/sys/arm/conf/ARMADA38X head/sys/arm/conf/ARMADAXP head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/RT1310 head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SOCFPGA head/sys/arm/conf/TS7800 head/sys/arm/conf/VYBRID head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/powerpc/conf/QORIQ64 head/sys/powerpc/conf/dpaa/DPAA Modified: head/sys/arm/conf/ALPINE ============================================================================== --- head/sys/arm/conf/ALPINE Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/ALPINE Sun Aug 25 19:39:31 2019 (r351485) @@ -23,7 +23,6 @@ include "std.armv7" include "../annapurna/alpine/std.alpine" makeoptions MODULES_OVERRIDE="" -makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options SMP # Enable multiple cores Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/ARMADA38X Sun Aug 25 19:39:31 2019 (r351485) @@ -11,7 +11,6 @@ ident ARMADA38X options SOC_MV_ARMADA38X -makeoptions WERROR="-Werror" makeoptions MODULES_EXTRA="dtb/mv" #options MD_ROOT Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/ARMADAXP Sun Aug 25 19:39:31 2019 (r351485) @@ -27,8 +27,6 @@ include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP -makeoptions WERROR="-Werror" - options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/DB-78XXX Sun Aug 25 19:39:31 2019 (r351485) @@ -10,8 +10,6 @@ include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/DB-88F5XXX Sun Aug 25 19:39:31 2019 (r351485) @@ -10,8 +10,6 @@ include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/DB-88F6XXX Sun Aug 25 19:39:31 2019 (r351485) @@ -10,8 +10,6 @@ include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/conf/RT1310 ============================================================================== --- head/sys/arm/conf/RT1310 Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/RT1310 Sun Aug 25 19:39:31 2019 (r351485) @@ -16,7 +16,6 @@ makeoptions FDT_DTS_FILE=wzr2-g300n.dts makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/SHEEVAPLUG Sun Aug 25 19:39:31 2019 (r351485) @@ -11,8 +11,6 @@ include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions WERROR="-Werror" - options HZ=1000 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking Modified: head/sys/arm/conf/SOCFPGA ============================================================================== --- head/sys/arm/conf/SOCFPGA Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/SOCFPGA Sun Aug 25 19:39:31 2019 (r351485) @@ -24,8 +24,6 @@ include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" -makeoptions WERROR="-Werror" - options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC options SMP # Enable multiple cores Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/TS7800 Sun Aug 25 19:39:31 2019 (r351485) @@ -10,8 +10,6 @@ include "../mv/orion/std.ts7800" options SOC_MV_ORION -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/arm/conf/VYBRID Sun Aug 25 19:39:31 2019 (r351485) @@ -22,8 +22,6 @@ ident VYBRID include "std.armv7" include "../freescale/vybrid/std.vybrid" -makeoptions WERROR="-Werror" - options SCHED_4BSD # 4BSD scheduler options PLATFORM # Platform based SoC #options SMP # Enable multiple cores Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/conf/files.amd64 Sun Aug 25 19:39:31 2019 (r351485) @@ -50,7 +50,7 @@ linux32_assym.h optional compat_linux32 \ # linux32_locore.o optional compat_linux32 \ dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.asm" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux32_locore.o" # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/conf/files.i386 Sun Aug 25 19:39:31 2019 (r351485) @@ -37,7 +37,7 @@ linux_assym.h optional compat_linux \ # linux_locore.o optional compat_linux \ dependency "linux_assym.h $S/i386/linux/linux_locore.asm" \ - compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "linux_locore.o" # Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/powerpc/conf/MPC85XX Sun Aug 25 19:39:31 2019 (r351485) @@ -13,7 +13,6 @@ machine powerpc powerpc include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/powerpc/conf/MPC85XXSPE Sun Aug 25 19:39:31 2019 (r351485) @@ -13,7 +13,6 @@ machine powerpc powerpcspe include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU options MAXCPU=2 Modified: head/sys/powerpc/conf/QORIQ64 ============================================================================== --- head/sys/powerpc/conf/QORIQ64 Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/powerpc/conf/QORIQ64 Sun Aug 25 19:39:31 2019 (r351485) @@ -14,7 +14,7 @@ machine powerpc powerpc64 include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" +#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" options FPU_EMU Modified: head/sys/powerpc/conf/dpaa/DPAA ============================================================================== --- head/sys/powerpc/conf/dpaa/DPAA Sun Aug 25 19:27:14 2019 (r351484) +++ head/sys/powerpc/conf/dpaa/DPAA Sun Aug 25 19:39:31 2019 (r351485) @@ -12,7 +12,7 @@ cpu BOOKE_E500 machine powerpc powerpc #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" +#makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" makeoptions NO_MODULES=yes # Platform support From owner-svn-src-head@freebsd.org Sun Aug 25 20:01:56 2019 Return-Path: Delivered-To: svn-src-head@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 E48BEC07A9 for ; Sun, 25 Aug 2019 20:01:56 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (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 46GmHl67Fsz4NN8 for ; Sun, 25 Aug 2019 20:01:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb30.google.com with SMTP id m9so6297248ybm.3 for ; Sun, 25 Aug 2019 13:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=A/ZIZFDxyzPdJcLLyafdizM9dLw89m377HhbdlpOOr8=; b=Lp+j77NFZacX7gYgqc7kv+3zn47+VOco/OqTH3Drq37sAzuM0U4Y+U4LlHJ+czaLxt 3CpM8bEnf/vDmvyoDqvqGRN+gDa+Ul1Ma9r4vGaL1Xmb5jfJIjrOwUJim4zvZeOUbuM+ Cyho5QYh4dT+vfWLHTZfLC2NVRyiQThUrBi1Avh18YgzEwIzDSKrpba6B72QWW5m3c6I 01U0Hp0McD38GHec9zjFd+Y+/IUyioMuuPfPNorC4HTxzXLfIx/ThPSHGJtQHORzHmPZ iI7gi+Ilrxe9APbt5EkckmIoRJu/1zFbrI9RlOi98T+u5ARqZBzps1eU2VCctS7HZ2Vu /xHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A/ZIZFDxyzPdJcLLyafdizM9dLw89m377HhbdlpOOr8=; b=RPGT4UXdT9kGxRYEog3sHyI8NVofYTqGVzOTS67rwZWVRFfD2yXOVWjaMIaAAa2te5 NFC3mwk29TupPns9PcuZjqzhKo1CtpZEtZWqKw21olaQ2QwJqYJVY94Mrphk0UCWfuM6 TxJTxTODBi3PRKqJ6k3MfD7lYlxyuHfeZMovWQt9xv6ulNFQLS/wqkXBq96CvSHgUWNG 1Wywt+x9x2xnVN7vl0F88yY6H0TM+tFSVkqOlebZWF+2zthuovgDXffY0TEd3x0VVzL0 M9F5ADHmkiOvOTHbSD6aov/liZuXLe0GZmB723+mEdv7YqqU4VGYUhdUto5lnxxFhuM8 YQdQ== X-Gm-Message-State: APjAAAWQ36BaYkYxg9jBopLVfWJ44UP6n8lrJfPdOR+rpmURIGMBBRJR uufW7uJiwMvgpatFjp6IO1qqUah93K/si18gXS1axshZv6o= X-Google-Smtp-Source: APXvYqyBGWeOjr5PXHrCzW6oM+5lRidp/zxihx+K39CJP3TCVv6+fHZv1lIMssGFGvlX6ysgvki2i/cJM5EKk/G8M/4= X-Received: by 2002:a25:42cb:: with SMTP id p194mr9987704yba.334.1566763314795; Sun, 25 Aug 2019 13:01:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1003:0:0:0:0:0 with HTTP; Sun, 25 Aug 2019 13:01:54 -0700 (PDT) In-Reply-To: <201908250511.x7P5BiPl016074@repo.freebsd.org> References: <201908250511.x7P5BiPl016074@repo.freebsd.org> From: Oliver Pinter Date: Sun, 25 Aug 2019 22:01:54 +0200 Message-ID: Subject: Re: svn commit: r351471 - in head/sys: kern sys To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 46GmHl67Fsz4NN8 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=Lp+j77NF; dmarc=none; spf=pass (mx1.freebsd.org: domain of oliver.pinter@hardenedbsd.org designates 2607:f8b0:4864:20::b30 as permitted sender) smtp.mailfrom=oliver.pinter@hardenedbsd.org X-Spamd-Result: default: False [-5.41 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; RCVD_IN_DNSWL_NONE(0.00)[0.3.b.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]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.92)[ip: (-9.35), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.33), 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" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:01:57 -0000 On Sunday, August 25, 2019, Mateusz Guzik wrote: > Author: mjg > Date: Sun Aug 25 05:11:43 2019 > New Revision: 351471 > URL: https://svnweb.freebsd.org/changeset/base/351471 > > Log: > vfs: add vholdnz (for already held vnodes) Why? (Yes, is can read the real reason in phabricator, but the phabricator didn't considered a persistent information in relation to commit message. Review helper tool just comes and goes as time goes forward, but commit messages survives the repo conversions to other VCS...) And once you have taken the time to write a correct description in phabricator, it would be really really nice and helpful if you would copy them into commit message. > > Reviewed by: kib (previous version) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D21358 > > Modified: > head/sys/kern/vfs_subr.c > head/sys/sys/vnode.h > > Modified: head/sys/kern/vfs_subr.c > ============================================================ > ================== > --- head/sys/kern/vfs_subr.c Sun Aug 25 04:56:33 2019 (r351470) > +++ head/sys/kern/vfs_subr.c Sun Aug 25 05:11:43 2019 (r351471) > @@ -3018,6 +3018,19 @@ _vhold(struct vnode *vp, bool locked) > VI_UNLOCK(vp); > } > > +void > +vholdnz(struct vnode *vp) > +{ > + > + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > +#ifdef INVARIANTS > + int old = atomic_fetchadd_int(&vp->v_holdcnt, 1); > + VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); > +#else > + atomic_add_int(&vp->v_holdcnt, 1); > +#endif > +} > + > /* > * Drop the hold count of the vnode. If this is the last reference to > * the vnode we place it on the free list unless it has been vgone'd > > Modified: head/sys/sys/vnode.h > ============================================================ > ================== > --- head/sys/sys/vnode.h Sun Aug 25 04:56:33 2019 (r351470) > +++ head/sys/sys/vnode.h Sun Aug 25 05:11:43 2019 (r351471) > @@ -657,6 +657,7 @@ void vgone(struct vnode *vp); > #define vhold(vp) _vhold((vp), 0) > #define vholdl(vp) _vhold((vp), 1) > void _vhold(struct vnode *, bool); > +void vholdnz(struct vnode *); > void vinactive(struct vnode *, struct thread *); > int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); > int vtruncbuf(struct vnode *vp, off_t length, int blksize); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sun Aug 25 20:08:49 2019 Return-Path: Delivered-To: svn-src-head@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 1DF9EC091E; Sun, 25 Aug 2019 20:08:49 +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 46GmRh73zwz4Ng7; Sun, 25 Aug 2019 20:08:48 +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 CFBAA22B20; Sun, 25 Aug 2019 20:08:48 +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 x7PK8mUx052262; Sun, 25 Aug 2019 20:08:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PK8mPt052261; Sun, 25 Aug 2019 20:08:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908252008.x7PK8mPt052261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 25 Aug 2019 20:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351486 - 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: 351486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:08:49 -0000 Author: jhibbits Date: Sun Aug 25 20:08:48 2019 New Revision: 351486 URL: https://svnweb.freebsd.org/changeset/base/351486 Log: powerpc/booke: Use the DMAP if possible in pmap_map() This avoids unnecessary TLB usage for statically mapped regions, such as vm_page_array. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Aug 25 19:39:31 2019 (r351485) +++ head/sys/powerpc/booke/pmap.c Sun Aug 25 20:08:48 2019 (r351486) @@ -2546,8 +2546,11 @@ mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t vm_offset_t sva = *virt; vm_offset_t va = sva; - //debugf("mmu_booke_map: s (sva = 0x%08x pa_start = 0x%08x pa_end = 0x%08x)\n", - // sva, pa_start, pa_end); +#ifdef __powerpc64__ + /* XXX: Handle memory not starting at 0x0. */ + if (pa_end < ctob(Maxmem)) + return (PHYS_TO_DMAP(pa_start)); +#endif while (pa_start < pa_end) { mmu_booke_kenter(mmu, va, pa_start); @@ -2556,7 +2559,6 @@ mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t } *virt = va; - //debugf("mmu_booke_map: e (va = 0x%08x)\n", va); return (sva); } From owner-svn-src-head@freebsd.org Sun Aug 25 20:11:18 2019 Return-Path: Delivered-To: svn-src-head@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 983D5C0B4A; Sun, 25 Aug 2019 20:11:18 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46GmVX6MqHz4NxX; Sun, 25 Aug 2019 20:11:16 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x7PKAojq095081 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Mon, 26 Aug 2019 05:11:01 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1566763870; bh=+acWF/4g1KU26RlnooamDtN8IbTBbDMTABy/2fZEQgw=; h=Date:To:Cc:From:In-Reply-To:References; b=H6BQU4olFW0wpRZBDWBU64Rn0/Dq9wlBxzE/ukgS4oRgi+SQrtMhBG7n4WNoNuecI oRBCFqMSfE4oHsp1oIBQ5V6poGpXSaqEWGCU0NV14XdkfR6teZFUN5qwodCy3W0D49 rk5oT3c+KOgrZZQZpTeEflgZkF0QHcuvTAHWbqa4= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x7PKAi5K069014 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 26 Aug 2019 05:10:45 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x7PKAhWk069011; Mon, 26 Aug 2019 05:10:44 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Mon, 26 Aug 2019 05:09:22 +0900 (JST) Message-Id: <20190826.050922.1810654532466043358.hrs@allbsd.org> To: asomers@freebsd.org Cc: sucanjan@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests From: Hiroki Sato In-Reply-To: References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug_26_05_09_22_2019_925)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 26 Aug 2019 05:11:10 +0900 (JST) X-Rspamd-Queue-Id: 46GmVX6MqHz4NxX X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=allbsd.org header.s=20190220 header.b=H6BQU4ol; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrs@allbsd.org designates 2001:2f0:104:e001::41 as permitted sender) smtp.mailfrom=hrs@allbsd.org X-Spamd-Result: default: False [-6.12 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[allbsd.org:s=20190220]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[allbsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[allbsd.org:+]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; MID_CONTAINS_FROM(1.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7514, ipnet:2001:2f0::/32, country:JP]; FREEMAIL_CC(0.00)[gmail.com]; IP_SCORE(-2.06)[ip: (-9.71), ipnet: 2001:2f0::/32(-4.06), asn: 7514(3.48), country: JP(-0.03)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:11:18 -0000 ----Security_Multipart(Mon_Aug_26_05_09_22_2019_925)-- Content-Type: Text/Plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Alan Somers wrote in : as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote:= as> > as> > Hi, as> > as> > Alan Somers wrote as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: as> > as> > as> Author: asomers as> > as> Date: Fri Aug 23 15:22:20 2019 as> > as> New Revision: 351423 as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 as> > as> as> > as> Log: as> > as> ping6: Rename options for better consistency with ping as> > as> as> > as> Now equivalent options have the same flags, and nonequivale= nt options have as> > as> different flags. This is a prelude to merging the two comm= ands. as> > as> as> > as> Submitted by: J=E1n Su=E8an as> > as> MFC: Never as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) as> > as> Differential Revision: https://reviews.freebsd.org/D2134= 5 as> > as> > I have an objection on renaming the existing option flags in pin= g6(8) as> > for compatibility with ping(8). as> > as> > Is it sufficient to add INET6 support to ping(8) with consistent= as> > flags and keep CLI of ping6(8) backward compatible? People have= used as> > ping6(8) for >15 years, so it is too late to rename the flags. = I do as> > not think the renaming is useful if "ping -6 localhost" or "ping= ::1" as> > works. as> > as> > -- Hiroki as> = as> If ping works with inet6, then why would we want to keep a separate= as> tool around? If it's just for the sake of people who don't want to= or as> can't update scripts, would a version in ports suffice? Because removing (or renaming) it causes a POLA violation. Do we really have a strong, unavoidable reason to force people to rewrite their script now? This is still a fairly essential and actively used tool, not like rcp or rlogin. Although deprecating ping6(8) and removing it from the base system in the future release at some point may work, changing the existing interface will simply confuse people who have used IPv6 for a long time. In my understanding, the purpose to integrate ping(8) and ping6(8) into a single utility is to provide a consistent CLI and reduce duplicate code, not to break compatibility. -- Hiroki ----Security_Multipart(Mon_Aug_26_05_09_22_2019_925)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAl1i6vIACgkQTyzT2CeTzy2ClwCfTYqnZFiqnhupVBSSMWJgwBhC IX0An1MVdAFw/iYenhcKqjXJ97XO9tfY =+FC4 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug_26_05_09_22_2019_925)---- From owner-svn-src-head@freebsd.org Sun Aug 25 20:11:36 2019 Return-Path: Delivered-To: svn-src-head@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 3A289C0BC1; Sun, 25 Aug 2019 20:11:36 +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 46GmVw0ZmXz4P5k; Sun, 25 Aug 2019 20:11:36 +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 E9DAE22C98; Sun, 25 Aug 2019 20:11:35 +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 x7PKBZFn056862; Sun, 25 Aug 2019 20:11:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PKBZXh056861; Sun, 25 Aug 2019 20:11:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908252011.x7PKBZXh056861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 25 Aug 2019 20:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351487 - 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: 351487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:11:36 -0000 Author: jhibbits Date: Sun Aug 25 20:11:35 2019 New Revision: 351487 URL: https://svnweb.freebsd.org/changeset/base/351487 Log: powerpc/booke: Clean up pmap a little for 64-bit 64-bit Book-E pmap doesn't need copy and zero bounce pages, nor the mutex. Don't initialize them or reserve space for them. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Aug 25 20:08:48 2019 (r351486) +++ head/sys/powerpc/booke/pmap.c Sun Aug 25 20:11:35 2019 (r351487) @@ -161,17 +161,19 @@ static int availmem_regions_sz; static struct mem_region *physmem_regions; static int physmem_regions_sz; +#ifndef __powerpc64__ /* Reserved KVA space and mutex for mmu_booke_zero_page. */ static vm_offset_t zero_page_va; static struct mtx zero_page_mutex; -static struct mtx tlbivax_mutex; - /* Reserved KVA space and mutex for mmu_booke_copy_page. */ static vm_offset_t copy_page_src_va; static vm_offset_t copy_page_dst_va; static struct mtx copy_page_mutex; +#endif +static struct mtx tlbivax_mutex; + /**************************************************************************/ /* PMAP */ /**************************************************************************/ @@ -1646,6 +1648,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o virtual_avail = round_page(data_end); virtual_end = VM_MAX_KERNEL_ADDRESS; +#ifndef __powerpc64__ /* Allocate KVA space for page zero/copy operations. */ zero_page_va = virtual_avail; virtual_avail += PAGE_SIZE; @@ -1661,7 +1664,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o mtx_init(&zero_page_mutex, "mmu_booke_zero_page", NULL, MTX_DEF); mtx_init(©_page_mutex, "mmu_booke_copy_page", NULL, MTX_DEF); -#ifndef __powerpc64__ /* Allocate KVA space for ptbl bufs. */ ptbl_buf_pool_vabase = virtual_avail; virtual_avail += PTBL_BUFS * PTBL_PAGES * PAGE_SIZE; @@ -1820,12 +1822,10 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o /* Initialize (statically allocated) kernel pmap. */ /*******************************************************/ PMAP_LOCK_INIT(kernel_pmap); -#ifndef __powerpc64__ - kptbl_min = VM_MIN_KERNEL_ADDRESS / PDIR_SIZE; -#endif #ifdef __powerpc64__ kernel_pmap->pm_pp2d = (pte_t ***)kernel_ptbl_root; #else + kptbl_min = VM_MIN_KERNEL_ADDRESS / PDIR_SIZE; kernel_pmap->pm_pdir = (pte_t **)kernel_ptbl_root; #endif From owner-svn-src-head@freebsd.org Sun Aug 25 20:16:04 2019 Return-Path: Delivered-To: svn-src-head@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 22847C0D25; Sun, 25 Aug 2019 20:16:04 +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 46Gmc406bpz4PKd; Sun, 25 Aug 2019 20:16:04 +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 EEFFF22D01; Sun, 25 Aug 2019 20:16:03 +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 x7PKG30j058039; Sun, 25 Aug 2019 20:16:03 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PKG3OL058038; Sun, 25 Aug 2019 20:16:03 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201908252016.x7PKG3OL058038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 25 Aug 2019 20:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351488 - in head/sys: conf dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: conf dev/netmap X-SVN-Commit-Revision: 351488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:16:04 -0000 Author: vmaffione Date: Sun Aug 25 20:16:03 2019 New Revision: 351488 URL: https://svnweb.freebsd.org/changeset/base/351488 Log: netmap: remove obsolete file The netmap_pt.c module has become obsolete after the refactoring that added netmap_kloop.c. Remove it and unlink it from the build system. MFC after: 1 week Deleted: head/sys/dev/netmap/netmap_pt.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Aug 25 20:11:35 2019 (r351487) +++ head/sys/conf/files Sun Aug 25 20:16:03 2019 (r351488) @@ -2470,7 +2470,6 @@ dev/netmap/netmap_monitor.c optional netmap dev/netmap/netmap_null.c optional netmap dev/netmap/netmap_offloadings.c optional netmap dev/netmap/netmap_pipe.c optional netmap -dev/netmap/netmap_pt.c optional netmap dev/netmap/netmap_vale.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nfsmb/nfsmb.c optional nfsmb pci From owner-svn-src-head@freebsd.org Sun Aug 25 20:26:44 2019 Return-Path: Delivered-To: svn-src-head@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 73D63C1257; Sun, 25 Aug 2019 20:26:44 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (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 46GmrM12krz4Pth; Sun, 25 Aug 2019 20:26:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-x232.google.com with SMTP id x3so13212736lji.5; Sun, 25 Aug 2019 13:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3yy8EnM/zZwuj7tJGSTuZ+IsF8YcWsrwqUNdoux67sc=; b=lxZU+rROylddv7U/7qKhw8S7cckgKPSVdC85g6r73PIi+Hg4lWxkrSz265TbPiJJFL oll5CScYPzC4tKYsohpDO36mPKvj2iWMgwRbdl0Fzr3MygAaxi3+D5DNJg5CbjvxqUAM ZOf+SWKdUHL1If8uEOlzza35oR0ZSMQ5wG4c/YoRdll1tN1KpGsweLDDznOMirtHcLci qriNWzh07qNVVvstUBjzEV3Rj8qlcCgXLqOzABKbwG/bOh2pPQ9/MEZ/4m135PNKqg1D v15jPopY3cCSJGBRnPAbsioiXkFNjF0/IUmLqew0oa1P1GsC/ravyUPW4VRVyjbr3hTh Pecg== 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=3yy8EnM/zZwuj7tJGSTuZ+IsF8YcWsrwqUNdoux67sc=; b=ERxSv05h6gl3T0IJkwY+UhJYAm+jvRM0Jzstc3FsYui/8KirBozb7bxd4LlGuUQk1N d5I1TGpgk3u+lWYKtbBeistIooCMw49Sgb6zhqLW0wvw14YKI7sPwFIs8EDwgJDMWeLd XegE5Oxaq8+WNkPX8kGD9RX/uNYnSJbZn1yewDRa/6lsYtlwHGn5WI4Yqpq/5FN6IYZM 1AIlSFSgV1nXmTAtBjfsflK50NVsZkI9uLHt+Tp8WagxRiy2hR3SaFJJ8JdcPcPLXdFJ 35c4vqlDb2Pe4KxjNYUfC9LL5hxxtrDSFZg4d4uoqzbk8yFXk6arhxSnSOKqc34CiulC c7VQ== X-Gm-Message-State: APjAAAWYUMMRZPa6ULJtTzoj2g93Rchf6Az3FCFY7iF2PxoZxU+FJAD3 nkg+7qx64W/smyvruLLAu8K+MBK7z1nOjj9jUio= X-Google-Smtp-Source: APXvYqxDE3/edXt0jWjj1QUOFE09RZtQl9I8om2NvmfT2F6XG4uUv3uW7A4J5PlMwJeIlWeXGSCftZ6nZR7m0s8jB9M= X-Received: by 2002:a2e:864c:: with SMTP id i12mr8472014ljj.88.1566764800932; Sun, 25 Aug 2019 13:26:40 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> In-Reply-To: <20190826.050922.1810654532466043358.hrs@allbsd.org> From: alan somers Date: Sun, 25 Aug 2019 14:26:28 -0600 Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Hiroki Sato Cc: Alan Somers , Jan Sucan , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46GmrM12krz4Pth X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lxZU+rRO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 2a00:1450:4864:20::232 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-8.98), ipnet: 2a00:1450::/32(-3.00), asn: 15169(-2.33), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.3.2.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]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:26:44 -0000 On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > Alan Somers wrote > in : > > as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: > as> > > as> > Hi, > as> > > as> > Alan Somers wrote > as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > as> > > as> > as> Author: asomers > as> > as> Date: Fri Aug 23 15:22:20 2019 > as> > as> New Revision: 351423 > as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > as> > as> > as> > as> Log: > as> > as> ping6: Rename options for better consistency with ping > as> > as> > as> > as> Now equivalent options have the same flags, and nonequivalent > options have > as> > as> different flags. This is a prelude to merging the two > commands. > as> > as> > as> > as> Submitted by: J=C3=A1n Su=C4=8Dan > as> > as> MFC: Never > as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) > as> > as> Differential Revision: https://reviews.freebsd.org/D21345 > as> > > as> > I have an objection on renaming the existing option flags in > ping6(8) > as> > for compatibility with ping(8). > as> > > as> > Is it sufficient to add INET6 support to ping(8) with consistent > as> > flags and keep CLI of ping6(8) backward compatible? People have > used > as> > ping6(8) for >15 years, so it is too late to rename the flags. I = do > as> > not think the renaming is useful if "ping -6 localhost" or "ping > ::1" > as> > works. > as> > > as> > -- Hiroki > as> > as> If ping works with inet6, then why would we want to keep a separate > as> tool around? If it's just for the sake of people who don't want to o= r > as> can't update scripts, would a version in ports suffice? > > Because removing (or renaming) it causes a POLA violation. Do we > really have a strong, unavoidable reason to force people to rewrite > their script now? This is still a fairly essential and actively used > tool, not like rcp or rlogin. Although deprecating ping6(8) and > removing it from the base system in the future release at some point > may work, changing the existing interface will simply confuse people > who have used IPv6 for a long time. > > In my understanding, the purpose to integrate ping(8) and ping6(8) > into a single utility is to provide a consistent CLI and reduce > duplicate code, not to break compatibility. > > -- Hiroki > Those goals are incompatible. We can't provide a consistent CLI without breaking compatibility because ping and ping6 have conflicting options. And we can't keep ping6 around while also removing duplicate code because that would be, well, duplicate code. When would be a better time than a major version bump to make a change like this? The lack of a ping6 command in freebsd 13 should serve as a pretty obvious reminder that scripts will need updating. I think that putting a version of ping6 in ports should be a sufficient crutch for those who need it, don't you? > From owner-svn-src-head@freebsd.org Sun Aug 25 20:57:39 2019 Return-Path: Delivered-To: svn-src-head@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 D778EC39C9; Sun, 25 Aug 2019 20:57:39 +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 46GnX35LwPz4SY2; Sun, 25 Aug 2019 20:57:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9576C23454; Sun, 25 Aug 2019 20:57:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PKvdmE082417; Sun, 25 Aug 2019 20:57:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PKvdtU082416; Sun, 25 Aug 2019 20:57:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908252057.x7PKvdtU082416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Aug 2019 20:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351494 - 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: 351494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 20:57:39 -0000 Author: kib Date: Sun Aug 25 20:57:39 2019 New Revision: 351494 URL: https://svnweb.freebsd.org/changeset/base/351494 Log: amd64: If domain-local page for pcpu cannot be allocated, keep use existing one. Allocation failure is possible for instance when cpu domain has no memory. Reported and tested by: bcran Reviewed by: markj Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Aug 25 20:36:52 2019 (r351493) +++ head/sys/amd64/amd64/mp_machdep.c Sun Aug 25 20:57:39 2019 (r351494) @@ -402,6 +402,8 @@ mp_realloc_pcpu(int cpuid, int domain) return; m = vm_page_alloc_domain(NULL, 0, domain, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ); + if (m == NULL) + return; na = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); pagecopy((void *)oa, (void *)na); pmap_qenter((vm_offset_t)&__pcpu[cpuid], &m, 1); From owner-svn-src-head@freebsd.org Sun Aug 25 21:01:41 2019 Return-Path: Delivered-To: svn-src-head@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 12FDDC4571; Sun, 25 Aug 2019 21:01:41 +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 46Gnch6mZhz4TsT; Sun, 25 Aug 2019 21:01:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9B7A236FF; Sun, 25 Aug 2019 21:01:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PL1edH087637; Sun, 25 Aug 2019 21:01:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PL1eu1087636; Sun, 25 Aug 2019 21:01:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908252101.x7PL1eu1087636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Aug 2019 21:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351495 - 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: 351495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 21:01:41 -0000 Author: kib Date: Sun Aug 25 21:01:40 2019 New Revision: 351495 URL: https://svnweb.freebsd.org/changeset/base/351495 Log: amd64: loose constraints on the APs dpcpu and nmi/dbg stack allocations. Use DOMAINSET_PREF() instead of DOMAINSET_FIXED(), to gracefully fallback in case of memory-less domain. Reported and tested by: bcran Reviewed by: markj Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Aug 25 20:57:39 2019 (r351494) +++ head/sys/amd64/amd64/mp_machdep.c Sun Aug 25 21:01:40 2019 (r351495) @@ -483,10 +483,10 @@ native_start_all_aps(void) M_ZERO); mce_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc_domainset( - DOMAINSET_FIXED(domain), PAGE_SIZE, M_WAITOK | M_ZERO); + DOMAINSET_PREF(domain), PAGE_SIZE, M_WAITOK | M_ZERO); dbg_stack = (char *)kmem_malloc_domainset( - DOMAINSET_FIXED(domain), PAGE_SIZE, M_WAITOK | M_ZERO); - dpcpu = (void *)kmem_malloc_domainset(DOMAINSET_FIXED(domain), + DOMAINSET_PREF(domain), PAGE_SIZE, M_WAITOK | M_ZERO); + dpcpu = (void *)kmem_malloc_domainset(DOMAINSET_PREF(domain), DPCPU_SIZE, M_WAITOK | M_ZERO); bootSTK = (char *)bootstacks[cpu] + From owner-svn-src-head@freebsd.org Sun Aug 25 21:14:47 2019 Return-Path: Delivered-To: svn-src-head@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 C3916C5360; Sun, 25 Aug 2019 21:14:47 +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 46Gnvq4mrVz4VX1; Sun, 25 Aug 2019 21:14:47 +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 852252390D; Sun, 25 Aug 2019 21:14:47 +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 x7PLElMM094386; Sun, 25 Aug 2019 21:14:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PLEkfV094383; Sun, 25 Aug 2019 21:14:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908252114.x7PLEkfV094383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Aug 2019 21:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351496 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 351496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 21:14:47 -0000 Author: markj Date: Sun Aug 25 21:14:46 2019 New Revision: 351496 URL: https://svnweb.freebsd.org/changeset/base/351496 Log: Handle UMA_ANYDOMAIN in kstack_import(). The kernel thread stack zone performs first-touch allocations by default, and must handle the case where the local memory domain is empty. For most UMA zones this is handled in the keg layer, but cache zones currently must implement a policy for this case. Simply use a round-robin policy if UMA_ANYDOMAIN is passed. Reported and tested by: bcran Reviewed by: kib Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/vm_glue.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Aug 25 21:01:40 2019 (r351495) +++ head/sys/vm/uma.h Sun Aug 25 21:14:46 2019 (r351496) @@ -294,6 +294,8 @@ uma_zone_t uma_zcache_create(char *name, int size, uma #define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ #define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ +#define UMA_ANYDOMAIN -1 /* Special value for domain search. */ + /* * Destroys an empty uma zone. If the zone is not empty uma complains loudly. * Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Aug 25 21:01:40 2019 (r351495) +++ head/sys/vm/uma_core.c Sun Aug 25 21:14:46 2019 (r351496) @@ -234,8 +234,6 @@ enum zfreeskip { SKIP_FINI = 0x00020000, }; -#define UMA_ANYDOMAIN -1 /* Special value for domain search. */ - /* Prototypes.. */ int uma_startup_count(int); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Aug 25 21:01:40 2019 (r351495) +++ head/sys/vm/vm_glue.c Sun Aug 25 21:14:46 2019 (r351496) @@ -454,12 +454,18 @@ vm_thread_dispose(struct thread *td) static int kstack_import(void *arg, void **store, int cnt, int domain, int flags) { + struct domainset *ds; vm_object_t ksobj; int i; + if (domain == UMA_ANYDOMAIN) + ds = DOMAINSET_RR(); + else + ds = DOMAINSET_PREF(domain); + for (i = 0; i < cnt; i++) { - store[i] = (void *)vm_thread_stack_create( - DOMAINSET_PREF(domain), &ksobj, kstack_pages); + store[i] = (void *)vm_thread_stack_create(ds, &ksobj, + kstack_pages); if (store[i] == NULL) break; } From owner-svn-src-head@freebsd.org Sun Aug 25 22:06:18 2019 Return-Path: Delivered-To: svn-src-head@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 4530AC6BB0; Sun, 25 Aug 2019 22:06:18 +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 46Gq3G15s8z4Xv8; Sun, 25 Aug 2019 22:06:18 +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 039A224227; Sun, 25 Aug 2019 22:06:18 +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 x7PM6HOW024111; Sun, 25 Aug 2019 22:06:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PM6HBn024110; Sun, 25 Aug 2019 22:06:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908252206.x7PM6HBn024110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 25 Aug 2019 22:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351497 - in head/sys/modules: linux linux64 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/modules: linux linux64 X-SVN-Commit-Revision: 351497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 22:06:18 -0000 Author: imp Date: Sun Aug 25 22:06:17 2019 New Revision: 351497 URL: https://svnweb.freebsd.org/changeset/base/351497 Log: Replace -Werror with ${WERROR} in module builds Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Sun Aug 25 21:14:46 2019 (r351496) +++ head/sys/modules/linux/Makefile Sun Aug 25 22:06:17 2019 (r351497) @@ -55,7 +55,7 @@ linux${SFX}_assym.h: linux${SFX}_genassym.o linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s \ - -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc -nostdlib \ + -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -nostdinc -nostdlib \ -fno-omit-frame-pointer -fPIC \ -Wl,-T${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Sun Aug 25 21:14:46 2019 (r351496) +++ head/sys/modules/linux64/Makefile Sun Aug 25 22:06:17 2019 (r351497) @@ -31,7 +31,7 @@ linux_assym.h: linux_genassym.o linux_locore.o: linux_locore.asm linux_assym.h ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \ - -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -fPIC -nostdinc \ + -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -fPIC -nostdinc \ -Wl,-T${SRCTOP}/sys/${MACHINE}/linux/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ ${.IMPSRC} -o ${.TARGET} From owner-svn-src-head@freebsd.org Sun Aug 25 22:06:27 2019 Return-Path: Delivered-To: svn-src-head@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 673B8C6BF8; Sun, 25 Aug 2019 22:06:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46Gq3R28R2z4Y29; Sun, 25 Aug 2019 22:06:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D1BB24228; Sun, 25 Aug 2019 22:06:27 +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 x7PM6RvR024165; Sun, 25 Aug 2019 22:06:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PM6Rab024164; Sun, 25 Aug 2019 22:06:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908252206.x7PM6Rab024164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 25 Aug 2019 22:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351498 - head/usr.sbin/pmcstudy X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/pmcstudy X-SVN-Commit-Revision: 351498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 22:06:27 -0000 Author: imp Date: Sun Aug 25 22:06:26 2019 New Revision: 351498 URL: https://svnweb.freebsd.org/changeset/base/351498 Log: Replace -Werror with ${WERROR} in pmcstudy Modified: head/usr.sbin/pmcstudy/Makefile Modified: head/usr.sbin/pmcstudy/Makefile ============================================================================== --- head/usr.sbin/pmcstudy/Makefile Sun Aug 25 22:06:17 2019 (r351497) +++ head/usr.sbin/pmcstudy/Makefile Sun Aug 25 22:06:26 2019 (r351498) @@ -4,7 +4,7 @@ PROG= pmcstudy MAN= pmcstudy.8 SRCS= pmcstudy.c eval_expr.c -CFLAGS+= -Wall -Werror +CFLAGS+= -Wall ${WERROR} BINDIR= /usr/bin From owner-svn-src-head@freebsd.org Sun Aug 25 22:30:19 2019 Return-Path: Delivered-To: svn-src-head@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 1F2BCC74A7; Sun, 25 Aug 2019 22:30:19 +0000 (UTC) (envelope-from mjg@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 46GqZz01Z0z4Z8P; Sun, 25 Aug 2019 22:30:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D302E245CD; Sun, 25 Aug 2019 22:30:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PMUIwC036138; Sun, 25 Aug 2019 22:30:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PMUIgd036137; Sun, 25 Aug 2019 22:30:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908252230.x7PMUIgd036137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 25 Aug 2019 22:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351499 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 351499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 22:30:19 -0000 Author: mjg Date: Sun Aug 25 22:30:18 2019 New Revision: 351499 URL: https://svnweb.freebsd.org/changeset/base/351499 Log: vfs: swap vop_unlock_post and vop_unlock_pre definitions to the logical order The change is no-op. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 25 22:06:26 2019 (r351498) +++ head/sys/sys/vnode.h Sun Aug 25 22:30:18 2019 (r351499) @@ -811,14 +811,14 @@ int vop_sigdefer(struct vop_vector *vop, struct vop_ge void vop_strategy_pre(void *a); void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); -void vop_unlock_post(void *a, int rc); void vop_unlock_pre(void *a); +void vop_unlock_post(void *a, int rc); #else #define vop_strategy_pre(x) do { } while (0) #define vop_lock_pre(x) do { } while (0) #define vop_lock_post(x, y) do { } while (0) -#define vop_unlock_post(x, y) do { } while (0) #define vop_unlock_pre(x) do { } while (0) +#define vop_unlock_post(x, y) do { } while (0) #endif void vop_rename_fail(struct vop_rename_args *ap); From owner-svn-src-head@freebsd.org Sun Aug 25 23:51:07 2019 Return-Path: Delivered-To: svn-src-head@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 E79B6C90D7; Sun, 25 Aug 2019 23:51:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (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 46GsNB6MnLz4d6L; Sun, 25 Aug 2019 23:51:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f66.google.com with SMTP id x4so32844371iog.13; Sun, 25 Aug 2019 16:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=IAhWOLebHxyIsnMYARiHbaA7Y1egdQStURsvuArycSE=; b=Pk1WBNnBNGldtSqQgpgzAigUHEnTQm1asHFHpa4KXzpWTXvUL9azszCeuJHz9x8JHW ydXtg1o0mGJT1MfRKU4deksq62TkBx4/EWHJJ9O7RptJ8tJL2Q06cH5irTX5VLJboIID JkFHt86fFw/7AgEy452SqhB/FN/0ukC2J0459LFhukrvua4+nEIWGXsotilTCTtJi2PV Uj98jMl5a35TMcuRAwxe3qtpj/hGuQO3eIreCAAoWaBose7WPI5c1wtxT2M0fzoVJUYX wW9Td1g7yZsbaV+aH5q5uflbTp+187MZJ6OSn1vlPUHpBcbIX0VE4QiihWOG3HofGegp 8SMg== X-Gm-Message-State: APjAAAUo7X9O35kD7xOMMZgZR/FOPmaNsS2NSOXTy31GNpzwc3boskfK TGsv07KxYVTCkJqLrShXMd6U8qGh X-Google-Smtp-Source: APXvYqwriJaOggPhvluTqwPCUBuLSPcdYnD7W/6JVO8odxeWgahj0A0bF6BGDSSq06aCuDvSszsOCg== X-Received: by 2002:a02:4881:: with SMTP id p123mr15626140jaa.69.1566777065395; Sun, 25 Aug 2019 16:51:05 -0700 (PDT) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com. [209.85.166.48]) by smtp.gmail.com with ESMTPSA id j18sm3113019ioo.14.2019.08.25.16.51.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Aug 2019 16:51:04 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id j4so24634291iog.11; Sun, 25 Aug 2019 16:51:04 -0700 (PDT) X-Received: by 2002:a02:6d24:: with SMTP id m36mr1746226jac.87.1566777064136; Sun, 25 Aug 2019 16:51:04 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 25 Aug 2019 16:50:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: alan somers Cc: Hiroki Sato , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46GsNB6MnLz4d6L X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.66 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.23 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.25)[ip: (-0.53), ipnet: 209.85.128.0/17(-3.35), asn: 15169(-2.33), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 23:51:08 -0000 Hi Alan, Hiroki, It would be pretty easy to install a `ping6` link to the `ping(8)` binary with different option parsing (conditional on argv[0]). That removes most of the issues of code and space duplication, I think? And the goal would be for the 'ping6' name to retain option compatibility with historical ping6. It's not an uncommon pattern; for example, 'id', 'groups', and 'whoami' are all a single binary with multiple linked names. Another example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', 'clang++' and 'cpp' links to the same inode =E2=80=94 and those have very different behavior depending on argv[0]. It's less work than forcing the ping6 compatibility crowd to create a port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable middle ground? Best, Conrad On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: > > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: >> >> Alan Somers wrote >> in : >> >> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: >> as> > >> as> > Hi, >> as> > >> as> > Alan Somers wrote >> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: >> as> > >> as> > as> Author: asomers >> as> > as> Date: Fri Aug 23 15:22:20 2019 >> as> > as> New Revision: 351423 >> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 >> as> > as> >> as> > as> Log: >> as> > as> ping6: Rename options for better consistency with ping >> as> > as> >> as> > as> Now equivalent options have the same flags, and nonequivalen= t options have >> as> > as> different flags. This is a prelude to merging the two comma= nds. >> as> > as> >> as> > as> Submitted by: J=C3=A1n Su=C4=8Dan >> as> > as> MFC: Never >> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) >> as> > as> Differential Revision: https://reviews.freebsd.org/D21345 >> as> > >> as> > I have an objection on renaming the existing option flags in ping= 6(8) >> as> > for compatibility with ping(8). >> as> > >> as> > Is it sufficient to add INET6 support to ping(8) with consistent >> as> > flags and keep CLI of ping6(8) backward compatible? People have = used >> as> > ping6(8) for >15 years, so it is too late to rename the flags. I= do >> as> > not think the renaming is useful if "ping -6 localhost" or "ping = ::1" >> as> > works. >> as> > >> as> > -- Hiroki >> as> >> as> If ping works with inet6, then why would we want to keep a separate >> as> tool around? If it's just for the sake of people who don't want to = or >> as> can't update scripts, would a version in ports suffice? >> >> Because removing (or renaming) it causes a POLA violation. Do we >> really have a strong, unavoidable reason to force people to rewrite >> their script now? This is still a fairly essential and actively used >> tool, not like rcp or rlogin. Although deprecating ping6(8) and >> removing it from the base system in the future release at some point >> may work, changing the existing interface will simply confuse people >> who have used IPv6 for a long time. >> >> In my understanding, the purpose to integrate ping(8) and ping6(8) >> into a single utility is to provide a consistent CLI and reduce >> duplicate code, not to break compatibility. >> >> -- Hiroki > > > Those goals are incompatible. We can't provide a consistent CLI without b= reaking compatibility because ping and ping6 have conflicting options. And= we can't keep ping6 around while also removing duplicate code because that= would be, well, duplicate code. > > When would be a better time than a major version bump to make a change li= ke this? > > The lack of a ping6 command in freebsd 13 should serve as a pretty obviou= s reminder that scripts will need updating. I think that putting a version= of ping6 in ports should be a sufficient crutch for those who need it, don= 't you? From owner-svn-src-head@freebsd.org Sun Aug 25 23:58:51 2019 Return-Path: Delivered-To: svn-src-head@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 1BC58C9677; Sun, 25 Aug 2019 23:58:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (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 46GsY66sJlz4ddf; Sun, 25 Aug 2019 23:58:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f196.google.com with SMTP id z17so13451414ljz.0; Sun, 25 Aug 2019 16:58:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6BmYDSqs/dXRXvkMWiM4xPxNtftCpzZ4ksrp9M3VeEw=; b=RUWA9AvOsKHztUYGP8K3Jj9xYuywI9aCh/R2xMlaQG//m1k/gP5zhpXpuknOtWTR3v pNkAAlLJ6OIV54oLfR5M9gdzW1ece9Qen5Ipup2uD8Srv91p9n23+u0r26t5vWeemyza wDUndcZTYH/ZlA4+VAy/y1q3QrgSy2aKQN+M8adCLuMM/qXHZFykMwltAVr6lbvL2jRh U9c0vNmHyHSHn0cn0MqZOsxLxopKbnb8UITL+LWVy3gWqAqRIWzb86on1qbvKFioStot znL3InLyPYOtbA+1aVlV+SQ6nEpTEKb6teF6stHalur7ahSpe0IieebELtHs0FuA4q8O 6jpQ== X-Gm-Message-State: APjAAAWPhrUwHgrnnpCO0I2m64IzcaBvKKzYPKVyb7bM79SvN0bf8i8I jj2hm4Gzn+ond+p7vIcYf0jvg/xZxbwN4YgEWFPi68Kt X-Google-Smtp-Source: APXvYqxoBVeT4Qf2ippp4EnCrmitH3ojYrKgXr5qNbp5S2F3wjNZBh41RIw6AkryAxTjHH9BkQmq5KN7L+764oLmbpQ= X-Received: by 2002:a2e:a0c3:: with SMTP id f3mr8998688ljm.123.1566777528702; Sun, 25 Aug 2019 16:58:48 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> In-Reply-To: From: Alan Somers Date: Sun, 25 Aug 2019 17:58:37 -0600 Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: "Conrad E. Meyer" , Jan Sucan Cc: Hiroki Sato , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46GsY66sJlz4ddf X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 23:58:51 -0000 Jan (please keep him CCed on replies) has been musing about the same thing. That might satisfy everyone. Jan, would it be straightforward to implement? -Alan On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: > > Hi Alan, Hiroki, > > It would be pretty easy to install a `ping6` link to the `ping(8)` > binary with different option parsing (conditional on argv[0]). That > removes most of the issues of code and space duplication, I think? > And the goal would be for the 'ping6' name to retain option > compatibility with historical ping6. > > It's not an uncommon pattern; for example, 'id', 'groups', and > 'whoami' are all a single binary with multiple linked names. Another > example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', > 'clang++' and 'cpp' links to the same inode =E2=80=94 and those have very > different behavior depending on argv[0]. > > It's less work than forcing the ping6 compatibility crowd to create a > port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable > middle ground? > > Best, > Conrad > > On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: > > > > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > >> > >> Alan Somers wrote > >> in : > >> > >> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote= : > >> as> > > >> as> > Hi, > >> as> > > >> as> > Alan Somers wrote > >> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > >> as> > > >> as> > as> Author: asomers > >> as> > as> Date: Fri Aug 23 15:22:20 2019 > >> as> > as> New Revision: 351423 > >> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > >> as> > as> > >> as> > as> Log: > >> as> > as> ping6: Rename options for better consistency with ping > >> as> > as> > >> as> > as> Now equivalent options have the same flags, and nonequival= ent options have > >> as> > as> different flags. This is a prelude to merging the two com= mands. > >> as> > as> > >> as> > as> Submitted by: J=C3=A1n Su=C4=8Dan > >> as> > as> MFC: Never > >> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) > >> as> > as> Differential Revision: https://reviews.freebsd.org/D213= 45 > >> as> > > >> as> > I have an objection on renaming the existing option flags in pi= ng6(8) > >> as> > for compatibility with ping(8). > >> as> > > >> as> > Is it sufficient to add INET6 support to ping(8) with consisten= t > >> as> > flags and keep CLI of ping6(8) backward compatible? People hav= e used > >> as> > ping6(8) for >15 years, so it is too late to rename the flags. = I do > >> as> > not think the renaming is useful if "ping -6 localhost" or "pin= g ::1" > >> as> > works. > >> as> > > >> as> > -- Hiroki > >> as> > >> as> If ping works with inet6, then why would we want to keep a separat= e > >> as> tool around? If it's just for the sake of people who don't want t= o or > >> as> can't update scripts, would a version in ports suffice? > >> > >> Because removing (or renaming) it causes a POLA violation. Do we > >> really have a strong, unavoidable reason to force people to rewrite > >> their script now? This is still a fairly essential and actively used > >> tool, not like rcp or rlogin. Although deprecating ping6(8) and > >> removing it from the base system in the future release at some point > >> may work, changing the existing interface will simply confuse people > >> who have used IPv6 for a long time. > >> > >> In my understanding, the purpose to integrate ping(8) and ping6(8) > >> into a single utility is to provide a consistent CLI and reduce > >> duplicate code, not to break compatibility. > >> > >> -- Hiroki > > > > > > Those goals are incompatible. We can't provide a consistent CLI without= breaking compatibility because ping and ping6 have conflicting options. A= nd we can't keep ping6 around while also removing duplicate code because th= at would be, well, duplicate code. > > > > When would be a better time than a major version bump to make a change = like this? > > > > The lack of a ping6 command in freebsd 13 should serve as a pretty obvi= ous reminder that scripts will need updating. I think that putting a versi= on of ping6 in ports should be a sufficient crutch for those who need it, d= on't you? From owner-svn-src-head@freebsd.org Mon Aug 26 00:19:02 2019 Return-Path: Delivered-To: svn-src-head@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 752D0C9DD6; Mon, 26 Aug 2019 00:19:02 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Gt0N04T5z4fQG; Mon, 26 Aug 2019 00:18:59 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x7Q0IYmc004217 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Mon, 26 Aug 2019 09:18:45 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1566778733; bh=RqAfa7pnwsCKHT2AkNxsFiyEWp7x6u8wxwJZduVoidQ=; h=Date:To:Cc:From:In-Reply-To:References; b=RauG2cR98GVR4v9i3Uvy3sncqmiUaZCrpqhrtQQvWXb+xhTF6qdxw+0coZh0s7mmM +qjtE/4MmxT9yH187Zz35F9oz66Q1HGa8Eog+aYyfs97JehswZcYpW3GVYzEFn6aor rGDkR8+NTyHO5VfriWV0vomHVq0PxMjK+6x2Iod8= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x7Q0ITDU071636 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 26 Aug 2019 09:18:29 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x7Q0IRIa071632; Mon, 26 Aug 2019 09:18:29 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Mon, 26 Aug 2019 09:18:17 +0900 (JST) Message-Id: <20190826.091817.1030128007560633472.hrs@allbsd.org> To: asomers@freebsd.org Cc: cem@freebsd.org, sucanjan@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests From: Hiroki Sato In-Reply-To: References: X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug_26_09_18_17_2019_471)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 26 Aug 2019 09:18:53 +0900 (JST) X-Rspamd-Queue-Id: 46Gt0N04T5z4fQG X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=allbsd.org header.s=20190220 header.b=RauG2cR9; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrs@allbsd.org designates 2001:2f0:104:e001::41 as permitted sender) smtp.mailfrom=hrs@allbsd.org X-Spamd-Result: default: False [-6.05 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[allbsd.org:s=20190220]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[allbsd.org]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[allbsd.org:+]; MIME_BASE64_TEXT(0.10)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7514, ipnet:2001:2f0::/32, country:JP]; IP_SCORE(-2.09)[ip: (-9.72), ipnet: 2001:2f0::/32(-4.13), asn: 7514(3.45), country: JP(-0.03)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 00:19:02 -0000 ----Security_Multipart(Mon_Aug_26_09_18_17_2019_471)-- Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: base64 SGkgQWxhbiBhbmQgQ29ucmFkLA0KDQogSSBhZ3JlZSB3aXRoIHRoZSBpZGVhIGhhdmluZyBwaW5n Nig4KSBhcyBhIGhhcmRsaW5rIHRvIHBpbmcoOCkgdG8NCiBwcm92aWRlIHRoZSBoaXN0b3JpY2Fs IHBpbmc2KDgpIGJlaGF2aW9yLg0KDQpBbGFuIFNvbWVycyA8YXNvbWVyc0BmcmVlYnNkLm9yZz4g d3JvdGUNCiAgaW4gPENBT3RNWDJoamFZcSs4X1MweVhlQUp1dEYyZ055M3dnaXZtdk9kPU9WLWlU QnlVZFlLQUBtYWlsLmdtYWlsLmNvbT46DQoNCmFzPiBKYW4gKHBsZWFzZSBrZWVwIGhpbSBDQ2Vk IG9uIHJlcGxpZXMpIGhhcyBiZWVuIG11c2luZyBhYm91dCB0aGUgc2FtZQ0KYXM+IHRoaW5nLiAg VGhhdCBtaWdodCBzYXRpc2Z5IGV2ZXJ5b25lLiAgSmFuLCB3b3VsZCBpdCBiZSBzdHJhaWdodGZv cndhcmQNCmFzPiB0byBpbXBsZW1lbnQ/DQphcz4gLUFsYW4NCmFzPiANCmFzPiBPbiBTdW4sIEF1 ZyAyNSwgMjAxOSBhdCA1OjUxIFBNIENvbnJhZCBNZXllciA8Y2VtQGZyZWVic2Qub3JnPiB3cm90 ZToNCmFzPiA+DQphcz4gPiBIaSBBbGFuLCBIaXJva2ksDQphcz4gPg0KYXM+ID4gSXQgd291bGQg YmUgcHJldHR5IGVhc3kgdG8gaW5zdGFsbCBhIGBwaW5nNmAgbGluayB0byB0aGUgYHBpbmcoOClg DQphcz4gPiBiaW5hcnkgd2l0aCBkaWZmZXJlbnQgb3B0aW9uIHBhcnNpbmcgKGNvbmRpdGlvbmFs IG9uIGFyZ3ZbMF0pLiAgVGhhdA0KYXM+ID4gcmVtb3ZlcyBtb3N0IG9mIHRoZSBpc3N1ZXMgb2Yg Y29kZSBhbmQgc3BhY2UgZHVwbGljYXRpb24sIEkgdGhpbms/DQphcz4gPiBBbmQgdGhlIGdvYWwg d291bGQgYmUgZm9yIHRoZSAncGluZzYnIG5hbWUgdG8gcmV0YWluIG9wdGlvbg0KYXM+ID4gY29t cGF0aWJpbGl0eSB3aXRoIGhpc3RvcmljYWwgcGluZzYuDQphcz4gPg0KYXM+ID4gSXQncyBub3Qg YW4gdW5jb21tb24gcGF0dGVybjsgZm9yIGV4YW1wbGUsICdpZCcsICdncm91cHMnLCBhbmQNCmFz PiA+ICd3aG9hbWknIGFyZSBhbGwgYSBzaW5nbGUgYmluYXJ5IHdpdGggbXVsdGlwbGUgbGlua2Vk IG5hbWVzLiAgQW5vdGhlcg0KYXM+ID4gZXhhbXBsZSBpcyBDbGFuZywgd2hpY2ggcHJvdmlkZXMg J2NjJywgJ2MrKycsICdjbGFuZycsICdjbGFuZy1jcHAnLA0KYXM+ID4gJ2NsYW5nKysnIGFuZCAn Y3BwJyBsaW5rcyB0byB0aGUgc2FtZSBpbm9kZSDigJQgYW5kIHRob3NlIGhhdmUgdmVyeQ0KYXM+ ID4gZGlmZmVyZW50IGJlaGF2aW9yIGRlcGVuZGluZyBvbiBhcmd2WzBdLg0KYXM+ID4NCmFzPiA+ IEl0J3MgbGVzcyB3b3JrIHRoYW4gZm9yY2luZyB0aGUgcGluZzYgY29tcGF0aWJpbGl0eSBjcm93 ZCB0byBjcmVhdGUgYQ0KYXM+ID4gcG9ydCBhbmQgZG9lc24ndCBodXJ0IHBpbmcoOCkgbXVjaCwg QUZBSUNULiAgSXMgaXQgYW4gYWNjZXB0YWJsZQ0KYXM+ID4gbWlkZGxlIGdyb3VuZD8NCmFzPiA+ DQphcz4gPiBCZXN0LA0KYXM+ID4gQ29ucmFkDQphcz4gPg0KYXM+ID4gT24gU3VuLCBBdWcgMjUs IDIwMTkgYXQgMToyNiBQTSBhbGFuIHNvbWVycyA8YXNvbWVyc0BnbWFpbC5jb20+IHdyb3RlOg0K YXM+ID4gPg0KYXM+ID4gPiBPbiBTdW4sIEF1ZyAyNSwgMjAxOSwgMjoxMSBQTSBIaXJva2kgU2F0 byA8aHJzQGFsbGJzZC5vcmc+IHdyb3RlOg0KYXM+ID4gPj4NCmFzPiA+ID4+IEFsYW4gU29tZXJz IDxhc29tZXJzQGZyZWVic2Qub3JnPiB3cm90ZQ0KYXM+ID4gPj4gICBpbiA8Q0FPdE1YMmhMeHg9 U0t2aDFab2lNQWNhZ1FKalBhUlN2a01MOUorQmdwUXN6NXVOTmJ3QG1haWwuZ21haWwuY29tPjoN CmFzPiA+ID4+DQphcz4gPiA+PiBhcz4gT24gU3VuLCBBdWcgMjUsIDIwMTkgYXQgMToyMiBQTSBI aXJva2kgU2F0byA8aHJzQGFsbGJzZC5vcmc+IHdyb3RlOg0KYXM+ID4gPj4gYXM+ID4NCmFzPiA+ ID4+IGFzPiA+IEhpLA0KYXM+ID4gPj4gYXM+ID4NCmFzPiA+ID4+IGFzPiA+IEFsYW4gU29tZXJz IDxhc29tZXJzQEZyZWVCU0Qub3JnPiB3cm90ZQ0KYXM+ID4gPj4gYXM+ID4gICBpbiA8MjAxOTA4 MjMxNTIyLng3TkZNTHVKMDY4MDM3QHJlcG8uZnJlZWJzZC5vcmc+Og0KYXM+ID4gPj4gYXM+ID4N CmFzPiA+ID4+IGFzPiA+IGFzPiBBdXRob3I6IGFzb21lcnMNCmFzPiA+ID4+IGFzPiA+IGFzPiBE YXRlOiBGcmkgQXVnIDIzIDE1OjIyOjIwIDIwMTkNCmFzPiA+ID4+IGFzPiA+IGFzPiBOZXcgUmV2 aXNpb246IDM1MTQyMw0KYXM+ID4gPj4gYXM+ID4gYXM+IFVSTDogaHR0cHM6Ly9zdm53ZWIuZnJl ZWJzZC5vcmcvY2hhbmdlc2V0L2Jhc2UvMzUxNDIzDQphcz4gPiA+PiBhcz4gPiBhcz4NCmFzPiA+ ID4+IGFzPiA+IGFzPiBMb2c6DQphcz4gPiA+PiBhcz4gPiBhcz4gICBwaW5nNjogUmVuYW1lIG9w dGlvbnMgZm9yIGJldHRlciBjb25zaXN0ZW5jeSB3aXRoIHBpbmcNCmFzPiA+ID4+IGFzPiA+IGFz Pg0KYXM+ID4gPj4gYXM+ID4gYXM+ICAgTm93IGVxdWl2YWxlbnQgb3B0aW9ucyBoYXZlIHRoZSBz YW1lIGZsYWdzLCBhbmQgbm9uZXF1aXZhbGVudCBvcHRpb25zIGhhdmUNCmFzPiA+ID4+IGFzPiA+ IGFzPiAgIGRpZmZlcmVudCBmbGFncy4gIFRoaXMgaXMgYSBwcmVsdWRlIHRvIG1lcmdpbmcgdGhl IHR3byBjb21tYW5kcy4NCmFzPiA+ID4+IGFzPiA+IGFzPg0KYXM+ID4gPj4gYXM+ID4gYXM+ICAg U3VibWl0dGVkIGJ5OiAgICAgSsOhbiBTdcSNYW4gPHN1Y2FuamFuQGdtYWlsLmNvbT4NCmFzPiA+ ID4+IGFzPiA+IGFzPiAgIE1GQzogICAgICAgICAgICAgIE5ldmVyDQphcz4gPiA+PiBhcz4gPiBh cz4gICBTcG9uc29yZWQgYnk6ICAgICBHb29nbGUgTExDIChHb29nbGUgU3VtbWVyIG9mIENvZGUg MjAxOSkNCmFzPiA+ID4+IGFzPiA+IGFzPiAgIERpZmZlcmVudGlhbCBSZXZpc2lvbjogICAgaHR0 cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QyMTM0NQ0KYXM+ID4gPj4gYXM+ID4NCmFzPiA+ID4+ IGFzPiA+ICBJIGhhdmUgYW4gb2JqZWN0aW9uIG9uIHJlbmFtaW5nIHRoZSBleGlzdGluZyBvcHRp b24gZmxhZ3MgaW4gcGluZzYoOCkNCmFzPiA+ID4+IGFzPiA+ICBmb3IgY29tcGF0aWJpbGl0eSB3 aXRoIHBpbmcoOCkuDQphcz4gPiA+PiBhcz4gPg0KYXM+ID4gPj4gYXM+ID4gIElzIGl0IHN1ZmZp Y2llbnQgdG8gYWRkIElORVQ2IHN1cHBvcnQgdG8gcGluZyg4KSB3aXRoIGNvbnNpc3RlbnQNCmFz PiA+ID4+IGFzPiA+ICBmbGFncyBhbmQga2VlcCBDTEkgb2YgcGluZzYoOCkgYmFja3dhcmQgY29t cGF0aWJsZT8gIFBlb3BsZSBoYXZlIHVzZWQNCmFzPiA+ID4+IGFzPiA+ICBwaW5nNig4KSBmb3Ig PjE1IHllYXJzLCBzbyBpdCBpcyB0b28gbGF0ZSB0byByZW5hbWUgdGhlIGZsYWdzLiAgSSBkbw0K YXM+ID4gPj4gYXM+ID4gIG5vdCB0aGluayB0aGUgcmVuYW1pbmcgaXMgdXNlZnVsIGlmICJwaW5n IC02IGxvY2FsaG9zdCIgb3IgInBpbmcgOjoxIg0KYXM+ID4gPj4gYXM+ID4gIHdvcmtzLg0KYXM+ ID4gPj4gYXM+ID4NCmFzPiA+ID4+IGFzPiA+IC0tIEhpcm9raQ0KYXM+ID4gPj4gYXM+DQphcz4g PiA+PiBhcz4gSWYgcGluZyB3b3JrcyB3aXRoIGluZXQ2LCB0aGVuIHdoeSB3b3VsZCB3ZSB3YW50 IHRvIGtlZXAgYSBzZXBhcmF0ZQ0KYXM+ID4gPj4gYXM+IHRvb2wgYXJvdW5kPyAgSWYgaXQncyBq dXN0IGZvciB0aGUgc2FrZSBvZiBwZW9wbGUgd2hvIGRvbid0IHdhbnQgdG8gb3INCmFzPiA+ID4+ IGFzPiBjYW4ndCB1cGRhdGUgc2NyaXB0cywgd291bGQgYSB2ZXJzaW9uIGluIHBvcnRzIHN1ZmZp Y2U/DQphcz4gPiA+Pg0KYXM+ID4gPj4gIEJlY2F1c2UgcmVtb3ZpbmcgKG9yIHJlbmFtaW5nKSBp dCBjYXVzZXMgYSBQT0xBIHZpb2xhdGlvbi4gIERvIHdlDQphcz4gPiA+PiAgcmVhbGx5IGhhdmUg YSBzdHJvbmcsIHVuYXZvaWRhYmxlIHJlYXNvbiB0byBmb3JjZSBwZW9wbGUgdG8gcmV3cml0ZQ0K YXM+ID4gPj4gIHRoZWlyIHNjcmlwdCBub3c/ICBUaGlzIGlzIHN0aWxsIGEgZmFpcmx5IGVzc2Vu dGlhbCBhbmQgYWN0aXZlbHkgdXNlZA0KYXM+ID4gPj4gIHRvb2wsIG5vdCBsaWtlIHJjcCBvciBy bG9naW4uICBBbHRob3VnaCBkZXByZWNhdGluZyBwaW5nNig4KSBhbmQNCmFzPiA+ID4+ICByZW1v dmluZyBpdCBmcm9tIHRoZSBiYXNlIHN5c3RlbSBpbiB0aGUgZnV0dXJlIHJlbGVhc2UgYXQgc29t ZSBwb2ludA0KYXM+ID4gPj4gIG1heSB3b3JrLCBjaGFuZ2luZyB0aGUgZXhpc3RpbmcgaW50ZXJm YWNlIHdpbGwgc2ltcGx5IGNvbmZ1c2UgcGVvcGxlDQphcz4gPiA+PiAgd2hvIGhhdmUgdXNlZCBJ UHY2IGZvciBhIGxvbmcgdGltZS4NCmFzPiA+ID4+DQphcz4gPiA+PiAgSW4gbXkgdW5kZXJzdGFu ZGluZywgdGhlIHB1cnBvc2UgdG8gaW50ZWdyYXRlIHBpbmcoOCkgYW5kIHBpbmc2KDgpDQphcz4g PiA+PiAgaW50byBhIHNpbmdsZSB1dGlsaXR5IGlzIHRvIHByb3ZpZGUgYSBjb25zaXN0ZW50IENM SSBhbmQgcmVkdWNlDQphcz4gPiA+PiAgZHVwbGljYXRlIGNvZGUsIG5vdCB0byBicmVhayBjb21w YXRpYmlsaXR5Lg0KYXM+ID4gPj4NCmFzPiA+ID4+IC0tIEhpcm9raQ0KYXM+ID4gPg0KYXM+ID4g Pg0KYXM+ID4gPiBUaG9zZSBnb2FscyBhcmUgaW5jb21wYXRpYmxlLiBXZSBjYW4ndCBwcm92aWRl IGEgY29uc2lzdGVudCBDTEkgd2l0aG91dCBicmVha2luZyBjb21wYXRpYmlsaXR5IGJlY2F1c2Ug cGluZyBhbmQgcGluZzYgaGF2ZSBjb25mbGljdGluZyBvcHRpb25zLiAgQW5kIHdlIGNhbid0IGtl ZXAgcGluZzYgYXJvdW5kIHdoaWxlIGFsc28gcmVtb3ZpbmcgZHVwbGljYXRlIGNvZGUgYmVjYXVz ZSB0aGF0IHdvdWxkIGJlLCB3ZWxsLCBkdXBsaWNhdGUgY29kZS4NCmFzPiA+ID4NCmFzPiA+ID4g V2hlbiB3b3VsZCBiZSBhIGJldHRlciB0aW1lIHRoYW4gYSBtYWpvciB2ZXJzaW9uIGJ1bXAgdG8g bWFrZSBhIGNoYW5nZSBsaWtlIHRoaXM/DQphcz4gPiA+DQphcz4gPiA+IFRoZSBsYWNrIG9mIGEg cGluZzYgY29tbWFuZCBpbiBmcmVlYnNkIDEzIHNob3VsZCBzZXJ2ZSBhcyBhIHByZXR0eSBvYnZp b3VzIHJlbWluZGVyIHRoYXQgc2NyaXB0cyB3aWxsIG5lZWQgdXBkYXRpbmcuICBJIHRoaW5rIHRo YXQgcHV0dGluZyBhIHZlcnNpb24gb2YgcGluZzYgaW4gcG9ydHMgc2hvdWxkIGJlIGEgc3VmZmlj aWVudCBjcnV0Y2ggZm9yIHRob3NlIHdobyBuZWVkIGl0LCBkb24ndCB5b3U/DQphcz4gDQphcz4g DQoNCi0tIEhpcm9raQ0K ----Security_Multipart(Mon_Aug_26_09_18_17_2019_471)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAl1jJUkACgkQTyzT2CeTzy3SmQCeOgJHNCS5Uv0z78W/tFaXfseE lOQAoNT/RpxbCo/wCUxIXpNth3O30p0x =qvmJ -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug_26_09_18_17_2019_471)---- From owner-svn-src-head@freebsd.org Mon Aug 26 00:46:40 2019 Return-Path: Delivered-To: svn-src-head@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 7016ECA8BA; Mon, 26 Aug 2019 00:46:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46GtcJ2MPYz3C1P; Mon, 26 Aug 2019 00:46:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E64B25ED5; Mon, 26 Aug 2019 00:46:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7Q0keG7020728; Mon, 26 Aug 2019 00:46:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7Q0keZM020727; Mon, 26 Aug 2019 00:46:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908260046.x7Q0keZM020727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Aug 2019 00:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351501 - head/sys/contrib/zlib X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/contrib/zlib X-SVN-Commit-Revision: 351501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 00:46:40 -0000 Author: delphij Date: Mon Aug 26 00:46:39 2019 New Revision: 351501 URL: https://svnweb.freebsd.org/changeset/base/351501 Log: MFV r351500: Fix CLEAR_HASH macro to be usable as a single statement. MFC after: 2 weeks Modified: head/sys/contrib/zlib/deflate.c Directory Properties: head/sys/contrib/zlib/ (props changed) Modified: head/sys/contrib/zlib/deflate.c ============================================================================== --- head/sys/contrib/zlib/deflate.c Sun Aug 25 23:51:44 2019 (r351500) +++ head/sys/contrib/zlib/deflate.c Mon Aug 26 00:46:39 2019 (r351501) @@ -189,9 +189,11 @@ local const config configuration_table[10] = { * Initialize the hash table (avoiding 64K overflow for 16 bit systems). * prev[] will be initialized on the fly. */ -#define CLEAR_HASH(s) do { \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ +#define CLEAR_HASH(s) \ + do { \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, \ + (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== From owner-svn-src-head@freebsd.org Mon Aug 26 01:47:30 2019 Return-Path: Delivered-To: svn-src-head@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 86001CB7E8 for ; Mon, 26 Aug 2019 01:47:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 46GvyT3nyfz3F3W for ; Mon, 26 Aug 2019 01:47:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x743.google.com with SMTP id s145so12895034qke.7 for ; Sun, 25 Aug 2019 18:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=paLFNFTL1CmTpZmLB+ClrikDf1/GDNOE0G8FbJVY6mw=; b=bQ+jwFX+39bTqg4daSD+bXXA1ZzJTfpv8Imoe3nhyHmxfBKNekpZNYhhyQ63UUeVnD WEL+Dd3qPLJt1zTKby4UYKh7B5EPkuqaegWaVNnHYBX1yfUrse7OKnn5M6I4LnH7FLUX bUD5iFDAqmYrPIcyFX1SN9ighoiLqSjCArZzInV9lh5+5gvbeXazRcStS5HDEPJC676M 9L7TNcrOR57vM1OdCAE2ovyQjosHrns5YggzT8IqSnm0ra+9tuperZC8tfiH0CgFUr1W stEqxa2WpiSNEQ1ra2PUYqZXCxKAw4mviMgETj0Ght9slPM9iC8RuzwSOLp+/zSvxchc P8Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=paLFNFTL1CmTpZmLB+ClrikDf1/GDNOE0G8FbJVY6mw=; b=s52tnVY9/gwe8ElFX3qYtkbWEb4V1Huy/qE5HT4EFFjwryt5fUi7Jqs7dZgvP361iM ljdpcPNx8jy5uSGlUig2mUbpMqHXctW55/cLzhijLaMX+yC2si8HyWdukna0U245EXjW 14Hu/N0u8KHQkuttAXZEuc+uz073Mn4Jr+z2HgT42kwIfHXQwAb5ft3YDYGozACqBFJ6 yItpTOYF5AEMQpokd+KGbyY3phqdAMT4Wla9IJojSQmx/EOb7sheoVGnP8fn0VHwRM00 R9cgq8TBUCXAsTbo2yKy4y23hPH2gUJF4t3Uqcrn+mQ+mwUYWisxiKcVFqvbp6fvawJM EvAA== X-Gm-Message-State: APjAAAXvJQl7epAT7eEbkX5oaCXG0Wet4x57heZaLPe85JT2um9f9TWM KpmqH5Px65uPTlaahhhqz0dTXQ== X-Google-Smtp-Source: APXvYqxtgJuNY3Aw1y3fMx39K6lYUBPh/dbxqRvYftJ+j89+n9f7e9hxmlUE3I9vcFrMUXkC9SmKGQ== X-Received: by 2002:a05:620a:4c8:: with SMTP id 8mr13402975qks.366.1566784048170; Sun, 25 Aug 2019 18:47:28 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id q73sm5633433qke.90.2019.08.25.18.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 18:47:27 -0700 (PDT) Date: Sun, 25 Aug 2019 21:47:26 -0400 From: Shawn Webb To: Hiroki Sato Cc: asomers@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests Message-ID: <20190826014726.mwddt4uwqoulewhh@mutt-hbsd> References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="63e6t6wtjncgu5iy" Content-Disposition: inline In-Reply-To: <20190826.042056.1329861772202588895.hrs@allbsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46GvyT3nyfz3F3W X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=bQ+jwFX+; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.54 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; RCVD_IN_DNSWL_NONE(0.00)[3.4.7.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]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.47)[ip: (2.91), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.33), country: US(-0.05)]; RECEIVED_SPAMHAUS_PBL(0.00)[239.118.196.151.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 01:47:30 -0000 --63e6t6wtjncgu5iy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 26, 2019 at 04:20:56AM +0900, Hiroki Sato wrote: > Hi, >=20 > Alan Somers wrote > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: >=20 > as> Author: asomers > as> Date: Fri Aug 23 15:22:20 2019 > as> New Revision: 351423 > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > as>=20 > as> Log: > as> ping6: Rename options for better consistency with ping > as> =20 > as> Now equivalent options have the same flags, and nonequivalent optio= ns have > as> different flags. This is a prelude to merging the two commands. > as> =20 > as> Submitted by: J?n Su?an > as> MFC: Never > as> Sponsored by: Google LLC (Google Summer of Code 2019) > as> Differential Revision: https://reviews.freebsd.org/D21345 >=20 > I have an objection on renaming the existing option flags in ping6(8) > for compatibility with ping(8). >=20 > Is it sufficient to add INET6 support to ping(8) with consistent > flags and keep CLI of ping6(8) backward compatible? People have used > ping6(8) for >15 years, so it is too late to rename the flags. I do > not think the renaming is useful if "ping -6 localhost" or "ping ::1" > works. I wonder if something like this could be done: Somewhere in ping(8): bool ping6_compat; if (strcmp(argv[0], "ping6")) { ping6_compat =3D true; } =2E.. if (ping6_compat) { do_this(); } else {} do_that(); } And sbin/ping/Makefile: LINKS+=3Dsbin/ping sbin/ping6 (Note that I didn't check if sbin/ping/Makefile already set LINKS. If it doesn't, it'd be "LINKS=3D", of course.) Then, ping(8) and ping6(8) still are the same binary and backwards compat is maintained, at least until spray paints the neon pink bike shed. (Note: I am in no way saying this discussion is a bike shed. I'm _only_ making a joke as a nod to the idiomatic expression.) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --63e6t6wtjncgu5iy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl1jOigACgkQ/y5nonf4 4frgYw/9ELxk7ab6jWJaadj3jql60yKBQMcPEiLCzd1UZYe3528CKs1TIKPnbN7x mTAhEusRs/GJabiQaB9rbhKgWgKv293wsGXV1t/NW/AwQS6o0DWrFXrCaTI3wIkU Oj+EFw4amq0bHlxRnk/fDGRC+JIcL0WljGAd0WUzzFzPkd/3KHNjXS8He4shk3kc ld2YWPyNzjH4NqMItouqeJlJZw9HvTIxdsW1jle33QJKI3087ZBK76IJmIhA14um xU5WW0yJmjpryalnX3s38jsOPOUeer1CbyE06QKwB+13S5T+eBo1YAgu3sQ0dhRQ jf30hcN/AwtwVihh4a22c/yztW4avL2C1EXGmJrQjnfSN5O0a1afEM/TUoD/6ChR XwO6aAC8djEP9VZsVKV9IVwKpCUcOMlE252JKLCigMpKNf+0SvUQi+SJzOBPA+pB +X2eRO9oHMO2fssAP6wqlNqhI+0lveTVPORFSjmCqIBKezDMeLJLDd23CbyC32d+ mtpU3NOCafiYGMXT26KcI5/a8aRtK8BgwCFoyLxDr82ro/Kly5TXTrULET5w0iqJ wrQ6l5qc7qZIHHX0DWq+BdX84KM4s8CkRqKQY01Vi8qqkVxbpCGU7DSNQcdA0q2t 2jfGNpqEPe0mBCHMX3cd0Gc1s1OaD/udTRR8sMC6Qh6lBaB0Fl4= =6BTW -----END PGP SIGNATURE----- --63e6t6wtjncgu5iy-- From owner-svn-src-head@freebsd.org Mon Aug 26 02:29:35 2019 Return-Path: Delivered-To: svn-src-head@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 70042CC2F3; Mon, 26 Aug 2019 02:29:35 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Gwv21dPCz3GXD; Mon, 26 Aug 2019 02:29:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7Q2TMlC074267; Sun, 25 Aug 2019 19:29:22 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7Q2TMSM074266; Sun, 25 Aug 2019 19:29:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201908260229.x7Q2TMSM074266@gndrsh.dnsmgr.net> Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests In-Reply-To: To: alan somers Date: Sun, 25 Aug 2019 19:29:22 -0700 (PDT) CC: Hiroki Sato , Alan Somers , Jan Sucan , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46Gwv21dPCz3GXD X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.38)[0.385,0]; NEURAL_HAM_LONG(-0.72)[-0.724,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.67)[0.670,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 02:29:35 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > > > Alan Somers wrote > > in : > > > > as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: > > as> > > > as> > Hi, > > as> > > > as> > Alan Somers wrote > > as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > > as> > > > as> > as> Author: asomers > > as> > as> Date: Fri Aug 23 15:22:20 2019 > > as> > as> New Revision: 351423 > > as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > > as> > as> > > as> > as> Log: > > as> > as> ping6: Rename options for better consistency with ping > > as> > as> > > as> > as> Now equivalent options have the same flags, and nonequivalent > > options have > > as> > as> different flags. This is a prelude to merging the two > > commands. > > as> > as> > > as> > as> Submitted by: J?n Su?an > > as> > as> MFC: Never > > as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) > > as> > as> Differential Revision: https://reviews.freebsd.org/D21345 > > as> > > > as> > I have an objection on renaming the existing option flags in > > ping6(8) > > as> > for compatibility with ping(8). > > as> > > > as> > Is it sufficient to add INET6 support to ping(8) with consistent > > as> > flags and keep CLI of ping6(8) backward compatible? People have > > used > > as> > ping6(8) for >15 years, so it is too late to rename the flags. I do > > as> > not think the renaming is useful if "ping -6 localhost" or "ping > > ::1" > > as> > works. > > as> > > > as> > -- Hiroki > > as> > > as> If ping works with inet6, then why would we want to keep a separate > > as> tool around? If it's just for the sake of people who don't want to or > > as> can't update scripts, would a version in ports suffice? > > > > Because removing (or renaming) it causes a POLA violation. Do we > > really have a strong, unavoidable reason to force people to rewrite > > their script now? This is still a fairly essential and actively used > > tool, not like rcp or rlogin. Although deprecating ping6(8) and > > removing it from the base system in the future release at some point > > may work, changing the existing interface will simply confuse people > > who have used IPv6 for a long time. > > > > In my understanding, the purpose to integrate ping(8) and ping6(8) > > into a single utility is to provide a consistent CLI and reduce > > duplicate code, not to break compatibility. > > > > -- Hiroki > > > > Those goals are incompatible. We can't provide a consistent CLI without > breaking compatibility because ping and ping6 have conflicting options. > And we can't keep ping6 around while also removing duplicate code because > that would be, well, duplicate code. Only incompatible in mind. $0 can easily be used to determine which set of getopt() to process in a single binary that then has unduplicated code to implement the set of final options. A bit more to code but should achive the single binary linked by 2 names processing 2 different option sets executing 1 set of common code. I am firmyly in the camp these changes are being made to well estabilish and probably heavily used utility by both humans and shell scripts. I was not happy with the changes to -n, but sat silient on that issue, with other things being done I need to chime in and say I think that this is poorly tought out with respect to downstream impact. > > When would be a better time than a major version bump to make a change like > this? > > The lack of a ping6 command in freebsd 13 should serve as a pretty obvious > reminder that scripts will need updating. I think that putting a version > of ping6 in ports should be a sufficient crutch for those who need it, > don't you? How does a copy in ports of the old ping6 code "remove duplicate code", that just changes the location of the duplication out of base where it shall certainly rot as unmaintained causing numerious consumers heart ache over time. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Aug 26 03:50:25 2019 Return-Path: Delivered-To: svn-src-head@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 A03C2CE014; Mon, 26 Aug 2019 03:50:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 46GyhJ3ZwMz3Kyx; Mon, 26 Aug 2019 03:50:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id l7so34007240ioj.6; Sun, 25 Aug 2019 20:50:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=6wbovqpq62M6hEcAoDTjKDkb+6dkjLMekazh+A1N9pk=; b=cNfrK25w22FMkf6wsjkCCU1WMLpRRh5HmmovNkUSOZdHHFKrGGc5dB8HKqjQTX6dob I4e1IcszghfqwWizRCydbBtKDm54vSrc14yJIn1gTOlFz0Anm+n/mh0qJSO7FgBMES/Z dX/nv6V+8g3B4lmmGwH5KbXHowQGbyP7SUvl0JQlpLUVtqmEJc7ODbv7thWgxmHQazL0 N3jDQDPv4xlbsYMXLfxeOYwxmoQYQOIHllArXJ+0r6m1ZBq9AdfglgGxbE6wjfUtZGNp KnOvuncUYffSQ70v4OAKb43UhPJEkxJ01oYNk2P0V9kCV3HVWFFqDWL0n3KUoVfdTj14 kXmg== X-Gm-Message-State: APjAAAWFSfFXZyf5PLUUY5Rf5++Bgj1Ulcwm0HIuFI8VZtmGGT8JXD5u mHeEGAOP1Mn1AnrV0rvOHSAu3coj X-Google-Smtp-Source: APXvYqz9iWgT25l0H1gTKCrXSWvMId9CmUF4V4kBL8GTbyYNzryolV24cPS7ti8QdgLl3VyqfI5GtA== X-Received: by 2002:a5d:8599:: with SMTP id f25mr21690204ioj.265.1566791422748; Sun, 25 Aug 2019 20:50:22 -0700 (PDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id k3sm12619476ioq.18.2019.08.25.20.50.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Aug 2019 20:50:22 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id t3so33875151ioj.12; Sun, 25 Aug 2019 20:50:22 -0700 (PDT) X-Received: by 2002:a02:b604:: with SMTP id h4mr15214116jam.78.1566791422272; Sun, 25 Aug 2019 20:50:22 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826014726.mwddt4uwqoulewhh@mutt-hbsd> In-Reply-To: <20190826014726.mwddt4uwqoulewhh@mutt-hbsd> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 25 Aug 2019 20:50:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Shawn Webb Cc: svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46GyhJ3ZwMz3Kyx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.48 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.64 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[48.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.65)[ip: (-7.52), ipnet: 209.85.128.0/17(-3.35), asn: 15169(-2.33), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[48.166.85.209.rep.mailspike.net : 127.0.0.17]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 03:50:25 -0000 On Sun, Aug 25, 2019 at 6:47 PM Shawn Webb wrote: > I wonder if something like this could be done: Something like it could be; I suggested so two hours ago. > Somewhere in ping(8): > bool ping6_compat; > if (strcmp(argv[0], "ping6")) { > ping6_compat = true; You've gotten the sense of the basic C89 function strcmp() backwards. Maybe it's a security feature that way? You can add HardenedStrcmp to your Easy Feature Comparison page. Conrad From owner-svn-src-head@freebsd.org Mon Aug 26 04:35:23 2019 Return-Path: Delivered-To: svn-src-head@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 0E7F9CEEE3; Mon, 26 Aug 2019 04:35:23 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 46Gzh95VMDz3Mmw; Mon, 26 Aug 2019 04:35:21 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id s18so13932560wrn.1; Sun, 25 Aug 2019 21:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=cMmXbT221xByOLlnT27es9s58Q8Y01sWT+2f20LVC1s=; b=QBLiVDf0tMIsL7IFMJ6qV0wxXiPkJnPgDImztokP4n5LnmXZGLeWNbyHK7uF1QtQoi i/KLUDyDT+Rx18Rw2jTcd3kzlXdFKEIvq9VOSI5f/FDbz1JzlrUS6VGMlX9qzXZ7ICRp EUb9Xc+V2DVhxEubCeINJmomRxMRtDGGPNNwJqpCmGYa1jLWvEHZko1tzHroDOGK7JUc 2U9eLhqgwzI4lOTG9oSSZKpuVruDbpiUBGwM8RajtCSTu+ZT/kMZ8ZRjXrulCfjJoB+J yi7XoDCjDXQpovgDIwzwO8Aw02xSGZd0I+QQGkwObpwAonyWwxAUjLbdETfBJk65RvtH 1TuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cMmXbT221xByOLlnT27es9s58Q8Y01sWT+2f20LVC1s=; b=kJuvTC8X890zJ3PDyTPWmvwLzCqx26/JftzzuaGE12+WM+jaBomKg111UarMv8ay6m 2tzRwZmQcUZygkfRypMeY3YFqU05rlKbbYi24UyOfRj0BYC5xUE99g8njZa0Kzqs7vlr Ek09ESZzCLeWvvkugfAArBbM8kh7iH5TW7oZlnfWs7UCOaD1VVEBmg6x81vb8QAtfgaF h0YqtvhqsUCAA22bTGrEum36XPkGb2G5DjlCAfWCW3sA4g6cGaC2bcChTRoD2i9zk2dJ 70DrJkYHTYDdGDAzKzmTWVJH8L8f0eBvjljshgcz9M8kLWnqzWWvJvu57ChGy/wsFVyj JVCA== X-Gm-Message-State: APjAAAXeHvwKr9paLIk2zeIeMgt1W18HdBqHvLvcxg3e/ElcJogdeY3o ED3brG82nX7+FIkRjpf7CbT60zSgrtXF+Q== X-Google-Smtp-Source: APXvYqwRTAKqU0i1WS5jMp+qy1m0cjO/GR1e5hEzs/kQzNjsrWR/mjRDUnX4zOryliteEby+b6GK3w== X-Received: by 2002:adf:afe7:: with SMTP id y39mr18932468wrd.350.1566793743802; Sun, 25 Aug 2019 21:29:03 -0700 (PDT) Received: from [192.168.1.102] (120.215.broadband18.iol.cz. [109.81.215.120]) by smtp.gmail.com with ESMTPSA id i93sm23865408wri.57.2019.08.25.21.29.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Aug 2019 21:29:03 -0700 (PDT) Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Alan Somers , "Conrad E. Meyer" Cc: Hiroki Sato , src-committers , svn-src-all , svn-src-head References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> From: Jan Sucan Message-ID: <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> Date: Mon, 26 Aug 2019 06:28:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 46Gzh95VMDz3Mmw X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=QBLiVDf0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sucanjan@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=sucanjan@gmail.com X-Spamd-Result: default: False [3.19 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; NEURAL_HAM_SHORT(-0.76)[-0.758,0]; RECEIVED_SPAMHAUS_PBL(0.00)[120.215.81.109.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[120.215.81.109.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.4]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.07)[-0.065,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.986,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.67), ipnet: 2a00:1450::/32(-3.00), asn: 15169(-2.33), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.4.4.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]; RCVD_TLS_ALL(0.00)[]; GREYLIST(0.00)[pass,body] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 04:35:23 -0000 Hello, I can implement it. I suppose that ping6's manual page should be kept it this case. I was also thinking about printing a warning for each option renamed to lead a willing user to use the new unified option set of ping. It could be either only with -v, or by default and suppressed with -q. Or should the option translation be completely transparent? -Jan On 26. 8. 2019 1:58, Alan Somers wrote: > Jan (please keep him CCed on replies) has been musing about the same > thing. That might satisfy everyone. Jan, would it be straightforward > to implement? > -Alan > > On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: >> Hi Alan, Hiroki, >> >> It would be pretty easy to install a `ping6` link to the `ping(8)` >> binary with different option parsing (conditional on argv[0]). That >> removes most of the issues of code and space duplication, I think? >> And the goal would be for the 'ping6' name to retain option >> compatibility with historical ping6. >> >> It's not an uncommon pattern; for example, 'id', 'groups', and >> 'whoami' are all a single binary with multiple linked names. Another >> example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', >> 'clang++' and 'cpp' links to the same inode — and those have very >> different behavior depending on argv[0]. >> >> It's less work than forcing the ping6 compatibility crowd to create a >> port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable >> middle ground? >> >> Best, >> Conrad >> >> On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: >>> On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: >>>> Alan Somers wrote >>>> in : >>>> >>>> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: >>>> as> > >>>> as> > Hi, >>>> as> > >>>> as> > Alan Somers wrote >>>> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: >>>> as> > >>>> as> > as> Author: asomers >>>> as> > as> Date: Fri Aug 23 15:22:20 2019 >>>> as> > as> New Revision: 351423 >>>> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 >>>> as> > as> >>>> as> > as> Log: >>>> as> > as> ping6: Rename options for better consistency with ping >>>> as> > as> >>>> as> > as> Now equivalent options have the same flags, and nonequivalent options have >>>> as> > as> different flags. This is a prelude to merging the two commands. >>>> as> > as> >>>> as> > as> Submitted by: Ján Sučan >>>> as> > as> MFC: Never >>>> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) >>>> as> > as> Differential Revision: https://reviews.freebsd.org/D21345 >>>> as> > >>>> as> > I have an objection on renaming the existing option flags in ping6(8) >>>> as> > for compatibility with ping(8). >>>> as> > >>>> as> > Is it sufficient to add INET6 support to ping(8) with consistent >>>> as> > flags and keep CLI of ping6(8) backward compatible? People have used >>>> as> > ping6(8) for >15 years, so it is too late to rename the flags. I do >>>> as> > not think the renaming is useful if "ping -6 localhost" or "ping ::1" >>>> as> > works. >>>> as> > >>>> as> > -- Hiroki >>>> as> >>>> as> If ping works with inet6, then why would we want to keep a separate >>>> as> tool around? If it's just for the sake of people who don't want to or >>>> as> can't update scripts, would a version in ports suffice? >>>> >>>> Because removing (or renaming) it causes a POLA violation. Do we >>>> really have a strong, unavoidable reason to force people to rewrite >>>> their script now? This is still a fairly essential and actively used >>>> tool, not like rcp or rlogin. Although deprecating ping6(8) and >>>> removing it from the base system in the future release at some point >>>> may work, changing the existing interface will simply confuse people >>>> who have used IPv6 for a long time. >>>> >>>> In my understanding, the purpose to integrate ping(8) and ping6(8) >>>> into a single utility is to provide a consistent CLI and reduce >>>> duplicate code, not to break compatibility. >>>> >>>> -- Hiroki >>> >>> Those goals are incompatible. We can't provide a consistent CLI without breaking compatibility because ping and ping6 have conflicting options. And we can't keep ping6 around while also removing duplicate code because that would be, well, duplicate code. >>> >>> When would be a better time than a major version bump to make a change like this? >>> >>> The lack of a ping6 command in freebsd 13 should serve as a pretty obvious reminder that scripts will need updating. I think that putting a version of ping6 in ports should be a sufficient crutch for those who need it, don't you? From owner-svn-src-head@freebsd.org Mon Aug 26 04:40:41 2019 Return-Path: Delivered-To: svn-src-head@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 D660BCEFD8 for ; Mon, 26 Aug 2019 04:40:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 46GzpJ4zFDz3MxV for ; Mon, 26 Aug 2019 04:40:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id l9so16727906qtu.6 for ; Sun, 25 Aug 2019 21:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fB79W3XA56WQpyZIzrce2Y7iAmv9V6dJXuK7zltBSV8=; b=rT4v0ZswWrY6OZ94caBrN6/7BQEp57q6+1vymCzuflykMxK568Fi/vDsEF9XfaguBO vywPOcXI2KFtlIdKxGzs5SZzsUmgGNUeZVdeUgImpqVeWBqxUxm2Vr0DGkTL2rvh/JeU 6R+skQh4bKJUotR9geaji1bhJZEuHYjSj8/3jcUeZoGIP4fE+O68jXCB77RDO7dUot0z 1hsiIU/wEewQnz1MIjvvDVAbyH51apQiwZdxzhBxZSqz1cGXmSSHe9OaLSzvT7m/B8TR F/xocbmCEpkuXMLpcr5IgTe/ojXV8cKd3INi4aEFYqNAhIZxQD1Tj4ZmBLuspRDTq58O eGBg== 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=fB79W3XA56WQpyZIzrce2Y7iAmv9V6dJXuK7zltBSV8=; b=jW1iWg0ob2kIQ6nKqCa0a5tOFs2WfSGrYr/YEEH91ABfim7/PHaYWbVGPYnPT5MQ0b mPRqYw4uVdqxIv5Wc+aCwOlW4V1rwHfYEnuplaWYqBEacMetPtngR9/oL8ORetEuxOKj nR6L+jOxIBTtOmsmbU9jViadK3OQW4sNQTvo5W6P0qWgk64ecirykELet9RLXgab5q7I W8Fb2gNtwQeUQPfxXZxz1E/EfekQeXgH4Ov9OJEJYvUgGbZkP16oURC/B74vaIc3rgj3 wCDCX0Wek09n/f8K/9Z1jGsIv1gG13QWEFI8gYdX88MrUFNbShGTJAcKVFdQOoTz1YYJ GI8g== X-Gm-Message-State: APjAAAVwK9mXMVuHpSNLvId7/Jjxi60grNqgmCASI3d/kQQXLDo+BfqA O4v595I+p0euY1MQo1vB2VG1glPZAswjJruTeik6nQ== X-Google-Smtp-Source: APXvYqyacxT0XCsDJapjok8mNpQtJFtQMuYmj3JEZw01zs/Vm0sZDqiyxc/Hi94QqbKslLIFjOo1Cw+nzsrDRvXdMzA= X-Received: by 2002:ac8:4602:: with SMTP id p2mr15860269qtn.291.1566794439418; Sun, 25 Aug 2019 21:40:39 -0700 (PDT) MIME-Version: 1.0 References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> In-Reply-To: <379c3378-f9dd-4d6b-35ca-fa1ac7e6386b@gmail.com> From: Warner Losh Date: Sun, 25 Aug 2019 22:40:27 -0600 Message-ID: Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Jan Sucan Cc: Alan Somers , "Conrad E. Meyer" , Hiroki Sato , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46GzpJ4zFDz3MxV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=rT4v0Zsw; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.51 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; RCVD_IN_DNSWL_NONE(0.00)[4.4.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]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.52)[ip: (2.64), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.33), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 04:40:41 -0000 On Sun, Aug 25, 2019, 10:35 PM Jan Sucan wrote: > Hello, > > I can implement it. I suppose that ping6's manual page should be kept it > this case. > The differences are small enough you may be able to combine man pages. I was also thinking about printing a warning for each option renamed to > lead a willing user to use the new unified option set of ping. It could > be either only with -v, or by default and suppressed with -q. Or should > the option translation be completely transparent? > This I'm unsure about., so I'll leave it to others to opine. Warner -Jan > > On 26. 8. 2019 1:58, Alan Somers wrote: > > Jan (please keep him CCed on replies) has been musing about the same > > thing. That might satisfy everyone. Jan, would it be straightforward > > to implement? > > -Alan > > > > On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: > >> Hi Alan, Hiroki, > >> > >> It would be pretty easy to install a `ping6` link to the `ping(8)` > >> binary with different option parsing (conditional on argv[0]). That > >> removes most of the issues of code and space duplication, I think? > >> And the goal would be for the 'ping6' name to retain option > >> compatibility with historical ping6. > >> > >> It's not an uncommon pattern; for example, 'id', 'groups', and > >> 'whoami' are all a single binary with multiple linked names. Another > >> example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', > >> 'clang++' and 'cpp' links to the same inode =E2=80=94 and those have v= ery > >> different behavior depending on argv[0]. > >> > >> It's less work than forcing the ping6 compatibility crowd to create a > >> port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable > >> middle ground? > >> > >> Best, > >> Conrad > >> > >> On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: > >>> On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > >>>> Alan Somers wrote > >>>> in SKvh1ZoiMAcagQJjPaRSvkML9J+BgpQsz5uNNbw@mail.gmail.com>: > >>>> > >>>> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato > wrote: > >>>> as> > > >>>> as> > Hi, > >>>> as> > > >>>> as> > Alan Somers wrote > >>>> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > >>>> as> > > >>>> as> > as> Author: asomers > >>>> as> > as> Date: Fri Aug 23 15:22:20 2019 > >>>> as> > as> New Revision: 351423 > >>>> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > >>>> as> > as> > >>>> as> > as> Log: > >>>> as> > as> ping6: Rename options for better consistency with ping > >>>> as> > as> > >>>> as> > as> Now equivalent options have the same flags, and > nonequivalent options have > >>>> as> > as> different flags. This is a prelude to merging the two > commands. > >>>> as> > as> > >>>> as> > as> Submitted by: J=C3=A1n Su=C4=8Dan > >>>> as> > as> MFC: Never > >>>> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019= ) > >>>> as> > as> Differential Revision: > https://reviews.freebsd.org/D21345 > >>>> as> > > >>>> as> > I have an objection on renaming the existing option flags in > ping6(8) > >>>> as> > for compatibility with ping(8). > >>>> as> > > >>>> as> > Is it sufficient to add INET6 support to ping(8) with > consistent > >>>> as> > flags and keep CLI of ping6(8) backward compatible? People > have used > >>>> as> > ping6(8) for >15 years, so it is too late to rename the > flags. I do > >>>> as> > not think the renaming is useful if "ping -6 localhost" or > "ping ::1" > >>>> as> > works. > >>>> as> > > >>>> as> > -- Hiroki > >>>> as> > >>>> as> If ping works with inet6, then why would we want to keep a > separate > >>>> as> tool around? If it's just for the sake of people who don't want > to or > >>>> as> can't update scripts, would a version in ports suffice? > >>>> > >>>> Because removing (or renaming) it causes a POLA violation. Do we > >>>> really have a strong, unavoidable reason to force people to rewrit= e > >>>> their script now? This is still a fairly essential and actively > used > >>>> tool, not like rcp or rlogin. Although deprecating ping6(8) and > >>>> removing it from the base system in the future release at some poi= nt > >>>> may work, changing the existing interface will simply confuse peop= le > >>>> who have used IPv6 for a long time. > >>>> > >>>> In my understanding, the purpose to integrate ping(8) and ping6(8) > >>>> into a single utility is to provide a consistent CLI and reduce > >>>> duplicate code, not to break compatibility. > >>>> > >>>> -- Hiroki > >>> > >>> Those goals are incompatible. We can't provide a consistent CLI > without breaking compatibility because ping and ping6 have conflicting > options. And we can't keep ping6 around while also removing duplicate co= de > because that would be, well, duplicate code. > >>> > >>> When would be a better time than a major version bump to make a chang= e > like this? > >>> > >>> The lack of a ping6 command in freebsd 13 should serve as a pretty > obvious reminder that scripts will need updating. I think that putting a > version of ping6 in ports should be a sufficient crutch for those who nee= d > it, don't you? > > > From owner-svn-src-head@freebsd.org Mon Aug 26 05:25:04 2019 Return-Path: Delivered-To: svn-src-head@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 5556CD03C0; Mon, 26 Aug 2019 05:25:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46H0nW0xmBz3Q12; Mon, 26 Aug 2019 05:25:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 27UviVRdNUIS227UwinelM; Sun, 25 Aug 2019 23:25:01 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=iKhvJSA4AAAA:8 a=Wi8YH2NmAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=RVYa22C5S4XIXbcRN4UA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=dHv3ApjLk2iqpRL9FmoU:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2E1A33C15; Sun, 25 Aug 2019 22:24:56 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7Q5OtMH055918; Sun, 25 Aug 2019 22:24:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7Q5Osnv055867; Sun, 25 Aug 2019 22:24:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908260524.x7Q5Osnv055867@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: alan somers , Hiroki Sato , Alan Somers , Jan Sucan , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests In-reply-to: <201908260229.x7Q2TMSM074266@gndrsh.dnsmgr.net> References: <201908260229.x7Q2TMSM074266@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Sun, 25 Aug 2019 19:29:22 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 25 Aug 2019 22:24:54 -0700 X-CMAE-Envelope: MS4wfCZRke9oKm27/6pSw+1/3cu5WwLhZ9CUjVuJr+G5d8hZLEKeUvOIXyunGzPokASOSpbLYgWARMqM846PYeFjyJdCJWkKg5tzGwtvHvEGCX0xpDZMVB4w hIin+BkGoodh8NyM+DK+v0S0c/UI7gSMv5pvixI7H9hStiOXFWZhzzrnrWLZ4ZTO/FGqxOZfNBy5dscPM55ciwBif67kydjvbyn7yMZqTztxpTg6pE9OYn0n MsSdNNvVMwKX9VcFDZZTnzbXPcq2u4SAz569lTjJxJHWK48luvxM+nEcrj9YW4qtXkebanM13KFpHrXNd9DjaLEjS5MMR7yNVdjJJiuyktFDAabvcogVlJXz fBJDCEhS X-Rspamd-Queue-Id: 46H0nW0xmBz3Q12 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.9) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.41)[ip: (-6.38), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[9.134.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 05:25:04 -0000 In message <201908260229.x7Q2TMSM074266@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > [ Charset UTF-8 unsupported, converting... ] > > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > > > > > Alan Somers wrote > > > in > : > > > > > > as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: > > > as> > > > > as> > Hi, > > > as> > > > > as> > Alan Somers wrote > > > as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: > > > as> > > > > as> > as> Author: asomers > > > as> > as> Date: Fri Aug 23 15:22:20 2019 > > > as> > as> New Revision: 351423 > > > as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 > > > as> > as> > > > as> > as> Log: > > > as> > as> ping6: Rename options for better consistency with ping > > > as> > as> > > > as> > as> Now equivalent options have the same flags, and nonequivalent > > > options have > > > as> > as> different flags. This is a prelude to merging the two > > > commands. > > > as> > as> > > > as> > as> Submitted by: J?n Su?an > > > as> > as> MFC: Never > > > as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) > > > as> > as> Differential Revision: https://reviews.freebsd.org/D21345 > > > as> > > > > as> > I have an objection on renaming the existing option flags in > > > ping6(8) > > > as> > for compatibility with ping(8). > > > as> > > > > as> > Is it sufficient to add INET6 support to ping(8) with consistent > > > as> > flags and keep CLI of ping6(8) backward compatible? People have > > > used > > > as> > ping6(8) for >15 years, so it is too late to rename the flags. I > do > > > as> > not think the renaming is useful if "ping -6 localhost" or "ping > > > ::1" > > > as> > works. > > > as> > > > > as> > -- Hiroki > > > as> > > > as> If ping works with inet6, then why would we want to keep a separate > > > as> tool around? If it's just for the sake of people who don't want to o > r > > > as> can't update scripts, would a version in ports suffice? > > > > > > Because removing (or renaming) it causes a POLA violation. Do we > > > really have a strong, unavoidable reason to force people to rewrite > > > their script now? This is still a fairly essential and actively used > > > tool, not like rcp or rlogin. Although deprecating ping6(8) and > > > removing it from the base system in the future release at some point > > > may work, changing the existing interface will simply confuse people > > > who have used IPv6 for a long time. > > > > > > In my understanding, the purpose to integrate ping(8) and ping6(8) > > > into a single utility is to provide a consistent CLI and reduce > > > duplicate code, not to break compatibility. > > > > > > -- Hiroki > > > > > > > Those goals are incompatible. We can't provide a consistent CLI without > > breaking compatibility because ping and ping6 have conflicting options. > > And we can't keep ping6 around while also removing duplicate code because > > that would be, well, duplicate code. > > Only incompatible in mind. $0 can easily be used to determine which > set of getopt() to process in a single binary that then has unduplicated > code to implement the set of final options. A bit more to code but > should achive the single binary linked by 2 names processing 2 different > option sets executing 1 set of common code. > > I am firmyly in the camp these changes are being made to well estabilish > and probably heavily used utility by both humans and shell scripts. > > I was not happy with the changes to -n, but sat silient on that issue, > with other things being done I need to chime in and say I think that > this is poorly tought out with respect to downstream impact. > > > > > When would be a better time than a major version bump to make a change like > > this? > > > > The lack of a ping6 command in freebsd 13 should serve as a pretty obvious > > reminder that scripts will need updating. I think that putting a version > > of ping6 in ports should be a sufficient crutch for those who need it, > > don't you? > > How does a copy in ports of the old ping6 code "remove duplicate code", > that just changes the location of the duplication out of base where it > shall certainly rot as unmaintained causing numerious consumers heart > ache over time. Ports is a big issue, especially considering we're supporting previous versions of FreeBSD (stable/11 & stable/12) with an inconsistent ping6. Also agreed regarding checking *argv[0] to determine which getopt() to use. While we're at giving ping options some love and attention, shouldn't we also use getopt_long()? It is 2019 for that matter, and almost 2020 in a few months. > > -- > Rod Grimes rgrimes@freebsd.or > g > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Aug 26 06:41:18 2019 Return-Path: Delivered-To: svn-src-head@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 1D1E9D1958; Mon, 26 Aug 2019 06:41:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46H2TT74xXz3y7J; Mon, 26 Aug 2019 06:41:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D608E1EEA; Mon, 26 Aug 2019 06:41:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7Q6fH7g031136; Mon, 26 Aug 2019 06:41:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7Q6fHsb031135; Mon, 26 Aug 2019 06:41:17 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908260641.x7Q6fHsb031135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Aug 2019 06:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351502 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 351502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 06:41:18 -0000 Author: delphij Date: Mon Aug 26 06:41:17 2019 New Revision: 351502 URL: https://svnweb.freebsd.org/changeset/base/351502 Log: Comment boot block checks and perform additional sanity checks: The following checks are now being enforced: - bpbBytesPerSec: only accept 512, 1024, 2048 and 4096. - bpbSecPerClust: only accept 1, 2, 4, 8, 16, 32, 64 and 128. - bpbResSectors: require non-zero. - bpbFATs: require non-zero. - bpbSectors: require zero for FAT32. - bpbFATsmall: require zero for FAT32. - bpbHugeSectors: require non-zero for FAT32. Bail out if the BPB contained values that do not meet these requirements. We also require FATsecs * FATsecs to not overflow 32-bit unsigned integer. Check for backup boot block was removed because the checker does not take corrective action, and msdosfs driver ignores it too. Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Mon Aug 26 00:46:39 2019 (r351501) +++ head/sbin/fsck_msdosfs/boot.c Mon Aug 26 06:41:17 2019 (r351502) @@ -33,6 +33,9 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include + +#include #include #include #include @@ -46,9 +49,7 @@ readboot(int dosfs, struct bootblock *boot) { u_char block[DOSBOOTBLOCKSIZE]; u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; - u_char backup[DOSBOOTBLOCKSIZE]; int ret = FSOK; - int i; if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { perr("could not read boot block"); @@ -64,61 +65,133 @@ readboot(int dosfs, struct bootblock *boot) memset(boot, 0, sizeof *boot); boot->ValidFat = -1; - /* decode bios parameter block */ + /* Decode BIOS Parameter Block */ + + /* Bytes per sector: can only be 512, 1024, 2048 and 4096. */ boot->bpbBytesPerSec = block[11] + (block[12] << 8); + if (boot->bpbBytesPerSec < DOSBOOTBLOCKSIZE_REAL || + boot->bpbBytesPerSec > DOSBOOTBLOCKSIZE || + !powerof2(boot->bpbBytesPerSec)) { + pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); + return FSFATAL; + } + + /* Sectors per cluster: can only be: 1, 2, 4, 8, 16, 32, 64, 128. */ boot->bpbSecPerClust = block[13]; + if (boot->bpbSecPerClust == 0 || !powerof2(boot->bpbSecPerClust)) { + pfatal("Invalid cluster size: %u", boot->bpbSecPerClust); + return FSFATAL; + } + + /* Reserved sectors: must be non-zero */ boot->bpbResSectors = block[14] + (block[15] << 8); + if (boot->bpbResSectors < 1) { + pfatal("Invalid reserved sectors: %u", + boot->bpbResSectors); + return FSFATAL; + } + + /* Number of FATs */ boot->bpbFATs = block[16]; + if (boot->bpbFATs == 0) { + pfatal("Invalid number of FATs: %u", boot->bpbFATs); + return FSFATAL; + } + + /* Root directory entries for FAT12 and FAT16 */ boot->bpbRootDirEnts = block[17] + (block[18] << 8); + if (!boot->bpbRootDirEnts) { + /* bpbRootDirEnts = 0 suggests that we are FAT32 */ + boot->flags |= FAT32; + } + + /* Total sectors (16 bits) */ boot->bpbSectors = block[19] + (block[20] << 8); + if (boot->bpbSectors != 0 && (boot->flags & FAT32)) { + pfatal("Invalid 16-bit total sector count on FAT32: %u", + boot->bpbSectors); + return FSFATAL; + } + + /* Media type: ignored */ boot->bpbMedia = block[21]; + + /* FAT12/FAT16: 16-bit count of sectors per FAT */ boot->bpbFATsmall = block[22] + (block[23] << 8); + if (boot->bpbFATsmall != 0 && (boot->flags & FAT32)) { + pfatal("Invalid 16-bit FAT sector count on FAT32: %u", + boot->bpbFATsmall); + return FSFATAL; + } + + /* Legacy CHS geometry numbers: ignored */ boot->SecPerTrack = block[24] + (block[25] << 8); boot->bpbHeads = block[26] + (block[27] << 8); + + /* Hidden sectors: ignored */ boot->bpbHiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); + + /* Total sectors (32 bits) */ boot->bpbHugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); + if (boot->bpbHugeSectors == 0) { + if (boot->flags & FAT32) { + pfatal("FAT32 with sector count of zero"); + return FSFATAL; + } else if (boot->bpbSectors == 0) { + pfatal("FAT with sector count of zero"); + return FSFATAL; + } + boot->NumSectors = boot->bpbSectors; + } else { + if (boot->bpbSectors != 0) { + pfatal("Invalid FAT sector count"); + return FSFATAL; + } + boot->NumSectors = boot->bpbHugeSectors; + } - boot->FATsecs = boot->bpbFATsmall; - if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE_REAL != 0 || - boot->bpbBytesPerSec / DOSBOOTBLOCKSIZE_REAL == 0) { - pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); - return FSFATAL; - } - if (boot->bpbFATs == 0) { - pfatal("Invalid number of FATs: %u", boot->bpbFATs); - return FSFATAL; - } - if (!boot->bpbRootDirEnts) - boot->flags |= FAT32; + + if (boot->flags & FAT32) { + /* If the OEM Name field is EXFAT, it's not FAT32, so bail */ + if (!memcmp(&block[3], "EXFAT ", 8)) { + pfatal("exFAT filesystem is not supported."); + return FSFATAL; + } + + /* 32-bit count of sectors per FAT */ boot->FATsecs = block[36] + (block[37] << 8) + (block[38] << 16) + (block[39] << 24); + if (block[40] & 0x80) boot->ValidFat = block[40] & 0x0f; - /* check version number: */ + /* FAT32 version, bail out if not 0.0 */ if (block[42] || block[43]) { - /* Correct? XXX */ pfatal("Unknown file system version: %x.%x", block[43], block[42]); return FSFATAL; } + + /* + * Cluster number of the first cluster of root directory. + * + * Should be 2 but do not require it. + */ boot->bpbRootClust = block[44] + (block[45] << 8) + (block[46] << 16) + (block[47] << 24); + + /* Sector number of the FSInfo structure, usually 1 */ boot->bpbFSInfo = block[48] + (block[49] << 8); + + /* Sector number of the backup boot block, ignored */ boot->bpbBackup = block[50] + (block[51] << 8); - /* If the OEM Name field is EXFAT, it's not FAT32, so bail */ - if (!memcmp(&block[3], "EXFAT ", 8)) { - pfatal("exFAT filesystem is not supported."); - return FSFATAL; - } - - /* check basic parameters */ - if ((boot->bpbFSInfo == 0) || (boot->bpbSecPerClust == 0)) { + /* Check basic parameters */ + if (boot->bpbFSInfo == 0) { /* * Either the BIOS Parameter Block has been corrupted, * or this is not a FAT32 filesystem, most likely an @@ -127,6 +200,8 @@ readboot(int dosfs, struct bootblock *boot) pfatal("Invalid FAT32 Extended BIOS Parameter Block"); return FSFATAL; } + + /* Read in and verify the FSInfo block */ if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) != boot->bpbFSInfo * boot->bpbBytesPerSec || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { @@ -164,8 +239,8 @@ readboot(int dosfs, struct bootblock *boot) ret = FSBOOTMOD; } else boot->bpbFSInfo = 0; - } - if (boot->bpbFSInfo) { + } else { + /* We appear to have a valid FSInfo block, decode */ boot->FSFree = fsinfo[0x1e8] + (fsinfo[0x1e9] << 8) + (fsinfo[0x1ea] << 16) + (fsinfo[0x1eb] << 24); @@ -173,45 +248,17 @@ readboot(int dosfs, struct bootblock *boot) + (fsinfo[0x1ee] << 16) + (fsinfo[0x1ef] << 24); } - - if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec, - SEEK_SET) - != boot->bpbBackup * boot->bpbBytesPerSec - || read(dosfs, backup, sizeof backup) != sizeof backup) { - perr("could not read backup bootblock"); - return FSFATAL; - } - backup[65] = block[65]; /* XXX */ - if (memcmp(block + 11, backup + 11, 79)) { - /* - * XXX We require a reference that explains - * that these bytes need to match, or should - * drop the check. gdt@NetBSD has observed - * filesystems that work fine under Windows XP - * and NetBSD that do not match, so the - * requirement is suspect. For now, just - * print out useful information and continue. - */ - pwarn("backup (block %d) mismatch with primary bootblock:\n", - boot->bpbBackup); - for (i = 11; i < 11 + 90; i++) { - if (block[i] != backup[i]) - pwarn("\ti=%d\tprimary 0x%02x\tbackup 0x%02x\n", - i, block[i], backup[i]); - } - } - /* Check backup bpbFSInfo? XXX */ + } else { + /* !FAT32: FAT12/FAT16 */ + boot->FATsecs = boot->bpbFATsmall; } - if (boot->bpbSecPerClust == 0) { - pfatal("Invalid cluster size: %u", boot->bpbSecPerClust); + if (boot->FATsecs > UINT32_MAX / boot->bpbFATs) { + pfatal("Invalid FATs(%u) with FATsecs(%zu)", + boot->bpbFATs, (size_t)boot->FATsecs); return FSFATAL; } - if (boot->bpbSectors) { - boot->bpbHugeSectors = 0; - boot->NumSectors = boot->bpbSectors; - } else - boot->NumSectors = boot->bpbHugeSectors; + boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + boot->bpbBytesPerSec - 1) / boot->bpbBytesPerSec + boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - From owner-svn-src-head@freebsd.org Mon Aug 26 09:10:23 2019 Return-Path: Delivered-To: svn-src-head@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 BA872D5628; Mon, 26 Aug 2019 09:10:23 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46H5nV5BbWz47Px; Mon, 26 Aug 2019 09:10:21 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id EBC278D4A13E; Mon, 26 Aug 2019 08:59:51 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D97D4E7088C; Mon, 26 Aug 2019 08:59:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id VkL5k9jmMkFk; Mon, 26 Aug 2019 08:59:47 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:6cf4:379e:a51d:13c3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id CCDC6E70824; Mon, 26 Aug 2019 08:59:46 +0000 (UTC) From: "Bjoern A. Zeeb" To: "alan somers" Cc: "Hiroki Sato" , "Alan Somers" , "Jan Sucan" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests Date: Mon, 26 Aug 2019 08:59:45 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: <4D99F70B-5BFD-447A-B833-D4F73CEECFF2@lists.zabbadoz.net> In-Reply-To: References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46H5nV5BbWz47Px X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 195.201.62.131 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-4.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.11)[ipnet: 195.201.0.0/16(-3.75), asn: 24940(-1.79), country: DE(-0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 09:10:23 -0000 On 25 Aug 2019, at 20:26, alan somers wrote: > On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: > >> Alan Somers wrote >> in >> : >> >> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato >> wrote: >> as> > >> as> > Hi, >> as> > >> as> > Alan Somers wrote >> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: >> as> > >> as> > as> Author: asomers >> as> > as> Date: Fri Aug 23 15:22:20 2019 >> as> > as> New Revision: 351423 >> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 >> as> > as> >> as> > as> Log: >> as> > as> ping6: Rename options for better consistency with ping >> as> > as> >> as> > as> Now equivalent options have the same flags, and >> nonequivalent >> options have >> as> > as> different flags. This is a prelude to merging the two >> commands. >> as> > as> >> as> > as> Submitted by: Ján Sučan >> as> > as> MFC: Never >> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) >> as> > as> Differential Revision: >> https://reviews.freebsd.org/D21345 >> as> > >> as> > I have an objection on renaming the existing option flags in >> ping6(8) >> as> > for compatibility with ping(8). >> as> > >> as> > Is it sufficient to add INET6 support to ping(8) with >> consistent >> as> > flags and keep CLI of ping6(8) backward compatible? People >> have >> used >> as> > ping6(8) for >15 years, so it is too late to rename the flags. >> I do >> as> > not think the renaming is useful if "ping -6 localhost" or >> "ping >> ::1" >> as> > works. >> as> > >> as> > -- Hiroki >> as> >> as> If ping works with inet6, then why would we want to keep a >> separate >> as> tool around? If it's just for the sake of people who don't want >> to or >> as> can't update scripts, would a version in ports suffice? >> >> Because removing (or renaming) it causes a POLA violation. Do we >> really have a strong, unavoidable reason to force people to rewrite >> their script now? This is still a fairly essential and actively >> used >> tool, not like rcp or rlogin. Although deprecating ping6(8) and >> removing it from the base system in the future release at some point >> may work, changing the existing interface will simply confuse people >> who have used IPv6 for a long time. >> >> In my understanding, the purpose to integrate ping(8) and ping6(8) >> into a single utility is to provide a consistent CLI and reduce >> duplicate code, not to break compatibility. >> >> -- Hiroki >> > > Those goals are incompatible. We can't provide a consistent CLI > without > breaking compatibility because ping and ping6 have conflicting > options. > And we can't keep ping6 around while also removing duplicate code > because > that would be, well, duplicate code. > > When would be a better time than a major version bump to make a change > like > this? > > The lack of a ping6 command in freebsd 13 should serve as a pretty > obvious > reminder that scripts will need updating. I think that putting a > version > of ping6 in ports should be a sufficient crutch for those who need it, > don't you? No. I have systems without ping as I have systems without any INET support. We do use ping(though not ping6 yet imho) in startup scripts so we consider it essential to the base system. If you migrate ping6 into ping the first thing I’ll want to be able is to compile one or the other address family out and that’ll basically give me the same we have today + a name change I have to deal with unless argv[0] tricks and a hardlink are done. (Hint: if you make the compile out happen, deal with the fact that ping and ping6 can be there without the hardlink to the other — a bit of Makefile glue — and migrate it all in based on argv[0], I think I can be happy). In other notes (and I keep saying that), I can see a world when ping doesn’t exist anymore as IPv4 doesn’t exist anymore (I partially already live in that world). The fact that people still do not prepare themselves for this time is a bit strange to me as by the time FreeBSD 14 is still in support this IPv6-only world might very well happen for a majority of people. And FreeBSD 14-CURRENT really is only a year away now. So breaking what’s been good for almost 20 years now for a few more years doesn’t really seem to be worth to me. Just my 2cts, Bjoern From owner-svn-src-head@freebsd.org Mon Aug 26 10:16:47 2019 Return-Path: Delivered-To: svn-src-head@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 46004D6C9F; Mon, 26 Aug 2019 10:16: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 46H7G70tY8z4Bp5; Mon, 26 Aug 2019 10:16: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 EFDAF48ED; Mon, 26 Aug 2019 10:16:46 +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 x7QAGkYv061465; Mon, 26 Aug 2019 10:16:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QAGkU4061464; Mon, 26 Aug 2019 10:16:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908261016.x7QAGkU4061464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 26 Aug 2019 10:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351508 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 351508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 10:16:47 -0000 Author: trasz Date: Mon Aug 26 10:16:46 2019 New Revision: 351508 URL: https://svnweb.freebsd.org/changeset/base/351508 Log: .Xr ports(7) and development(7). MFC after: 2 weeks Modified: head/share/man/man7/development.7 head/share/man/man7/ports.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Mon Aug 26 09:29:14 2019 (r351507) +++ head/share/man/man7/development.7 Mon Aug 26 10:16:46 2019 (r351508) @@ -163,6 +163,7 @@ make -sj8 kernel KERNFAST=1 DESTDIR=/clients/arm .Xr witness 4 , .Xr build 7 , .Xr hier 7 , +.Xr ports 7 , .Xr release 7 , .Xr locking 9 , .Xr style 9 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Aug 26 09:29:14 2019 (r351507) +++ head/share/man/man7/ports.7 Mon Aug 26 10:16:46 2019 (r351508) @@ -617,6 +617,7 @@ is going to be built with Python 3.7 support.) .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , +.Xr development 7 , .Xr pkg 7 , .Xr portsnap 8 .Pp From owner-svn-src-head@freebsd.org Mon Aug 26 10:18:20 2019 Return-Path: Delivered-To: svn-src-head@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 28BADD6D37; Mon, 26 Aug 2019 10:18:20 +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 46H7Hw08MQz4Bxl; Mon, 26 Aug 2019 10:18:20 +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 DAAFC48EE; Mon, 26 Aug 2019 10:18:19 +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 x7QAIJho061579; Mon, 26 Aug 2019 10:18:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QAIJi1061578; Mon, 26 Aug 2019 10:18:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908261018.x7QAIJi1061578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 26 Aug 2019 10:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351509 - head/usr.bin/ktrace X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/ktrace X-SVN-Commit-Revision: 351509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 10:18:20 -0000 Author: trasz Date: Mon Aug 26 10:18:19 2019 New Revision: 351509 URL: https://svnweb.freebsd.org/changeset/base/351509 Log: Make it clear what the userland traces are in the ktrace(1) man page. MFC after: 2 weeks Modified: head/usr.bin/ktrace/ktrace.1 Modified: head/usr.bin/ktrace/ktrace.1 ============================================================================== --- head/usr.bin/ktrace/ktrace.1 Mon Aug 26 10:16:46 2019 (r351508) +++ head/usr.bin/ktrace/ktrace.1 Mon Aug 26 10:18:19 2019 (r351509) @@ -28,7 +28,7 @@ .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 24, 2017 +.Dd August 26, 2019 .Dt KTRACE 1 .Os .Sh NAME @@ -130,7 +130,8 @@ trace signal processing .It Cm t trace various structures .It Cm u -userland traces +userland traces generated by +.Xr utrace 2 .It Cm w context switches .It Cm y @@ -184,7 +185,8 @@ Disable tracing of all user-owned processes: .Xr dtrace 1 , .Xr kdump 1 , .Xr truss 1 , -.Xr ktrace 2 +.Xr ktrace 2 , +.Xr utrace 2 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Mon Aug 26 10:47:49 2019 Return-Path: Delivered-To: svn-src-head@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 5A8FCD76AA for ; Mon, 26 Aug 2019 10:47:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 46H7xw1gjHz4DXx for ; Mon, 26 Aug 2019 10:47:48 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x72d.google.com with SMTP id m10so13621897qkk.1 for ; Mon, 26 Aug 2019 03:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mx9nf31lrxEqn3Juf4X7wXJzCmO/IHQZjEJRDOmvchA=; b=a6ijpnV82B4dS8R3rRoqG4wYmFTWmY3IkVubkNar2u5lBMxnac57mASX+K+jMYyXkD FhOX9WGY0ehLebp9iNU3hU6CqQuNBYnMU6UnbToN1NNXIvBRYN234TuZSCgtEJc04vmF w7Oznl5Nf4qiJeH/AtTvvTN0OJHBjmIYYUx6OMqiGPocuc9hLg2bLJbJDBs+NEWadqXy QSup3aQxjexIjKvdQvOlTIecbT4O7hY16rroJHW15uBXd7otgzqhRscfelkQgglbCPp/ HNph6yW2dymJRwG/cnuPKNj42c7HwFfkWc/87xBmC+470VdvXdlYIbJgs8GnU48W9k40 K8bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mx9nf31lrxEqn3Juf4X7wXJzCmO/IHQZjEJRDOmvchA=; b=LwGWJQRKU/PLQtCUERFWCbW3YLG9gLyxNf+LW0SDWwDZNhTcmcJj7ctso6pnpSjD1W CwvF+DN2vt9axSL/x+RNwIqv/GgHAjGKN4do8L3P8X6zL/zw0QMgy5GWI5t/XsRuRodf +ejWLRtSE+Gi5IihsOjK7l3UNG7ApaUSL8WabgkgKvj83QIdYy55Qgur2OcIU7lqrcz5 0LKdMhC0N45uRGTX1FHjxA/F1LNcZ/SYiz+inMKjQbGbAd2ev8EeiVGqIKaTib9xud9N D9kcVtJbNdw4xT70sq5rVd6CST5jAbQYn53bGbL5AjUR8DIz+hJvlCgpobbJvmvlx2Wk tdPw== X-Gm-Message-State: APjAAAUHJU+0ZRMK0UQm37g/0hpiMTUxpAERD0hqQASZngBn/FEW5oAd YRrecorrzQzcBEeY4Bja8Msx53FBVog= X-Google-Smtp-Source: APXvYqyP7LJt15A22HQSEgx0nEjB4dcHW2C6zqR78W+CeQkpjdv+j/12YDo9I3757thMplBE4vOMiw== X-Received: by 2002:ae9:e916:: with SMTP id x22mr15751087qkf.296.1566816466648; Mon, 26 Aug 2019 03:47:46 -0700 (PDT) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id a135sm5858699qkg.72.2019.08.26.03.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 03:47:45 -0700 (PDT) Date: Mon, 26 Aug 2019 06:47:45 -0400 From: Shawn Webb To: Conrad Meyer Cc: svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests Message-ID: <20190826104745.yykfnboikehj6yxn@mutt-hbsd> References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826014726.mwddt4uwqoulewhh@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x3loc3dl7k4nv76w" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46H7xw1gjHz4DXx X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=a6ijpnV8; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::72d as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-8.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; RCVD_IN_DNSWL_NONE(0.00)[d.2.7.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]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.93)[ip: (-9.39), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.33), country: US(-0.05)]; RECEIVED_SPAMHAUS_PBL(0.00)[239.118.196.151.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 10:47:49 -0000 --x3loc3dl7k4nv76w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 25, 2019 at 08:50:11PM -0700, Conrad Meyer wrote: > On Sun, Aug 25, 2019 at 6:47 PM Shawn Webb w= rote: > > I wonder if something like this could be done: >=20 > Something like it could be; I suggested so two hours ago. >=20 > > Somewhere in ping(8): > > bool ping6_compat; > > if (strcmp(argv[0], "ping6")) { > > ping6_compat =3D true; >=20 > You've gotten the sense of the basic C89 function strcmp() backwards. > Maybe it's a security feature that way? You can add HardenedStrcmp to > your Easy Feature Comparison page. I'll keep that in mind should FreeBSD implement it, enabling us to adopt it. :) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --x3loc3dl7k4nv76w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl1juMsACgkQ/y5nonf4 4fqsNQ/+KMEhgzIhHK+khIhIoMAiLCArrjt9PUr8u+fFPM+LZ9XaaledMnpaa+0J kEqWVLUyXM/h35gU5bgKcMHLTntpjITdBoq9E/KpnjNVfRRx6QmHIae3a/hvSDDH UOlKgo/2qi713sTysQ+Jb5w8UVMNdyP6b3omTkBRx6tK13q0dJNfNPHRclOHRC9d WovgNOiwwAZP7MibWGFeN8367JjDuWsD3vLj9O17Sf5crK2FDDJ3xrb1qHttvcmB k1cTdwSwBn2qx3umwv7DHuAcVAswQQ+71Sh7Ldhk/zIaP1a9qNyO51wEnY1+sEGU 6k4k2gaA0gGOn3P68Z+s1tZt7qsJm1+OIs/J5rRzbga5yE9pFFekgHnbEMHEsGaX Ie3CYyobDg/6gzkGfl2OmQa+IjqJRwFKsIqxz7tA3cxCQvqGQs3pjTUuV89ySmRT qQCjCCtuKoxWuIU5PEDGe6yKFaRFG4RY1hiUJorLb1OILpaU1bLB74sdai2SJNow 3TtByvYqZBT2tmJwBw3oZ/8fviTajuVWNr2W7kGHHQFSzojovJz8pJgvgVz0F/si Ww7QAfzwJ4LaX+F7LT7a332Sg+O3hhBlw3fPnpqBHrtMjxe62XaNOGiZtkcrTT+f K7kMaMSF3Qwif/rVO5o5EIefg/E1PZ1xipFqejZZkenlNsZIHtA= =FVCC -----END PGP SIGNATURE----- --x3loc3dl7k4nv76w-- From owner-svn-src-head@freebsd.org Mon Aug 26 13:18:29 2019 Return-Path: Delivered-To: svn-src-head@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 F3E3CDBAAC; Mon, 26 Aug 2019 13:18:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HCHl6jWbz4Qhc; Mon, 26 Aug 2019 13:18:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2Et5iXohaUIS22Et7ioCkU; Mon, 26 Aug 2019 07:18:25 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=FmdZ9Uzk2mMA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=1jjyFtX1wCNYCS2Dt-UA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [IPv6:2605:8d80:405:4266:152f:7238:2e01:55c7] (unknown [72.143.220.104]) by spqr.komquats.com (Postfix) with ESMTPSA id EAABB152; Mon, 26 Aug 2019 06:18:22 -0700 (PDT) Date: Mon, 26 Aug 2019 06:17:57 -0700 In-Reply-To: <201908250513.x7P5DFFx017824@repo.freebsd.org> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> X-CMAE-Envelope: MS4wfGPaZVSnU2Fglh/jm5hdyR2pMJju+aclvWYEHb0sSIzB+0obTyD0U3BMctTLTuAMYSSZLbdPoFg4Ztf5OB4YAdkbb1/jpkIgkmWF8LI23A8jmaU6JhvL xLrWcrMFsa4w6/eFzZuPFSf1wWFi0Lnhn2IIIIFfOtoi1EYJYWr5cHoSAUnxof6O+gxQXAq/P27T6FMyzczkdR+pCQOB1gRD9EqvXSzRTaPWRrFCMIYbFZKP InYglfP82NXugUwzEmRf/01Gv1D8thAdiyzVQof2lMWmxLRogHd5uJfeD42ZQJPN X-Rspamd-Queue-Id: 46HCHl6jWbz4Qhc X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.12) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.45)[ip: (-6.57), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; RCVD_IN_DNSWL_NONE(0.00)[12.134.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 13:18:29 -0000 On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik wrote= : >Author: mjg >Date: Sun Aug 25 05:13:15 2019 >New Revision: 351472 >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/351472 > >Log: > nullfs: reduce areas protected by vnode interlock > =20 >Some places only take the interlock to hold the vnode, which was a >requiremnt >before they started being manipulated with atomics=2E Use the newly >introduced > vholdnz to bump the count=2E > =20 > Reviewed by: kib > Tested by: pho > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews=2Efreebsd=2Eorg/D21358 > >Modified: > head/sys/fs/nullfs/null_vnops=2Ec > >Modified: head/sys/fs/nullfs/null_vnops=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >--- head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:11:43 2019 (r351471) >+++ head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:13:15 2019 (r351472) >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > * We prevent it from being recycled by holding the vnode > * here=2E > */ >- vholdl(lvp); >+ vholdnz(lvp); > error =3D VOP_LOCK(lvp, flags); >=20 > /* >@@ -710,31 +710,16 @@ static int > null_unlock(struct vop_unlock_args *ap) > { > struct vnode *vp =3D ap->a_vp; >- int flags =3D ap->a_flags; >- int mtxlkflag =3D 0; > struct null_node *nn; > struct vnode *lvp; > int error; >=20 >- if ((flags & LK_INTERLOCK) !=3D 0) >- mtxlkflag =3D 1; >- else if (mtx_owned(VI_MTX(vp)) =3D=3D 0) { >- VI_LOCK(vp); >- mtxlkflag =3D 2; >- } > nn =3D VTONULL(vp); > if (nn !=3D NULL && (lvp =3D NULLVPTOLOWERVP(vp)) !=3D NULL) { >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); >- flags |=3D LK_INTERLOCK; >- vholdl(lvp); >- VI_UNLOCK(vp); >- error =3D VOP_UNLOCK(lvp, flags); >+ vholdnz(lvp); >+ error =3D VOP_UNLOCK(lvp, 0); > vdrop(lvp); >- if (mtxlkflag =3D=3D 0) >- VI_LOCK(vp); > } else { >- if (mtxlkflag =3D=3D 2) >- VI_UNLOCK(vp); > error =3D vop_stdunlock(ap); > } >=20 >@@ -845,10 +830,8 @@ null_getwritemount(struct vop_getwritemount_args >*ap) > VI_LOCK(vp); > xp =3D VTONULL(vp); > if (xp && (lowervp =3D xp->null_lowervp)) { >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); >+ vholdnz(lowervp); > VI_UNLOCK(vp); >- vholdl(lowervp); >- VI_UNLOCK(lowervp); > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > vdrop(lowervp); > } else { Hi mjg@, This causes trap 12 a few seconds after mountlate during boot=2E Reverting= this commit allowed it to boot=2E Sorry for no backtrace=2E I managed to=20 revert and test just prior to rushing out to catch the bus, with no time = to craft a proper email=2E I'll post the backtrace when I arrive at work=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Aug 26 14:11:30 2019 Return-Path: Delivered-To: svn-src-head@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 00D55DCDC5; Mon, 26 Aug 2019 14:11:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HDSw58Zqz4TWD; Mon, 26 Aug 2019 14:11:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2FiNil8tzSrVc2FiOilMVg; Mon, 26 Aug 2019 08:11:26 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=7QqoLyUhOw1ptgkwiHYA:9 a=xijKLwi-kJkXrt_u:21 a=0210p9udBa2dCv46:21 a=bB0jzgBmlxtydUqe:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 3F53F1EB; Mon, 26 Aug 2019 07:11:23 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7QEBMCg075357; Mon, 26 Aug 2019 07:11:22 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7QEBMWi075354; Mon, 26 Aug 2019 07:11:22 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908261411.x7QEBMWi075354@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Cy.Schubert@cschubert.com Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> Comments: In-reply-to Cy Schubert message dated "Mon, 26 Aug 2019 06:17:57 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 07:11:22 -0700 X-CMAE-Envelope: MS4wfCk0FJ9/AhnkKurZKtxFe5VdCiNOOXUaTCM7f1x7Cn6KQ48J5WSkLWc51joeDCL1vOxaElKMmJhLqNmpTNBC1T0Ahx8aplU4nIWG9pTBwyLwRfxyobjD OcMIZZl06eSUhB9ctGhLs2FFii+RGzaSBTREJY2B8kB7PkZPEkdE7tmB4n5l/0A+1z0KQEYi+AzAZkBi3BeXRV2us9Xz8QerlBxemRXQM6ctUDJmmHMwK6sa 7HnfTSKXSw4CJqcmJX2o9CVu/a3Jo504a1FI5+bIXz28psdZ6H60zhMn5B9PhCed X-Rspamd-Queue-Id: 46HDSw58Zqz4TWD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.90 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; RCVD_IN_DNSWL_NONE(0.00)[137.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.33)[ip: (-5.97), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 14:11:30 -0000 In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy Schubert wr ites: > On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik wrote: > >Author: mjg > >Date: Sun Aug 25 05:13:15 2019 > >New Revision: 351472 > >URL: https://svnweb.freebsd.org/changeset/base/351472 > > > >Log: > > nullfs: reduce areas protected by vnode interlock > > > >Some places only take the interlock to hold the vnode, which was a > >requiremnt > >before they started being manipulated with atomics. Use the newly > >introduced > > vholdnz to bump the count. > > > > Reviewed by: kib > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D21358 > > > >Modified: > > head/sys/fs/nullfs/null_vnops.c > > > >Modified: head/sys/fs/nullfs/null_vnops.c > >============================================================================ > == > >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 2019 (r35147 > 1) > >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 2019 (r35147 > 2) > >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > > * We prevent it from being recycled by holding the vnode > > * here. > > */ > >- vholdl(lvp); > >+ vholdnz(lvp); > > error = VOP_LOCK(lvp, flags); > > > > /* > >@@ -710,31 +710,16 @@ static int > > null_unlock(struct vop_unlock_args *ap) > > { > > struct vnode *vp = ap->a_vp; > >- int flags = ap->a_flags; > >- int mtxlkflag = 0; > > struct null_node *nn; > > struct vnode *lvp; > > int error; > > > >- if ((flags & LK_INTERLOCK) != 0) > >- mtxlkflag = 1; > >- else if (mtx_owned(VI_MTX(vp)) == 0) { > >- VI_LOCK(vp); > >- mtxlkflag = 2; > >- } > > nn = VTONULL(vp); > > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { > >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); > >- flags |= LK_INTERLOCK; > >- vholdl(lvp); > >- VI_UNLOCK(vp); > >- error = VOP_UNLOCK(lvp, flags); > >+ vholdnz(lvp); > >+ error = VOP_UNLOCK(lvp, 0); > > vdrop(lvp); > >- if (mtxlkflag == 0) > >- VI_LOCK(vp); > > } else { > >- if (mtxlkflag == 2) > >- VI_UNLOCK(vp); > > error = vop_stdunlock(ap); > > } > > > >@@ -845,10 +830,8 @@ null_getwritemount(struct vop_getwritemount_args > >*ap) > > VI_LOCK(vp); > > xp = VTONULL(vp); > > if (xp && (lowervp = xp->null_lowervp)) { > >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); > >+ vholdnz(lowervp); > > VI_UNLOCK(vp); > >- vholdl(lowervp); > >- VI_UNLOCK(lowervp); > > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > > vdrop(lowervp); > > } else { > > Hi mjg@, > > This causes trap 12 a few seconds after mountlate during boot. Reverting this > commit allowed it to boot. > > Sorry for no backtrace. I managed to > revert and test just prior to rushing out to catch the bus, with no time to > craft a proper email. I'll post the backtrace when I arrive at work. Hi mjg@, The gory details below. Don't be fooled by the panic when yppasswd is started. I was able to reproduce this panic in single user by simply mounting and using a nullfs. kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0xc fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff806f0633 stack pointer = 0x28:0xfffffe004b3fa7c0 frame pointer = 0x28:0xfffffe004b3fa7e0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = resume, IOPL = 0 current process = 26 (syncer) trap number = 12 panic: page fault cpuid = 0 time = 1566821203 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004b3fa470 vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 panic() at panic+0x43/frame 0xfffffe004b3fa520 trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 --- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp = 0xfffffe004b3fa7e0 --- propagate_priority() at propagate_priority+0x153/frame 0xfffffe004b3fa7e0 turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 __mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame 0xfffffe004b3fa920 vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 3m25s Dumping 921 out of 7974 MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% __curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); (kgdb) #0 __curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 #1 doadump (textdump=1) at /opt/src/svn-current/sys/kern/kern_shutdown.c:392 #2 0xffffffff8068aead in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 #3 0xffffffff8068b369 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 #4 0xffffffff8068b163 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 #5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, eva=12) at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 #6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, usermode=0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 #7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 #8 #9 propagate_priority (td=0xfffff8003e43b000) at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 #10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, owner=, queue=-512) at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 #11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, v=) at /opt/src/svn-current/sys/kern/kern_mutex.c:654 #12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( mvp=0xfffff80002449800, mp=0xfffff80132d1e000, vp=0xfffff80132e4eb40) at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 #13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 #14 0xffffffff80766206 in __mnt_vnode_next_active (mvp=0xfffff80002449800, mp=) at /opt/src/svn-current/sys/kern/vfs_subr.c:5682 #15 vfs_msync (mp=0xfffff80132d1e000, flags=2) at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 #16 0xffffffff8076b4a6 in sync_fsync (ap=) at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 #17 0xffffffff80a7be46 in VOP_FSYNC_APV ( vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) at vnode_if.c:1312 #18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, td=0xfffff800061dc5a0) at ./vnode_if.h:549 #19 sync_vnode (bo=, td=0xfffff800061dc5a0, slp=) at /opt/src/svn-current/sys/kern/vfs_subr.c:2316 #20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 #21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 , arg=0x0, frame=0xfffffe004b3faac0) at /opt/src/svn-current/sys/kern/kern_fork.c:1045 #22 dmesg output: Updating motd:. Mounting late filesystems:. Starting nscd. Security policy loaded: MAC/ntpd (mac_ntpd) Starting ntpd. Starting yppasswdd. kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0xc fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff806f0633 stack pointer = 0x28:0xfffffe004b7fa7c0 frame pointer = 0x28:0xfffffe004b7fa7e0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = resume, IOPL = 0 current process = 26 (syncer) trap number = 12 panic: page fault cpuid = 0 time = 1566820700 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004b7fa470 vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 panic() at panic+0x43/frame 0xfffffe004b7fa520 trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 --- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp = 0xfffffe004b7fa7e0 --- propagate_priority() at propagate_priority+0x153/frame 0xfffffe004b7fa7e0 turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 __mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame 0xfffffe004b7fa920 vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 1m38s Dumping 810 out of 7974 MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Aug 26 15:41:21 2019 Return-Path: Delivered-To: svn-src-head@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 48DAEDE7ED; Mon, 26 Aug 2019 15:41:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HGSb5zDzz4YyT; Mon, 26 Aug 2019 15:41:19 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2H7LimLlZSrVc2H7MileVg; Mon, 26 Aug 2019 09:41:17 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=XMxNKzTx4BUYNsliDvEA:9 a=fvwWC_t7I1q_Dfr2:21 a=zAa2iZ8Va_Uz8Il7:21 a=8HBsMUk44bn0z0wV:21 a=QEXdDO2ut3YA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from 5CG5030TVK-N.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 459ED190; Mon, 26 Aug 2019 08:41:14 -0700 (PDT) Date: Mon, 26 Aug 2019 08:40:50 -0700 In-Reply-To: <201908261411.x7QEBMWi075354@slippy.cwsent.com> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Mateusz Guzik CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfLiAzcR+5nM2MQHtiPUltKYdtAOo5ZOFiilxjJyi2c73dnJzJASGdhfdOEWMdnuoEO4N9WuG8rAkx4x+Bj10yAFgd2WDFEDQRy+20+KicAlfExXXiIxP LffHbh8FwvHWX3XwCD0AADc2XJVlQxywcQl47+RdifUrT0tfckdPWj6mRwNRdguZe+GapZcmPfSjQFMo02Fp7hivEgWj3gAv3xV5GVK8cBdaa9tBdQRfbIjN WHllncU4o4F6fU+X0ZE2bD9SDTAggraUWLkIgAXDkfize23gyiyfA7+t9zeYapK5 X-Rspamd-Queue-Id: 46HGSb5zDzz4YyT X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-5.38 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.33)[ip: (-5.97), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; RCVD_IN_DNSWL_NONE(0.00)[137.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11, 233.154.66.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 15:41:21 -0000 On August 26, 2019 7:11:22 AM PDT, Cy Schubert wrote: >In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert=2Ecom>, Cy >Schubert wr >ites: >> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik >wrote: >> >Author: mjg >> >Date: Sun Aug 25 05:13:15 2019 >> >New Revision: 351472 >> >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/351472 >> > >> >Log: >> > nullfs: reduce areas protected by vnode interlock >> > =20 >> >Some places only take the interlock to hold the vnode, which was a >> >requiremnt >> >before they started being manipulated with atomics=2E Use the newly >> >introduced >> > vholdnz to bump the count=2E >> > =20 >> > Reviewed by: kib >> > Tested by: pho >> > Sponsored by: The FreeBSD Foundation >> > Differential Revision: https://reviews=2Efreebsd=2Eorg/D21358 >> > >> >Modified: >> > head/sys/fs/nullfs/null_vnops=2Ec >> > >> >Modified: head/sys/fs/nullfs/null_vnops=2Ec >> >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >> =3D=3D >> >--- head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:11:43 2019 (r35147 >> 1) >> >+++ head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:13:15 2019 (r35147 >> 2) >> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) >> > * We prevent it from being recycled by holding the vnode >> > * here=2E >> > */ >> >- vholdl(lvp); >> >+ vholdnz(lvp); >> > error =3D VOP_LOCK(lvp, flags); >> >=20 >> > /* >> >@@ -710,31 +710,16 @@ static int >> > null_unlock(struct vop_unlock_args *ap) >> > { >> > struct vnode *vp =3D ap->a_vp; >> >- int flags =3D ap->a_flags; >> >- int mtxlkflag =3D 0; >> > struct null_node *nn; >> > struct vnode *lvp; >> > int error; >> >=20 >> >- if ((flags & LK_INTERLOCK) !=3D 0) >> >- mtxlkflag =3D 1; >> >- else if (mtx_owned(VI_MTX(vp)) =3D=3D 0) { >> >- VI_LOCK(vp); >> >- mtxlkflag =3D 2; >> >- } >> > nn =3D VTONULL(vp); >> > if (nn !=3D NULL && (lvp =3D NULLVPTOLOWERVP(vp)) !=3D NULL) { >> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); >> >- flags |=3D LK_INTERLOCK; >> >- vholdl(lvp); >> >- VI_UNLOCK(vp); >> >- error =3D VOP_UNLOCK(lvp, flags); >> >+ vholdnz(lvp); >> >+ error =3D VOP_UNLOCK(lvp, 0); >> > vdrop(lvp); >> >- if (mtxlkflag =3D=3D 0) >> >- VI_LOCK(vp); >> > } else { >> >- if (mtxlkflag =3D=3D 2) >> >- VI_UNLOCK(vp); >> > error =3D vop_stdunlock(ap); >> > } >> >=20 >> >@@ -845,10 +830,8 @@ null_getwritemount(struct >vop_getwritemount_args >> >*ap) >> > VI_LOCK(vp); >> > xp =3D VTONULL(vp); >> > if (xp && (lowervp =3D xp->null_lowervp)) { >> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); >> >+ vholdnz(lowervp); >> > VI_UNLOCK(vp); >> >- vholdl(lowervp); >> >- VI_UNLOCK(lowervp); >> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); >> > vdrop(lowervp); >> > } else { >> >> Hi mjg@, >> >> This causes trap 12 a few seconds after mountlate during boot=2E >Reverting this >> commit allowed it to boot=2E >> >> Sorry for no backtrace=2E I managed to=20 >> revert and test just prior to rushing out to catch the bus, with no >time to=20 >> craft a proper email=2E I'll post the backtrace when I arrive at work= =2E > >Hi mjg@, > >The gory details below=2E Don't be fooled by the panic when yppasswd is >started=2E I was able to reproduce this panic in single user by simply >mounting and using a nullfs=2E > >kernel trap 12 with interrupts disabled > > >Fatal trap 12: page fault while in kernel mode >cpuid =3D 0; apic id =3D 00 >fault virtual address =3D 0xc >fault code =3D supervisor read data, page not present >instruction pointer =3D 0x20:0xffffffff806f0633 >stack pointer =3D 0x28:0xfffffe004b3fa7c0 >frame pointer =3D 0x28:0xfffffe004b3fa7e0 >code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 >processor eflags =3D resume, IOPL =3D 0 >current process =3D 26 (syncer) >trap number =3D 12 >panic: page fault >cpuid =3D 0 >time =3D 1566821203 >KDB: stack backtrace: >db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >0xfffffe004b3fa470 >vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 >panic() at panic+0x43/frame 0xfffffe004b3fa520 >trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 >trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 >trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 >calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 >--- trap 0xc, rip =3D 0xffffffff806f0633, rsp =3D 0xfffffe004b3fa7c0, rbp= =3D >0xfffffe004b3fa7e0 --- >propagate_priority() at propagate_priority+0x153/frame >0xfffffe004b3fa7e0 >turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 >__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 >mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >0xfffffe004b3fa920 >vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 >sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 >VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 >sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 >fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 >fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 >--- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- >Uptime: 3m25s >Dumping 921 out of 7974 >MB:=2E=2E2%=2E=2E11%=2E=2E21%=2E=2E32%=2E=2E42%=2E=2E51%=2E=2E61%=2E=2E72= %=2E=2E82%=2E=2E91% > >__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu=2Eh:246 >246 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" >(OFFSETOF_CURTHREAD)); >(kgdb) #0 __curthread () at >/opt/src/svn-current/sys/amd64/include/pcpu=2Eh:246 >#1 doadump (textdump=3D1) at >/opt/src/svn-current/sys/kern/kern_shutdown=2Ec:392 >#2 0xffffffff8068aead in kern_reboot (howto=3D260) > at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:479 >#3 0xffffffff8068b369 in vpanic (fmt=3D, ap=3Dout>) > at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:905 >#4 0xffffffff8068b163 in panic (fmt=3D) > at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:832 >#5 0xffffffff80a11c2c in trap_fatal (frame=3D0xfffffe004b3fa700, eva=3D1= 2) > at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:943 >#6 0xffffffff80a11c79 in trap_pfault (frame=3D0xfffffe004b3fa700, >usermode=3D0) > at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:767 >#7 0xffffffff80a1126d in trap (frame=3D0xfffffe004b3fa700) > at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:443 >#8 >#9 propagate_priority (td=3D0xfffff8003e43b000) > at /opt/src/svn-current/sys/kern/subr_turnstile=2Ec:279 >#10 0xffffffff806f13db in turnstile_wait (ts=3D0xfffff8000258a780,=20 > owner=3D, queue=3D-512) > at /opt/src/svn-current/sys/kern/subr_turnstile=2Ec:785 >#11 0xffffffff80669271 in __mtx_lock_sleep (c=3D0xfffff80132e4ebf0,=20 > v=3D) at /opt/src/svn-current/sys/kern/kern_mutex=2Ec:6= 54 >#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( > mvp=3D0xfffff80002449800, mp=3D0xfffff80132d1e000, vp=3D0xfffff80132e4e= b40) > at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:5590 >#13 mnt_vnode_next_active (mvp=3D, mp=3D0xfffff80132d1e000= ) > at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:5649 >#14 0xffffffff80766206 in __mnt_vnode_next_active >(mvp=3D0xfffff80002449800,=20 > mp=3D) at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:56= 82 >#15 vfs_msync (mp=3D0xfffff80132d1e000, flags=3D2) > at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:4238 >#16 0xffffffff8076b4a6 in sync_fsync (ap=3D) > at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:4468 >#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( > vop=3D0xffffffff80cb4120 , a=3D0xfffffe004b3faa08) > at vnode_if=2Ec:1312 >#18 0xffffffff80769319 in VOP_FSYNC (vp=3D, waitfor=3D3,= =20 > td=3D0xfffff800061dc5a0) at =2E/vnode_if=2Eh:549 >#19 sync_vnode (bo=3D, td=3D0xfffff800061dc5a0,=20 > slp=3D) at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:23= 16 >#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:2418 >#21 0xffffffff80647e33 in fork_exit (callout=3D0xffffffff80768fa0 >,=20 > arg=3D0x0, frame=3D0xfffffe004b3faac0) > at /opt/src/svn-current/sys/kern/kern_fork=2Ec:1045 >#22 > > >dmesg output: > >Updating motd:=2E >Mounting late filesystems:=2E >Starting nscd=2E >Security policy loaded: MAC/ntpd (mac_ntpd) >Starting ntpd=2E >Starting yppasswdd=2E >kernel trap 12 with interrupts disabled > > >Fatal trap 12: page fault while in kernel mode >cpuid =3D 0; apic id =3D 00 >fault virtual address =3D 0xc >fault code =3D supervisor read data, page not present >instruction pointer =3D 0x20:0xffffffff806f0633 >stack pointer =3D 0x28:0xfffffe004b7fa7c0 >frame pointer =3D 0x28:0xfffffe004b7fa7e0 >code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 >processor eflags =3D resume, IOPL =3D 0 >current process =3D 26 (syncer) >trap number =3D 12 >panic: page fault >cpuid =3D 0 >time =3D 1566820700 >KDB: stack backtrace: >db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >0xfffffe004b7fa470 >vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 >panic() at panic+0x43/frame 0xfffffe004b7fa520 >trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 >trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 >trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 >calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 >--- trap 0xc, rip =3D 0xffffffff806f0633, rsp =3D 0xfffffe004b7fa7c0, rbp= =3D >0xfffffe004b7fa7e0 --- >propagate_priority() at propagate_priority+0x153/frame >0xfffffe004b7fa7e0 >turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 >__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 >mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >0xfffffe004b7fa920 >vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 >sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 >--- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- >Uptime: 1m38s >Dumping 810 out of 7974 >MB:=2E=2E2%=2E=2E12%=2E=2E22%=2E=2E32%=2E=2E42%=2E=2E52%=2E=2E62%=2E=2E72= %=2E=2E81%=2E=2E91%---<>--- This may be a simple case of increasing the kernel stack=2E I'll try this = at noon=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Aug 26 16:12:15 2019 Return-Path: Delivered-To: svn-src-head@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 7F52BDF271; Mon, 26 Aug 2019 16:12:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46HH8H2nMsz4bVZ; Mon, 26 Aug 2019 16:12:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BFA89F1; Mon, 26 Aug 2019 16:12:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7QGCFDk079251; Mon, 26 Aug 2019 16:12:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QGCEOR079250; Mon, 26 Aug 2019 16:12:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908261612.x7QGCEOR079250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 26 Aug 2019 16:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351511 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 351511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 16:12:15 -0000 Author: tuexen Date: Mon Aug 26 16:12:14 2019 New Revision: 351511 URL: https://svnweb.freebsd.org/changeset/base/351511 Log: Identify eMAG CPU used in Ampere Computing systems. Reviewed by: emaste@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21314 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Aug 26 15:21:29 2019 (r351510) +++ head/sys/arm64/arm64/identcpu.c Mon Aug 26 16:12:14 2019 (r351511) @@ -168,6 +168,12 @@ static const struct cpu_parts cpu_parts_cavium[] = { CPU_PART_NONE, }; +/* APM / Ampere */ +static const struct cpu_parts cpu_parts_apm[] = { + { CPU_PART_EMAG8180, "eMAG 8180" }, + CPU_PART_NONE, +}; + /* Unknown */ static const struct cpu_parts cpu_parts_none[] = { CPU_PART_NONE, @@ -184,7 +190,7 @@ const struct cpu_implementers cpu_implementers[] = { { CPU_IMPL_INFINEON, "IFX", cpu_parts_none }, { CPU_IMPL_FREESCALE, "Freescale", cpu_parts_none }, { CPU_IMPL_NVIDIA, "NVIDIA", cpu_parts_none }, - { CPU_IMPL_APM, "APM", cpu_parts_none }, + { CPU_IMPL_APM, "APM", cpu_parts_apm }, { CPU_IMPL_QUALCOMM, "Qualcomm", cpu_parts_none }, { CPU_IMPL_MARVELL, "Marvell", cpu_parts_none }, { CPU_IMPL_INTEL, "Intel", cpu_parts_none }, Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Mon Aug 26 15:21:29 2019 (r351510) +++ head/sys/arm64/include/cpu.h Mon Aug 26 16:12:14 2019 (r351511) @@ -100,6 +100,9 @@ #define CPU_REV_THUNDERX2_0 0x00 +/* APM / Ampere Part Number */ +#define CPU_PART_EMAG8180 0x000 + #define CPU_IMPL(midr) (((midr) >> 24) & 0xff) #define CPU_PART(midr) (((midr) >> 4) & 0xfff) #define CPU_VAR(midr) (((midr) >> 20) & 0xf) From owner-svn-src-head@freebsd.org Mon Aug 26 16:23:48 2019 Return-Path: Delivered-To: svn-src-head@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 89130DF659; Mon, 26 Aug 2019 16:23:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46HHPc3B87z4cBF; Mon, 26 Aug 2019 16:23:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BDE88C10; Mon, 26 Aug 2019 16:23:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7QGNm8P085384; Mon, 26 Aug 2019 16:23:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QGNmcv085383; Mon, 26 Aug 2019 16:23:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908261623.x7QGNmcv085383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 26 Aug 2019 16:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351512 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 351512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 16:23:48 -0000 Author: tuexen Date: Mon Aug 26 16:23:47 2019 New Revision: 351512 URL: https://svnweb.freebsd.org/changeset/base/351512 Log: Don't hold the rs_mtx lock while calling malloc(). Reviewed by: rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21416 Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c ============================================================================== --- head/sys/netinet/tcp_ratelimit.c Mon Aug 26 16:12:14 2019 (r351511) +++ head/sys/netinet/tcp_ratelimit.c Mon Aug 26 16:23:47 2019 (r351512) @@ -390,12 +390,10 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) rs->rs_ifp->if_xname, CTLFLAG_RW, 0, ""); - CK_LIST_INSERT_HEAD(&int_rs, rs, next); - /* Unlock to allow the sysctl stuff to allocate */ - mtx_unlock(&rs_mtx); rl_add_syctl_entries(rl_sysctl_root, rs); - /* re-lock for our caller */ mtx_lock(&rs_mtx); + CK_LIST_INSERT_HEAD(&int_rs, rs, next); + mtx_unlock(&rs_mtx); return (rs); } else if ((rl.flags & RT_IS_INDIRECT) == RT_IS_INDIRECT) { memset(rs, 0, sizeof(struct tcp_rate_set)); @@ -410,12 +408,10 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) rs->rs_ifp->if_xname, CTLFLAG_RW, 0, ""); - CK_LIST_INSERT_HEAD(&int_rs, rs, next); - /* Unlock to allow the sysctl stuff to allocate */ - mtx_unlock(&rs_mtx); rl_add_syctl_entries(rl_sysctl_root, rs); - /* re-lock for our caller */ mtx_lock(&rs_mtx); + CK_LIST_INSERT_HEAD(&int_rs, rs, next); + mtx_unlock(&rs_mtx); return (rs); } else if ((rl.flags & RT_IS_FIXED_TABLE) == RT_IS_FIXED_TABLE) { /* Mellanox most likely */ @@ -560,7 +556,6 @@ bail: goto bail; } rs_number_alive++; - CK_LIST_INSERT_HEAD(&int_rs, rs, next); sysctl_ctx_init(&rs->sysctl_ctx); rl_sysctl_root = SYSCTL_ADD_NODE(&rs->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_net_inet_tcp_rl), @@ -568,11 +563,10 @@ bail: rs->rs_ifp->if_xname, CTLFLAG_RW, 0, ""); - /* Unlock to allow the sysctl stuff to allocate */ - mtx_unlock(&rs_mtx); rl_add_syctl_entries(rl_sysctl_root, rs); - /* re-lock for our caller */ mtx_lock(&rs_mtx); + CK_LIST_INSERT_HEAD(&int_rs, rs, next); + mtx_unlock(&rs_mtx); return (rs); } @@ -978,8 +972,8 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *if return; } } - rt_setup_new_rs(ifp, &error); mtx_unlock(&rs_mtx); + rt_setup_new_rs(ifp, &error); } static void From owner-svn-src-head@freebsd.org Mon Aug 26 16:25:12 2019 Return-Path: Delivered-To: svn-src-head@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 8013FDF712; Mon, 26 Aug 2019 16:25:12 +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 46HHRD2pFtz4cLW; Mon, 26 Aug 2019 16:25:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 AF3CC1BF91; Mon, 26 Aug 2019 16:25:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351456 - head/sys/amd64/amd64 To: Konstantin Belousov , Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head References: <201908241528.x7OFSemm026182@repo.freebsd.org> <20190824161503.GA71821@kib.kiev.ua> <20190824204353.GH71821@kib.kiev.ua> 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: <1a09a4ef-45aa-1bb2-5b16-1bde24df0f3d@FreeBSD.org> Date: Mon, 26 Aug 2019 09:25:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190824204353.GH71821@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 16:25:12 -0000 On 8/24/19 1:43 PM, Konstantin Belousov wrote: > On Sat, Aug 24, 2019 at 11:47:52AM -0700, Conrad Meyer wrote: >> On Sat, Aug 24, 2019 at 9:15 AM Konstantin Belousov wrote: >>> >>> On Sat, Aug 24, 2019 at 08:49:42AM -0700, Conrad Meyer wrote: >>>> Hi Konstantin, >>>> >>>> What is the motivation for this change? The commit message doesn't >>>> really describe why it was done. >>> >>> Really it does. There is no point to request allocations for e.g. >>> doublefault stack to be at the local domain, because this stack is only >>> used once. Doublefault is definitely a machine halt situation, it does >>> not matter if it generates inter-socket traffic to handle. >>> >>> Same for boot stacks, and for mce. >>> >>> The change avoids unnecessary constraints. >> >> Sure, but what is the harm of the unnecessary constraints? Does this >> change fix an actual bug, or is it just a stylistic preference to >> avoid domain-specific allocations for infrequently used objects? > I am not sure about this being a stylistic preference. We usually > write code to express the required actions. I removed constraints > which did not added anything neither to code correctness nor to the > performance. Judging by the thread on current though, this fixes boot panics on machines with NUMA but CPUs that don't have local memory, correct? I think that's the thing Conrad is asking. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 26 16:31:34 2019 Return-Path: Delivered-To: svn-src-head@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 D0AE9DF8F8; Mon, 26 Aug 2019 16:31:34 +0000 (UTC) (envelope-from jhb@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 46HHZZ5BBRz4cmS; Mon, 26 Aug 2019 16:31:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 9D5BB1C0B6; Mon, 26 Aug 2019 16:31:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: "Bjoern A. Zeeb" , alan somers Cc: Hiroki Sato , Alan Somers , Jan Sucan , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> <4D99F70B-5BFD-447A-B833-D4F73CEECFF2@lists.zabbadoz.net> 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: Mon, 26 Aug 2019 09:31:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <4D99F70B-5BFD-447A-B833-D4F73CEECFF2@lists.zabbadoz.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 16:31:34 -0000 On 8/26/19 1:59 AM, Bjoern A. Zeeb wrote: > In other notes (and I keep saying that), I can see a world when ping > doesn’t exist anymore as IPv4 doesn’t exist anymore (I partially > already live in that world). The fact that people still do not prepare > themselves for this time is a bit strange to me as by the time FreeBSD > 14 is still in support this IPv6-only world might very well happen for a > majority of people. And FreeBSD 14-CURRENT really is only a year away > now. So breaking what’s been good for almost 20 years now for a few > more years doesn’t really seem to be worth to me. Eh, I think having 'ping' around on even IPv6 systems is sensible. ping is not inherently version-specific in name, only ping6 is. Having ping not include ipv4 bits for WITHOUT_INET=yes is fine, but I think not having ping as a command is just nonsense. The fact that we have ping6 instead of ping -6 (compared to say, traceroute, ssh, etc. which all have unified commands) is just a user-interface bug we are stuck maintaining compatibility for, not a goal to shoot for. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 26 16:34:47 2019 Return-Path: Delivered-To: svn-src-head@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 CD36BDFB02; Mon, 26 Aug 2019 16:34:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46HHfH3LKXz4d1F; Mon, 26 Aug 2019 16:34:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x7QGYdG8008503 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 26 Aug 2019 19:34:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x7QGYdG8008503 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x7QGYdjf008502; Mon, 26 Aug 2019 19:34:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 26 Aug 2019 19:34:39 +0300 From: Konstantin Belousov To: John Baldwin Cc: Conrad Meyer , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351456 - head/sys/amd64/amd64 Message-ID: <20190826163439.GS71821@kib.kiev.ua> References: <201908241528.x7OFSemm026182@repo.freebsd.org> <20190824161503.GA71821@kib.kiev.ua> <20190824204353.GH71821@kib.kiev.ua> <1a09a4ef-45aa-1bb2-5b16-1bde24df0f3d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a09a4ef-45aa-1bb2-5b16-1bde24df0f3d@FreeBSD.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46HHfH3LKXz4d1F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.90)[-0.897,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 16:34:47 -0000 On Mon, Aug 26, 2019 at 09:25:11AM -0700, John Baldwin wrote: > On 8/24/19 1:43 PM, Konstantin Belousov wrote: > > On Sat, Aug 24, 2019 at 11:47:52AM -0700, Conrad Meyer wrote: > >> On Sat, Aug 24, 2019 at 9:15 AM Konstantin Belousov wrote: > >>> > >>> On Sat, Aug 24, 2019 at 08:49:42AM -0700, Conrad Meyer wrote: > >>>> Hi Konstantin, > >>>> > >>>> What is the motivation for this change? The commit message doesn't > >>>> really describe why it was done. > >>> > >>> Really it does. There is no point to request allocations for e.g. > >>> doublefault stack to be at the local domain, because this stack is only > >>> used once. Doublefault is definitely a machine halt situation, it does > >>> not matter if it generates inter-socket traffic to handle. > >>> > >>> Same for boot stacks, and for mce. > >>> > >>> The change avoids unnecessary constraints. > >> > >> Sure, but what is the harm of the unnecessary constraints? Does this > >> change fix an actual bug, or is it just a stylistic preference to > >> avoid domain-specific allocations for infrequently used objects? > > I am not sure about this being a stylistic preference. We usually > > write code to express the required actions. I removed constraints > > which did not added anything neither to code correctness nor to the > > performance. > > Judging by the thread on current though, this fixes boot panics on > machines with NUMA but CPUs that don't have local memory, correct? > I think that's the thing Conrad is asking. > This was discovered later. From owner-svn-src-head@freebsd.org Mon Aug 26 17:25:09 2019 Return-Path: Delivered-To: svn-src-head@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 65AD6E1008; Mon, 26 Aug 2019 17:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46HJmP23wPz3CXd; Mon, 26 Aug 2019 17:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28A81977A; Mon, 26 Aug 2019 17:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7QHP9NR020777; Mon, 26 Aug 2019 17:25:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QHP79q020769; Mon, 26 Aug 2019 17:25:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908261725.x7QHP79q020769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Aug 2019 17:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351513 - in head/sys: crypto/des kgssapi/krb5 netsmb opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/des kgssapi/krb5 netsmb opencrypto X-SVN-Commit-Revision: 351513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 17:25:09 -0000 Author: jhb Date: Mon Aug 26 17:25:07 2019 New Revision: 351513 URL: https://svnweb.freebsd.org/changeset/base/351513 Log: Stop using des_cblock * for arguments to DES functions. This amounts to a char ** since it is a char[8] *. Evil casts mostly resolved the fact that what was actually passed in were plain char *. Instead, change the DES functions to use 'unsigned char *' for keys and for input and output buffers. Reviewed by: cem, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21389 Modified: head/sys/crypto/des/des.h head/sys/crypto/des/des_ecb.c head/sys/crypto/des/des_setkey.c head/sys/kgssapi/krb5/kcrypto_des.c head/sys/kgssapi/krb5/kcrypto_des3.c head/sys/netsmb/smb_crypt.c head/sys/opencrypto/xform_des1.c head/sys/opencrypto/xform_des3.c Modified: head/sys/crypto/des/des.h ============================================================================== --- head/sys/crypto/des/des.h Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/crypto/des/des.h Mon Aug 26 17:25:07 2019 (r351513) @@ -82,7 +82,7 @@ typedef struct des_ks_struct extern int des_check_key; /* defaults to false */ char *des_options(void); -void des_ecb_encrypt(des_cblock *, des_cblock *, des_key_schedule, int); +void des_ecb_encrypt(unsigned char *, unsigned char *, des_key_schedule, int); void des_encrypt1(DES_LONG *, des_key_schedule, int); void des_encrypt2(DES_LONG *, des_key_schedule, int); @@ -91,24 +91,17 @@ void des_encrypt3(DES_LONG *, des_key_schedule, des_ke void des_decrypt3(DES_LONG *, des_key_schedule, des_key_schedule, des_key_schedule); -void des_ecb3_encrypt(des_cblock *, des_cblock *, des_key_schedule, +void des_ecb3_encrypt(unsigned char *, unsigned char *, des_key_schedule, des_key_schedule, des_key_schedule, int); -void des_ncbc_encrypt(const unsigned char *, unsigned char *, long, - des_key_schedule, des_cblock *, int); - -void des_ede3_cbc_encrypt(const unsigned char *, unsigned char *, long, - des_key_schedule, des_key_schedule, - des_key_schedule, des_cblock *, int); - -void des_set_odd_parity(des_cblock *); -void des_fixup_key_parity(des_cblock *); -int des_is_weak_key(const des_cblock *); -int des_set_key(const des_cblock *, des_key_schedule); -int des_key_sched(const des_cblock *, des_key_schedule); -int des_set_key_checked(const des_cblock *, des_key_schedule); -void des_set_key_unchecked(const des_cblock *, des_key_schedule); -int des_check_key_parity(const des_cblock *); +void des_set_odd_parity(unsigned char *); +void des_fixup_key_parity(unsigned char *); +int des_is_weak_key(const unsigned char *); +int des_set_key(const unsigned char *, des_key_schedule); +int des_key_sched(const unsigned char *, des_key_schedule); +int des_set_key_checked(const unsigned char *, des_key_schedule); +void des_set_key_unchecked(const unsigned char *, des_key_schedule); +int des_check_key_parity(const unsigned char *); #ifdef __cplusplus } Modified: head/sys/crypto/des/des_ecb.c ============================================================================== --- head/sys/crypto/des/des_ecb.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/crypto/des/des_ecb.c Mon Aug 26 17:25:07 2019 (r351513) @@ -97,13 +97,13 @@ char *des_options(void) } return(buf); } -void des_ecb_encrypt(des_cblock *input, des_cblock *output, +void des_ecb_encrypt(unsigned char *input, unsigned char *output, des_key_schedule ks, int enc) { register DES_LONG l; DES_LONG ll[2]; - const unsigned char *in=&(*input)[0]; - unsigned char *out = &(*output)[0]; + const unsigned char *in = input; + unsigned char *out = output; c2l(in,l); ll[0]=l; c2l(in,l); ll[1]=l; @@ -113,14 +113,14 @@ void des_ecb_encrypt(des_cblock *input, des_cblock *ou l=ll[0]=ll[1]=0; } -void des_ecb3_encrypt(des_cblock *input, des_cblock *output, +void des_ecb3_encrypt(unsigned char *input, unsigned char *output, des_key_schedule ks1, des_key_schedule ks2, des_key_schedule ks3, int enc) { register DES_LONG l0,l1; DES_LONG ll[2]; - const unsigned char *in = &(*input)[0]; - unsigned char *out = &(*output)[0]; + const unsigned char *in = input; + unsigned char *out = output; c2l(in,l0); c2l(in,l1); Modified: head/sys/crypto/des/des_setkey.c ============================================================================== --- head/sys/crypto/des/des_setkey.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/crypto/des/des_setkey.c Mon Aug 26 17:25:07 2019 (r351513) @@ -67,21 +67,21 @@ __FBSDID("$FreeBSD$"); int des_check_key=0; -void des_set_odd_parity(des_cblock *key) +void des_set_odd_parity(unsigned char *key) { int i; for (i=0; i>(16-(n)))) -int des_set_key(const des_cblock *key, des_key_schedule schedule) +int des_set_key(const unsigned char *key, des_key_schedule schedule) { if (des_check_key) { @@ -159,7 +159,7 @@ int des_set_key(const des_cblock *key, des_key_schedul * return -1 if key parity error, * return -2 if illegal weak key. */ -int des_set_key_checked(const des_cblock *key, des_key_schedule schedule) +int des_set_key_checked(const unsigned char *key, des_key_schedule schedule) { if (!des_check_key_parity(key)) return(-1); @@ -169,7 +169,7 @@ int des_set_key_checked(const des_cblock *key, des_key return 0; } -void des_set_key_unchecked(const des_cblock *key, des_key_schedule schedule) +void des_set_key_unchecked(const unsigned char *key, des_key_schedule schedule) { static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; DES_LONG c,d,t,s,t2; @@ -178,7 +178,7 @@ void des_set_key_unchecked(const des_cblock *key, des_ int i; k = &schedule->ks.deslong[0]; - in = &(*key)[0]; + in = key; c2l(in,c); c2l(in,d); @@ -225,12 +225,12 @@ void des_set_key_unchecked(const des_cblock *key, des_ } } -int des_key_sched(const des_cblock *key, des_key_schedule schedule) +int des_key_sched(const unsigned char *key, des_key_schedule schedule) { return(des_set_key(key,schedule)); } -void des_fixup_key_parity(des_cblock *key) +void des_fixup_key_parity(unsigned char *key) { des_set_odd_parity(key); } Modified: head/sys/kgssapi/krb5/kcrypto_des.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/kgssapi/krb5/kcrypto_des.c Mon Aug 26 17:25:07 2019 (r351513) @@ -135,8 +135,8 @@ des1_random_to_key(struct krb5_key_state *ks, const vo | ((inkey[4] & 1) << 5) | ((inkey[5] & 1) << 6) | ((inkey[6] & 1) << 7)); - des_set_odd_parity((des_cblock *) outkey); - if (des_is_weak_key((des_cblock *) outkey)) + des_set_odd_parity(outkey); + if (des_is_weak_key(outkey)) outkey[7] ^= 0xf0; des1_set_key(ks, ks->ks_key); Modified: head/sys/kgssapi/krb5/kcrypto_des3.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto_des3.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/kgssapi/krb5/kcrypto_des3.c Mon Aug 26 17:25:07 2019 (r351513) @@ -144,8 +144,8 @@ des3_random_to_key(struct krb5_key_state *ks, const vo | ((inkey[4] & 1) << 5) | ((inkey[5] & 1) << 6) | ((inkey[6] & 1) << 7)); - des_set_odd_parity((des_cblock *) outkey); - if (des_is_weak_key((des_cblock *) outkey)) + des_set_odd_parity(outkey); + if (des_is_weak_key(outkey)) outkey[7] ^= 0xf0; } Modified: head/sys/netsmb/smb_crypt.c ============================================================================== --- head/sys/netsmb/smb_crypt.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/netsmb/smb_crypt.c Mon Aug 26 17:25:07 2019 (r351513) @@ -83,8 +83,8 @@ smb_E(const u_char *key, u_char *data, u_char *dest) kk[6] = key[5] << 2 | (key[6] >> 6 & 0xfe); kk[7] = key[6] << 1; ksp = malloc(sizeof(des_key_schedule), M_SMBTEMP, M_WAITOK); - des_set_key((des_cblock *)kk, *ksp); - des_ecb_encrypt((des_cblock *)data, (des_cblock *)dest, *ksp, 1); + des_set_key(kk, *ksp); + des_ecb_encrypt(data, dest, *ksp, 1); free(ksp, M_SMBTEMP); } Modified: head/sys/opencrypto/xform_des1.c ============================================================================== --- head/sys/opencrypto/xform_des1.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/opencrypto/xform_des1.c Mon Aug 26 17:25:07 2019 (r351513) @@ -75,19 +75,17 @@ struct enc_xform enc_xform_des = { static void des1_encrypt(caddr_t key, u_int8_t *blk) { - des_cblock *cb = (des_cblock *) blk; des_key_schedule *p = (des_key_schedule *) key; - des_ecb_encrypt(cb, cb, p[0], DES_ENCRYPT); + des_ecb_encrypt(blk, blk, p[0], DES_ENCRYPT); } static void des1_decrypt(caddr_t key, u_int8_t *blk) { - des_cblock *cb = (des_cblock *) blk; des_key_schedule *p = (des_key_schedule *) key; - des_ecb_encrypt(cb, cb, p[0], DES_DECRYPT); + des_ecb_encrypt(blk, blk, p[0], DES_DECRYPT); } static int @@ -99,7 +97,7 @@ des1_setkey(u_int8_t **sched, const u_int8_t *key, int p = KMALLOC(sizeof (des_key_schedule), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (p != NULL) { - des_set_key((const des_cblock *) key, p[0]); + des_set_key(key, p[0]); err = 0; } else err = ENOMEM; Modified: head/sys/opencrypto/xform_des3.c ============================================================================== --- head/sys/opencrypto/xform_des3.c Mon Aug 26 16:23:47 2019 (r351512) +++ head/sys/opencrypto/xform_des3.c Mon Aug 26 17:25:07 2019 (r351513) @@ -76,19 +76,17 @@ struct enc_xform enc_xform_3des = { static void des3_encrypt(caddr_t key, u_int8_t *blk) { - des_cblock *cb = (des_cblock *) blk; des_key_schedule *p = (des_key_schedule *) key; - des_ecb3_encrypt(cb, cb, p[0], p[1], p[2], DES_ENCRYPT); + des_ecb3_encrypt(blk, blk, p[0], p[1], p[2], DES_ENCRYPT); } static void des3_decrypt(caddr_t key, u_int8_t *blk) { - des_cblock *cb = (des_cblock *) blk; des_key_schedule *p = (des_key_schedule *) key; - des_ecb3_encrypt(cb, cb, p[0], p[1], p[2], DES_DECRYPT); + des_ecb3_encrypt(blk, blk, p[0], p[1], p[2], DES_DECRYPT); } static int @@ -100,9 +98,9 @@ des3_setkey(u_int8_t **sched, const u_int8_t *key, int p = KMALLOC(3*sizeof (des_key_schedule), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (p != NULL) { - des_set_key((const des_cblock *)(key + 0), p[0]); - des_set_key((const des_cblock *)(key + 8), p[1]); - des_set_key((const des_cblock *)(key + 16), p[2]); + des_set_key(key + 0, p[0]); + des_set_key(key + 8, p[1]); + des_set_key(key + 16, p[2]); err = 0; } else err = ENOMEM; From owner-svn-src-head@freebsd.org Mon Aug 26 17:25:55 2019 Return-Path: Delivered-To: svn-src-head@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 7487AE108B; Mon, 26 Aug 2019 17:25:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 46HJnH2HJsz3Cgv; Mon, 26 Aug 2019 17:25:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id 18so39129413ioe.10; Mon, 26 Aug 2019 10:25:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=0kZl83pA3Hq31XlGvGPzmDs7uT+aEXK/JLr0t4jKFj4=; b=RlbC+MFQzJw8fjAemvjLqBVZpTWXdNC4J3oAYHnKc+JPIe2Elu5+hOLiEyd8xeHG9t DJmB+GOHFAsxUCEkYPE0N89mRcUk7x8roT+SaO6vLgGgPER1I2ustJbnaKuGIo69MCgD A5Oyyf11TYs20fHOf73RtIEofVQRwN+saDYIwRcsKzrcqyUHngspX/Kn3u/0iipjqTcR rnX+Z3+UPEqE24EOsTMLl2SYm1rb6kASIiePTOrd77T5i9D6URBCssXck1M5qGBJVNv5 rpeJ00vEXVCerjY1OcV4AumC45vFKB1smau+r917B7DWfzU+/TQXOTaP7L6crZQn+n5D PW9g== X-Gm-Message-State: APjAAAUtgfQdaLA+kkiuGf3shHseUgToI3D5JQefrynsj82NS8+TpvjY q3/gE+9MZcVP4GJqSTCCphIu/pfW X-Google-Smtp-Source: APXvYqxdnLAKKmpSAOBIB/Jpnd3AU0wtNXGpHDMwQ480PaBysmC5hJ6pqYvw/cC8Ja/qAK3R+w2jfw== X-Received: by 2002:a6b:3784:: with SMTP id e126mr21075691ioa.8.1566840353148; Mon, 26 Aug 2019 10:25:53 -0700 (PDT) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com. [209.85.166.43]) by smtp.gmail.com with ESMTPSA id y17sm10088442ioa.52.2019.08.26.10.25.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2019 10:25:52 -0700 (PDT) Received: by mail-io1-f43.google.com with SMTP id j4so30833363iog.11; Mon, 26 Aug 2019 10:25:52 -0700 (PDT) X-Received: by 2002:a6b:e013:: with SMTP id z19mr660569iog.141.1566840352555; Mon, 26 Aug 2019 10:25:52 -0700 (PDT) MIME-Version: 1.0 References: <201908241528.x7OFSemm026182@repo.freebsd.org> <20190824161503.GA71821@kib.kiev.ua> <20190824204353.GH71821@kib.kiev.ua> <1a09a4ef-45aa-1bb2-5b16-1bde24df0f3d@FreeBSD.org> In-Reply-To: <1a09a4ef-45aa-1bb2-5b16-1bde24df0f3d@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 26 Aug 2019 10:25:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351456 - head/sys/amd64/amd64 To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HJnH2HJsz3Cgv X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 17:25:55 -0000 r351456 only loosened restrictions on some of the less common thread types; it was accidentally necessary, but not sufficient. 351494, 351495, and 351496 (at least) are also necessary, once the issue was identified. Best, Conrad On Mon, Aug 26, 2019 at 9:25 AM John Baldwin wrote: > > On 8/24/19 1:43 PM, Konstantin Belousov wrote: > > On Sat, Aug 24, 2019 at 11:47:52AM -0700, Conrad Meyer wrote: > >> On Sat, Aug 24, 2019 at 9:15 AM Konstantin Belousov wrote: > >>> > >>> On Sat, Aug 24, 2019 at 08:49:42AM -0700, Conrad Meyer wrote: > >>>> Hi Konstantin, > >>>> > >>>> What is the motivation for this change? The commit message doesn't > >>>> really describe why it was done. > >>> > >>> Really it does. There is no point to request allocations for e.g. > >>> doublefault stack to be at the local domain, because this stack is only > >>> used once. Doublefault is definitely a machine halt situation, it does > >>> not matter if it generates inter-socket traffic to handle. > >>> > >>> Same for boot stacks, and for mce. > >>> > >>> The change avoids unnecessary constraints. > >> > >> Sure, but what is the harm of the unnecessary constraints? Does this > >> change fix an actual bug, or is it just a stylistic preference to > >> avoid domain-specific allocations for infrequently used objects? > > I am not sure about this being a stylistic preference. We usually > > write code to express the required actions. I removed constraints > > which did not added anything neither to code correctness nor to the > > performance. > > Judging by the thread on current though, this fixes boot panics on > machines with NUMA but CPUs that don't have local memory, correct? > I think that's the thing Conrad is asking. > > -- > John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 26 17:27:37 2019 Return-Path: Delivered-To: svn-src-head@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 9060BE1106; Mon, 26 Aug 2019 17:27:37 +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 46HJqF398Gz3CrR; Mon, 26 Aug 2019 17:27:37 +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 62BFC9780; Mon, 26 Aug 2019 17:27:37 +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 x7QHRbI2020979; Mon, 26 Aug 2019 17:27:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QHRbsc020978; Mon, 26 Aug 2019 17:27:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908261727.x7QHRbsc020978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 26 Aug 2019 17:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351514 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 351514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 17:27:37 -0000 Author: mav Date: Mon Aug 26 17:27:36 2019 New Revision: 351514 URL: https://svnweb.freebsd.org/changeset/base/351514 Log: Don't consider PCIe hot-plug command timeout fatal. According to my tests and errata to several generations of Intel CPUs, PCIe hot-plug command completion reporting is not very reliable thing. At least on my Supermicro X11DPi-NT board I never saw it reported. Before this change timeout code detached devices and tried to disable the slot, that in my case resulted in hot-plugged device being detached just a second after it was successfully detected and attached. This change removes that, so in case of timeout it just prints the error and continue operation. Linux does the same. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Mon Aug 26 17:25:07 2019 (r351513) +++ head/sys/dev/pci/pci_pci.c Mon Aug 26 17:27:36 2019 (r351514) @@ -1272,11 +1272,8 @@ pcib_pcie_cc_timeout(void *arg) mtx_assert(&Giant, MA_OWNED); sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if (!(sta & PCIEM_SLOT_STA_CC)) { - device_printf(dev, - "HotPlug Command Timed Out - forcing detach\n"); - sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); - sc->flags |= PCIB_DETACHING; - pcib_pcie_hotplug_update(sc, 0, 0, true); + device_printf(dev, "HotPlug Command Timed Out\n"); + sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; } else { device_printf(dev, "Missed HotPlug interrupt waiting for Command Completion\n"); From owner-svn-src-head@freebsd.org Mon Aug 26 17:54:20 2019 Return-Path: Delivered-To: svn-src-head@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 8EC02E1B23; Mon, 26 Aug 2019 17:54:20 +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 46HKQ43Cbkz3FjW; Mon, 26 Aug 2019 17:54:20 +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 4AC7D9D0B; Mon, 26 Aug 2019 17:54:20 +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 x7QHsKkr038856; Mon, 26 Aug 2019 17:54:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QHsKtL038855; Mon, 26 Aug 2019 17:54:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908261754.x7QHsKtL038855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 26 Aug 2019 17:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351516 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 351516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 17:54:20 -0000 Author: mav Date: Mon Aug 26 17:54:19 2019 New Revision: 351516 URL: https://svnweb.freebsd.org/changeset/base/351516 Log: Announce PCI Segment Groups supported to PCI host _OSC. According to ACPI 6.3 specification: The OS sets this bit to 1 if it supports PCI Segment Groups as defined by the _SEG object, and access to the configuration space of devices in PCI Segment Groups as described by this specification. Otherwise, the OS sets this bit to 0. As far as I see we support both of those as PCI domains for quite a while. MFC after: 2 months Modified: head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Mon Aug 26 17:34:07 2019 (r351515) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Mon Aug 26 17:54:19 2019 (r351516) @@ -323,9 +323,9 @@ acpi_pcib_osc(struct acpi_hpcib_softc *sc, uint32_t os if (osc_ctl != 0 && (sc->ap_osc_ctl & osc_ctl) == osc_ctl) return (0); - /* Support Field: Extended PCI Config Space, MSI */ + /* Support Field: Extended PCI Config Space, PCI Segment Groups, MSI */ cap_set[PCI_OSC_SUPPORT] = PCIM_OSC_SUPPORT_EXT_PCI_CONF | - PCIM_OSC_SUPPORT_MSI; + PCIM_OSC_SUPPORT_SEG_GROUP | PCIM_OSC_SUPPORT_MSI; /* Control Field */ cap_set[PCI_OSC_CTL] = sc->ap_osc_ctl | osc_ctl; From owner-svn-src-head@freebsd.org Mon Aug 26 18:37:20 2019 Return-Path: Delivered-To: svn-src-head@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 3558DE263E; Mon, 26 Aug 2019 18:37:20 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 46HLMg1BJmz3HhB; Mon, 26 Aug 2019 18:37:18 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id y8so16264423wrn.10; Mon, 26 Aug 2019 11:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=RNXkOeV3VkCJxwlq7AgAfVBjBWH5dL+gIwc8h2J3Y5w=; b=IhLbl1nUCxb7qsexGD9i5aB8fi/FqiNMm6kX+YLSVwJpICIGvrv97Wl8lNfjEhA+tq UupSM/YGZcprO/pB1AD7HtMD8zunYIEnXojJ4IUyPM4hid10baNXsVcCtGh72UUs6wOx CerEL90u/m/ZHd/cnMh8C5LaGo54OHfDXG7rD//GefnGZvQ7zZ/2LRLGkOe6BdGyTjGR ulJu12d8qr98IwKlPc0T/JAdKtA9082dMAyp6ADjrfkSWUYc5mU9cJxtCu1KgBTqwsFs AOPF9/jU+bb5otmC6g0n86KeDcPmZFn+vA//xdwM4Sk3O1/0m2+FpLkZZ/ajb3XjrXmz hEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=RNXkOeV3VkCJxwlq7AgAfVBjBWH5dL+gIwc8h2J3Y5w=; b=OQugWpQ1n4nzNZ1vO8mWTQK499d2yWOtKs6IcFunKaKpBt5JZkBYAdYZdRWbX0dLF8 n4NEkEuWexYEr6uZaYn9wyqPW+yRtpjndcolDd9J+M2f4vNLD0PwMhLbj6BBt+6p7F9S ftacR1KptAq0Lk7F01Bjmsa5qrJtkWabkYO+S9m3P/i/j3YFb7mD/ZazOJoqvzLNbDBf dkwjMTx0TpkrOeaqizE2SQ62dRdSEwNbXl11Eby7Q52NygYV02i0TWcsWNrS2Dnbmzfm PljzP5NQ0IYOu748MxUHKKH2nHL62aHXmlLDo+aSd5YiRGa9lutp93SGiPq0eMzYzAbb xV0A== X-Gm-Message-State: APjAAAUvO3a9C4ru4dCHvSA5cABlCdpQobcrOeBou3mKA5Fk61Tvtk50 aIhdscj1TJaEmjrZ0cneEL5DUHMhxRcRRQ== X-Google-Smtp-Source: APXvYqxXt84afNROsx9T2xH4PeS5jIkS308uT4gFTqWRKiI0XaQ9zb5u0e7oUYXwqJavUtlIqBuIWg== X-Received: by 2002:a5d:698f:: with SMTP id g15mr25304890wru.310.1566844637384; Mon, 26 Aug 2019 11:37:17 -0700 (PDT) Received: from [192.168.1.102] (9.215.broadband18.iol.cz. [109.81.215.9]) by smtp.gmail.com with ESMTPSA id s192sm213920wme.17.2019.08.26.11.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Aug 2019 11:37:16 -0700 (PDT) Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests To: Alan Somers , "Conrad E. Meyer" Cc: Hiroki Sato , src-committers , svn-src-all , svn-src-head References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> From: Jan Sucan Message-ID: Date: Mon, 26 Aug 2019 20:37:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 46HLMg1BJmz3HhB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=IhLbl1nU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sucanjan@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=sucanjan@gmail.com X-Spamd-Result: default: False [-3.95 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; RECEIVED_SPAMHAUS_PBL(0.00)[9.215.81.109.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.55), ipnet: 2a00:1450::/32(-3.00), asn: 15169(-2.33), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.4.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]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 18:37:20 -0000 On 26. 8. 2019 1:58, Alan Somers wrote: > Jan (please keep him CCed on replies) has been musing about the same > thing. That might satisfy everyone. Jan, would it be straightforward > to implement? > -Alan I forgot to answer the question whether it would be straightforward. It depends on how fast it should be solved. Simple and quick solution would be to completely duplicate the getopt loop including parsing of arguments of the options. With some more time I would implement it in two commits. The first commit for separating parsing of command line tokens from parsing of the option arguments, the second commit for translation of the options. I'm going to do it the second way. If the time is important, let me know. -Jan > On Sun, Aug 25, 2019 at 5:51 PM Conrad Meyer wrote: >> Hi Alan, Hiroki, >> >> It would be pretty easy to install a `ping6` link to the `ping(8)` >> binary with different option parsing (conditional on argv[0]). That >> removes most of the issues of code and space duplication, I think? >> And the goal would be for the 'ping6' name to retain option >> compatibility with historical ping6. >> >> It's not an uncommon pattern; for example, 'id', 'groups', and >> 'whoami' are all a single binary with multiple linked names. Another >> example is Clang, which provides 'cc', 'c++', 'clang', 'clang-cpp', >> 'clang++' and 'cpp' links to the same inode — and those have very >> different behavior depending on argv[0]. >> >> It's less work than forcing the ping6 compatibility crowd to create a >> port and doesn't hurt ping(8) much, AFAICT. Is it an acceptable >> middle ground? >> >> Best, >> Conrad >> >> On Sun, Aug 25, 2019 at 1:26 PM alan somers wrote: >>> On Sun, Aug 25, 2019, 2:11 PM Hiroki Sato wrote: >>>> Alan Somers wrote >>>> in : >>>> >>>> as> On Sun, Aug 25, 2019 at 1:22 PM Hiroki Sato wrote: >>>> as> > >>>> as> > Hi, >>>> as> > >>>> as> > Alan Somers wrote >>>> as> > in <201908231522.x7NFMLuJ068037@repo.freebsd.org>: >>>> as> > >>>> as> > as> Author: asomers >>>> as> > as> Date: Fri Aug 23 15:22:20 2019 >>>> as> > as> New Revision: 351423 >>>> as> > as> URL: https://svnweb.freebsd.org/changeset/base/351423 >>>> as> > as> >>>> as> > as> Log: >>>> as> > as> ping6: Rename options for better consistency with ping >>>> as> > as> >>>> as> > as> Now equivalent options have the same flags, and nonequivalent options have >>>> as> > as> different flags. This is a prelude to merging the two commands. >>>> as> > as> >>>> as> > as> Submitted by: Ján Sučan >>>> as> > as> MFC: Never >>>> as> > as> Sponsored by: Google LLC (Google Summer of Code 2019) >>>> as> > as> Differential Revision: https://reviews.freebsd.org/D21345 >>>> as> > >>>> as> > I have an objection on renaming the existing option flags in ping6(8) >>>> as> > for compatibility with ping(8). >>>> as> > >>>> as> > Is it sufficient to add INET6 support to ping(8) with consistent >>>> as> > flags and keep CLI of ping6(8) backward compatible? People have used >>>> as> > ping6(8) for >15 years, so it is too late to rename the flags. I do >>>> as> > not think the renaming is useful if "ping -6 localhost" or "ping ::1" >>>> as> > works. >>>> as> > >>>> as> > -- Hiroki >>>> as> >>>> as> If ping works with inet6, then why would we want to keep a separate >>>> as> tool around? If it's just for the sake of people who don't want to or >>>> as> can't update scripts, would a version in ports suffice? >>>> >>>> Because removing (or renaming) it causes a POLA violation. Do we >>>> really have a strong, unavoidable reason to force people to rewrite >>>> their script now? This is still a fairly essential and actively used >>>> tool, not like rcp or rlogin. Although deprecating ping6(8) and >>>> removing it from the base system in the future release at some point >>>> may work, changing the existing interface will simply confuse people >>>> who have used IPv6 for a long time. >>>> >>>> In my understanding, the purpose to integrate ping(8) and ping6(8) >>>> into a single utility is to provide a consistent CLI and reduce >>>> duplicate code, not to break compatibility. >>>> >>>> -- Hiroki >>> >>> Those goals are incompatible. We can't provide a consistent CLI without breaking compatibility because ping and ping6 have conflicting options. And we can't keep ping6 around while also removing duplicate code because that would be, well, duplicate code. >>> >>> When would be a better time than a major version bump to make a change like this? >>> >>> The lack of a ping6 command in freebsd 13 should serve as a pretty obvious reminder that scripts will need updating. I think that putting a version of ping6 in ports should be a sufficient crutch for those who need it, don't you? From owner-svn-src-head@freebsd.org Mon Aug 26 18:57:13 2019 Return-Path: Delivered-To: svn-src-head@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 E7133E2BAA; Mon, 26 Aug 2019 18:57:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HLpc0P5Lz3JV8; Mon, 26 Aug 2019 18:57:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2KAtib6SpUIS22KAvipi99; Mon, 26 Aug 2019 12:57:10 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=ZEoSrfTuiJO42y7gCn8A:9 a=6fx59qz95PZ1v0d2:21 a=3I2Xy-IaEZeS5o1S:21 a=8HBsMUk44bn0z0wV:21 a=QEXdDO2ut3YA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [10.250.34.60] (S01060c8ddb626965.gv.shawcable.net [70.67.252.119]) by spqr.komquats.com (Postfix) with ESMTPSA id 286E6345; Mon, 26 Aug 2019 11:57:06 -0700 (PDT) Date: Mon, 26 Aug 2019 11:56:43 -0700 In-Reply-To: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Mateusz Guzik CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfNirnWGFzeMM/s7qvPO+uU9N5jjAlNn64u+rwoje7fZxUhaHGnhHcaJMy/eojC69GbZcmWdPkYcP6c5UBxnRjL4n2/cPrBESa4hB8X9JkHmPH6DmiTwb D2HaXnp/CYhlWn+Cuqkx3FeJ6bDyxxDSHyH0hx52TunbNO0TArT9W8FPU0oA0c9CJHcOXZy0f+c3ay35V0fd7FT1tEVKWUa5+caF8x3XPA1XRScei62idJMn ZTEETTCk/lzsBHRLRzGVKb+dUc0kdCc9VmX2090xLeRmNfFPCdD/DIKa4nHfbP58 X-Rspamd-Queue-Id: 46HLpc0P5Lz3JV8 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.12) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.45)[ip: (-6.57), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; RCVD_IN_DNSWL_NONE(0.00)[12.134.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11, 119.252.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 18:57:14 -0000 On August 26, 2019 8:40:50 AM PDT, Cy Schubert wrote: >On August 26, 2019 7:11:22 AM PDT, Cy Schubert > wrote: >>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert=2Ecom>, Cy >>Schubert wr >>ites: >>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik >>wrote: >>> >Author: mjg >>> >Date: Sun Aug 25 05:13:15 2019 >>> >New Revision: 351472 >>> >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/351472 >>> > >>> >Log: >>> > nullfs: reduce areas protected by vnode interlock >>> > =20 >>> >Some places only take the interlock to hold the vnode, which was a >>> >requiremnt >>> >before they started being manipulated with atomics=2E Use the newly >>> >introduced >>> > vholdnz to bump the count=2E >>> > =20 >>> > Reviewed by: kib >>> > Tested by: pho >>> > Sponsored by: The FreeBSD Foundation >>> > Differential Revision: https://reviews=2Efreebsd=2Eorg/D21358 >>> > >>> >Modified: >>> > head/sys/fs/nullfs/null_vnops=2Ec >>> > >>> >Modified: head/sys/fs/nullfs/null_vnops=2Ec >>> >>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> =3D=3D >>> >--- head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:11:43 >2019 (r35147 >>> 1) >>> >+++ head/sys/fs/nullfs/null_vnops=2Ec Sun Aug 25 05:13:15 >2019 (r35147 >>> 2) >>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) >>> > * We prevent it from being recycled by holding the vnode >>> > * here=2E >>> > */ >>> >- vholdl(lvp); >>> >+ vholdnz(lvp); >>> > error =3D VOP_LOCK(lvp, flags); >>> >=20 >>> > /* >>> >@@ -710,31 +710,16 @@ static int >>> > null_unlock(struct vop_unlock_args *ap) >>> > { >>> > struct vnode *vp =3D ap->a_vp; >>> >- int flags =3D ap->a_flags; >>> >- int mtxlkflag =3D 0; >>> > struct null_node *nn; >>> > struct vnode *lvp; >>> > int error; >>> >=20 >>> >- if ((flags & LK_INTERLOCK) !=3D 0) >>> >- mtxlkflag =3D 1; >>> >- else if (mtx_owned(VI_MTX(vp)) =3D=3D 0) { >>> >- VI_LOCK(vp); >>> >- mtxlkflag =3D 2; >>> >- } >>> > nn =3D VTONULL(vp); >>> > if (nn !=3D NULL && (lvp =3D NULLVPTOLOWERVP(vp)) !=3D NULL) { >>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); >>> >- flags |=3D LK_INTERLOCK; >>> >- vholdl(lvp); >>> >- VI_UNLOCK(vp); >>> >- error =3D VOP_UNLOCK(lvp, flags); >>> >+ vholdnz(lvp); >>> >+ error =3D VOP_UNLOCK(lvp, 0); >>> > vdrop(lvp); >>> >- if (mtxlkflag =3D=3D 0) >>> >- VI_LOCK(vp); >>> > } else { >>> >- if (mtxlkflag =3D=3D 2) >>> >- VI_UNLOCK(vp); >>> > error =3D vop_stdunlock(ap); >>> > } >>> >=20 >>> >@@ -845,10 +830,8 @@ null_getwritemount(struct >>vop_getwritemount_args >>> >*ap) >>> > VI_LOCK(vp); >>> > xp =3D VTONULL(vp); >>> > if (xp && (lowervp =3D xp->null_lowervp)) { >>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); >>> >+ vholdnz(lowervp); >>> > VI_UNLOCK(vp); >>> >- vholdl(lowervp); >>> >- VI_UNLOCK(lowervp); >>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); >>> > vdrop(lowervp); >>> > } else { >>> >>> Hi mjg@, >>> >>> This causes trap 12 a few seconds after mountlate during boot=2E >>Reverting this >>> commit allowed it to boot=2E >>> >>> Sorry for no backtrace=2E I managed to=20 >>> revert and test just prior to rushing out to catch the bus, with no >>time to=20 >>> craft a proper email=2E I'll post the backtrace when I arrive at work= =2E >> >>Hi mjg@, >> >>The gory details below=2E Don't be fooled by the panic when yppasswd is >>started=2E I was able to reproduce this panic in single user by simply >>mounting and using a nullfs=2E >> >>kernel trap 12 with interrupts disabled >> >> >>Fatal trap 12: page fault while in kernel mode >>cpuid =3D 0; apic id =3D 00 >>fault virtual address =3D 0xc >>fault code =3D supervisor read data, page not present >>instruction pointer =3D 0x20:0xffffffff806f0633 >>stack pointer =3D 0x28:0xfffffe004b3fa7c0 >>frame pointer =3D 0x28:0xfffffe004b3fa7e0 >>code segment =3D base 0x0, limit 0xfffff, type 0x1b >> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >>processor eflags =3D resume, IOPL =3D 0 >>current process =3D 26 (syncer) >>trap number =3D 12 >>panic: page fault >>cpuid =3D 0 >>time =3D 1566821203 >>KDB: stack backtrace: >>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>0xfffffe004b3fa470 >>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 >>panic() at panic+0x43/frame 0xfffffe004b3fa520 >>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 >>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 >>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 >>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 >>--- trap 0xc, rip =3D 0xffffffff806f0633, rsp =3D 0xfffffe004b3fa7c0, rb= p >=3D >>0xfffffe004b3fa7e0 --- >>propagate_priority() at propagate_priority+0x153/frame >>0xfffffe004b3fa7e0 >>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 >>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 >>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >>0xfffffe004b3fa920 >>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 >>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 >>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 >>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 >>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 >>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 >>--- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- >>Uptime: 3m25s >>Dumping 921 out of 7974 >>MB:=2E=2E2%=2E=2E11%=2E=2E21%=2E=2E32%=2E=2E42%=2E=2E51%=2E=2E61%=2E=2E7= 2%=2E=2E82%=2E=2E91% >> >>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu=2Eh:246 >>246 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" >>(OFFSETOF_CURTHREAD)); >>(kgdb) #0 __curthread () at >>/opt/src/svn-current/sys/amd64/include/pcpu=2Eh:246 >>#1 doadump (textdump=3D1) at >>/opt/src/svn-current/sys/kern/kern_shutdown=2Ec:392 >>#2 0xffffffff8068aead in kern_reboot (howto=3D260) >> at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:479 >>#3 0xffffffff8068b369 in vpanic (fmt=3D, ap=3D>out>) >> at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:905 >>#4 0xffffffff8068b163 in panic (fmt=3D) >> at /opt/src/svn-current/sys/kern/kern_shutdown=2Ec:832 >>#5 0xffffffff80a11c2c in trap_fatal (frame=3D0xfffffe004b3fa700, >eva=3D12) >> at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:943 >>#6 0xffffffff80a11c79 in trap_pfault (frame=3D0xfffffe004b3fa700, >>usermode=3D0) >> at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:767 >>#7 0xffffffff80a1126d in trap (frame=3D0xfffffe004b3fa700) >> at /opt/src/svn-current/sys/amd64/amd64/trap=2Ec:443 >>#8 >>#9 propagate_priority (td=3D0xfffff8003e43b000) >> at /opt/src/svn-current/sys/kern/subr_turnstile=2Ec:279 >>#10 0xffffffff806f13db in turnstile_wait (ts=3D0xfffff8000258a780,=20 >> owner=3D, queue=3D-512) >> at /opt/src/svn-current/sys/kern/subr_turnstile=2Ec:785 >>#11 0xffffffff80669271 in __mtx_lock_sleep (c=3D0xfffff80132e4ebf0,=20 >> v=3D) at >/opt/src/svn-current/sys/kern/kern_mutex=2Ec:654 >>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( >> mvp=3D0xfffff80002449800, mp=3D0xfffff80132d1e000, >vp=3D0xfffff80132e4eb40) >> at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:5590 >>#13 mnt_vnode_next_active (mvp=3D, mp=3D0xfffff80132d1e00= 0) >> at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:5649 >>#14 0xffffffff80766206 in __mnt_vnode_next_active >>(mvp=3D0xfffff80002449800,=20 >> mp=3D) at >/opt/src/svn-current/sys/kern/vfs_subr=2Ec:5682 >>#15 vfs_msync (mp=3D0xfffff80132d1e000, flags=3D2) >> at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:4238 >>#16 0xffffffff8076b4a6 in sync_fsync (ap=3D) >> at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:4468 >>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( >> vop=3D0xffffffff80cb4120 , a=3D0xfffffe004b3faa08) >> at vnode_if=2Ec:1312 >>#18 0xffffffff80769319 in VOP_FSYNC (vp=3D, waitfor=3D3,= =20 >> td=3D0xfffff800061dc5a0) at =2E/vnode_if=2Eh:549 >>#19 sync_vnode (bo=3D, td=3D0xfffff800061dc5a0,=20 >> slp=3D) at >/opt/src/svn-current/sys/kern/vfs_subr=2Ec:2316 >>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr=2Ec:2418 >>#21 0xffffffff80647e33 in fork_exit (callout=3D0xffffffff80768fa0 >>,=20 >> arg=3D0x0, frame=3D0xfffffe004b3faac0) >> at /opt/src/svn-current/sys/kern/kern_fork=2Ec:1045 >>#22 >> >> >>dmesg output: >> >>Updating motd:=2E >>Mounting late filesystems:=2E >>Starting nscd=2E >>Security policy loaded: MAC/ntpd (mac_ntpd) >>Starting ntpd=2E >>Starting yppasswdd=2E >>kernel trap 12 with interrupts disabled >> >> >>Fatal trap 12: page fault while in kernel mode >>cpuid =3D 0; apic id =3D 00 >>fault virtual address =3D 0xc >>fault code =3D supervisor read data, page not present >>instruction pointer =3D 0x20:0xffffffff806f0633 >>stack pointer =3D 0x28:0xfffffe004b7fa7c0 >>frame pointer =3D 0x28:0xfffffe004b7fa7e0 >>code segment =3D base 0x0, limit 0xfffff, type 0x1b >> =3D DPL 0, pres 1, long 1, def32 0, gran 1 >>processor eflags =3D resume, IOPL =3D 0 >>current process =3D 26 (syncer) >>trap number =3D 12 >>panic: page fault >>cpuid =3D 0 >>time =3D 1566820700 >>KDB: stack backtrace: >>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>0xfffffe004b7fa470 >>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 >>panic() at panic+0x43/frame 0xfffffe004b7fa520 >>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 >>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 >>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 >>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 >>--- trap 0xc, rip =3D 0xffffffff806f0633, rsp =3D 0xfffffe004b7fa7c0, rb= p >=3D >>0xfffffe004b7fa7e0 --- >>propagate_priority() at propagate_priority+0x153/frame >>0xfffffe004b7fa7e0 >>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 >>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 >>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >>0xfffffe004b7fa920 >>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 >>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 >>--- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- >>Uptime: 1m38s >>Dumping 810 out of 7974 >>MB:=2E=2E2%=2E=2E12%=2E=2E22%=2E=2E32%=2E=2E42%=2E=2E52%=2E=2E62%=2E=2E7= 2%=2E=2E81%=2E=2E91%---<>--- > >This may be a simple case of increasing the kernel stack=2E I'll try this >at noon=2E Increasing kernel stack pages from 8 to 20 still results in the panic=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Aug 26 20:14:17 2019 Return-Path: Delivered-To: svn-src-head@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 7FA51E3FF6; Mon, 26 Aug 2019 20:14:17 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HNWX4Z1xz3Ms4; Mon, 26 Aug 2019 20:14:16 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 51DC58D4A13E; Mon, 26 Aug 2019 20:14:14 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3F853E7088C; Mon, 26 Aug 2019 20:14:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id qyE8TIkOAvwQ; Mon, 26 Aug 2019 20:14:11 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:28c9:afdb:7f06:b59d]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id BE28DE70824; Mon, 26 Aug 2019 20:14:10 +0000 (UTC) From: "Bjoern A. Zeeb" To: "John Baldwin" Cc: "alan somers" , "Hiroki Sato" , "Alan Somers" , "Jan Sucan" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351423 - in head: . sbin/ping6 sbin/ping6/tests Date: Mon, 26 Aug 2019 20:14:10 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: In-Reply-To: References: <201908231522.x7NFMLuJ068037@repo.freebsd.org> <20190826.042056.1329861772202588895.hrs@allbsd.org> <20190826.050922.1810654532466043358.hrs@allbsd.org> <4D99F70B-5BFD-447A-B833-D4F73CEECFF2@lists.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46HNWX4Z1xz3Ms4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2a01:4f8:13b:39f::9f:25 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-5.67 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCPT_COUNT_SEVEN(0.00)[8]; IP_SCORE(-2.40)[ip: (-8.26), ipnet: 2a01:4f8::/29(-1.96), asn: 24940(-1.79), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; FREEMAIL_CC(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 20:14:17 -0000 On 26 Aug 2019, at 16:31, John Baldwin wrote: > On 8/26/19 1:59 AM, Bjoern A. Zeeb wrote: >> In other notes (and I keep saying that), I can see a world when ping >> doesn’t exist anymore as IPv4 doesn’t exist anymore (I partially >> already live in that world). The fact that people still do not >> prepare >> themselves for this time is a bit strange to me as by the time >> FreeBSD >> 14 is still in support this IPv6-only world might very well happen >> for a >> majority of people. And FreeBSD 14-CURRENT really is only a year >> away >> now. So breaking what’s been good for almost 20 years now for a >> few >> more years doesn’t really seem to be worth to me. > > Eh, I think having 'ping' around on even IPv6 systems is sensible. > ping is not inherently version-specific in name, only ping6 is. > Having > ping not include ipv4 bits for WITHOUT_INET=yes is fine, but I think > not > having ping as a command is just nonsense. The fact that we have > ping6 > instead of ping -6 (compared to say, traceroute, ssh, etc. which all > have unified commands) is just a user-interface bug we are stuck > maintaining compatibility for, not a goal to shoot for. Yes, I think we agreed with that and the wording we are using for the current (and future) FreeBSD situation just differed. To rephrase: I think it is a good idea (especially given the startup script use it) to have a command to send ICMP echo requests for a supported protocol family. I also think it would be a good idea to preserve the legacy of ping6(8) which behaves exactly the same as the current ping6(8) even if the code is shared with ping(8) and installed as a hardlink or similar. /bz From owner-svn-src-head@freebsd.org Mon Aug 26 20:15:04 2019 Return-Path: Delivered-To: svn-src-head@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 58AA0E4083; Mon, 26 Aug 2019 20:15:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) (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 46HNXR2Xy5z3N1g; Mon, 26 Aug 2019 20:15:03 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x244.google.com with SMTP id o6so13123896oic.9; Mon, 26 Aug 2019 13:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xLrvTGGkh8LJKdFDiPtsUXoyMxMZH/8wD2h3a+v4288=; b=dwuBFAgxRFObnu/efRyE0iX0Y05KIFeGnoFwWen65ZZ47GbmmA2RSHQtfjgYbRPtxD /8IyaRn54VLNoz+K0CLP1jA7rS7rbr+tEvdLWhgwQG2cVK96X6RTl91w7ihOQb7ifBJU fyvGBDmPMxZglBa8SR+RSV4kGqFModBpTa0x5+Rre8TVe6KoQ3/xiq9tRU6H2jzw+cjt RBM7OWDU62OMUXNaKF4TnMkp3JY6dbQcQWXpcxxDR28qvZIQKivQjFqkk5e4prR617kK m7TUkqiN7tahuenAay3BeblmcNN8vKRxDROzEOJBe7k/iSy1a1nsp7Rkhzu/Wt5A4kbd ZOkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xLrvTGGkh8LJKdFDiPtsUXoyMxMZH/8wD2h3a+v4288=; b=kUpeyfIo+4gITpbnT2s/kwL4mLF6ougR9n7QEeZne5qXm9tNYCRDm6EL6PAED3HFa0 BGNmhZQtNMHfN4TzUN2vb6peF6MU1xKenabxp+ayjU8MeC6y5XPAnuE2off50JUf5uUp OARypAWkU0zpoltzx5ggaX1tU/ePKMIFg0xbbPVU0X6X14VscPmcY99zxed9E+kvCUq1 FcTOpORrWnr4bpoG7M1DbAwEzRtaWsi9xFXHudsxMsOK7+CNmpWdlgWO3JQgGzVcw3+b 7iu8epEukoQKObvN/Xyv7azEwg3Ph/rFmMbH3NY6bVxhzmLtlLFYQnIGG616KSIAdJAx KY/Q== X-Gm-Message-State: APjAAAWTVhII2jlvBoU9f8TihTeSpBU+cPvbkui6P7VaUf8OeuAk5YCx j2ESQTSH1ErchoPaEj/efT5Nil48wbcIwLNtgLdzBw== X-Google-Smtp-Source: APXvYqxcQ8ovJeG69zwV9t6wxYe2BL44uEqxp69tbpb23gEszgPC4bQddomb0D4TPD2D/DGwOJpLK1/LDA9zyZfm/H4= X-Received: by 2002:aca:ea82:: with SMTP id i124mr13367816oih.153.1566850502044; Mon, 26 Aug 2019 13:15:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Mon, 26 Aug 2019 13:15:01 -0700 (PDT) In-Reply-To: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> From: Mateusz Guzik Date: Mon, 26 Aug 2019 22:15:01 +0200 Message-ID: Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HNXR2Xy5z3N1g X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=dwuBFAgx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::244 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.38), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.2.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]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 20:15:04 -0000 Does this do the trick for you? https://people.freebsd.org/~mjg/vop_unlock-interlock.diff On 8/26/19, Cy Schubert wrote: > On August 26, 2019 8:40:50 AM PDT, Cy Schubert > wrote: >>On August 26, 2019 7:11:22 AM PDT, Cy Schubert >> wrote: >>>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy >>>Schubert wr >>>ites: >>>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik >>>wrote: >>>> >Author: mjg >>>> >Date: Sun Aug 25 05:13:15 2019 >>>> >New Revision: 351472 >>>> >URL: https://svnweb.freebsd.org/changeset/base/351472 >>>> > >>>> >Log: >>>> > nullfs: reduce areas protected by vnode interlock >>>> > >>>> >Some places only take the interlock to hold the vnode, which was a >>>> >requiremnt >>>> >before they started being manipulated with atomics. Use the newly >>>> >introduced >>>> > vholdnz to bump the count. >>>> > >>>> > Reviewed by: kib >>>> > Tested by: pho >>>> > Sponsored by: The FreeBSD Foundation >>>> > Differential Revision: https://reviews.freebsd.org/D21358 >>>> > >>>> >Modified: >>>> > head/sys/fs/nullfs/null_vnops.c >>>> > >>>> >Modified: head/sys/fs/nullfs/null_vnops.c >>>> >>>>============================================================================ >>>> == >>>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 >>2019 (r35147 >>>> 1) >>>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 >>2019 (r35147 >>>> 2) >>>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) >>>> > * We prevent it from being recycled by holding the vnode >>>> > * here. >>>> > */ >>>> >- vholdl(lvp); >>>> >+ vholdnz(lvp); >>>> > error = VOP_LOCK(lvp, flags); >>>> > >>>> > /* >>>> >@@ -710,31 +710,16 @@ static int >>>> > null_unlock(struct vop_unlock_args *ap) >>>> > { >>>> > struct vnode *vp = ap->a_vp; >>>> >- int flags = ap->a_flags; >>>> >- int mtxlkflag = 0; >>>> > struct null_node *nn; >>>> > struct vnode *lvp; >>>> > int error; >>>> > >>>> >- if ((flags & LK_INTERLOCK) != 0) >>>> >- mtxlkflag = 1; >>>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { >>>> >- VI_LOCK(vp); >>>> >- mtxlkflag = 2; >>>> >- } >>>> > nn = VTONULL(vp); >>>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { >>>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); >>>> >- flags |= LK_INTERLOCK; >>>> >- vholdl(lvp); >>>> >- VI_UNLOCK(vp); >>>> >- error = VOP_UNLOCK(lvp, flags); >>>> >+ vholdnz(lvp); >>>> >+ error = VOP_UNLOCK(lvp, 0); >>>> > vdrop(lvp); >>>> >- if (mtxlkflag == 0) >>>> >- VI_LOCK(vp); >>>> > } else { >>>> >- if (mtxlkflag == 2) >>>> >- VI_UNLOCK(vp); >>>> > error = vop_stdunlock(ap); >>>> > } >>>> > >>>> >@@ -845,10 +830,8 @@ null_getwritemount(struct >>>vop_getwritemount_args >>>> >*ap) >>>> > VI_LOCK(vp); >>>> > xp = VTONULL(vp); >>>> > if (xp && (lowervp = xp->null_lowervp)) { >>>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); >>>> >+ vholdnz(lowervp); >>>> > VI_UNLOCK(vp); >>>> >- vholdl(lowervp); >>>> >- VI_UNLOCK(lowervp); >>>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); >>>> > vdrop(lowervp); >>>> > } else { >>>> >>>> Hi mjg@, >>>> >>>> This causes trap 12 a few seconds after mountlate during boot. >>>Reverting this >>>> commit allowed it to boot. >>>> >>>> Sorry for no backtrace. I managed to >>>> revert and test just prior to rushing out to catch the bus, with no >>>time to >>>> craft a proper email. I'll post the backtrace when I arrive at work. >>> >>>Hi mjg@, >>> >>>The gory details below. Don't be fooled by the panic when yppasswd is >>>started. I was able to reproduce this panic in single user by simply >>>mounting and using a nullfs. >>> >>>kernel trap 12 with interrupts disabled >>> >>> >>>Fatal trap 12: page fault while in kernel mode >>>cpuid = 0; apic id = 00 >>>fault virtual address = 0xc >>>fault code = supervisor read data, page not present >>>instruction pointer = 0x20:0xffffffff806f0633 >>>stack pointer = 0x28:0xfffffe004b3fa7c0 >>>frame pointer = 0x28:0xfffffe004b3fa7e0 >>>code segment = base 0x0, limit 0xfffff, type 0x1b >>> = DPL 0, pres 1, long 1, def32 0, gran 1 >>>processor eflags = resume, IOPL = 0 >>>current process = 26 (syncer) >>>trap number = 12 >>>panic: page fault >>>cpuid = 0 >>>time = 1566821203 >>>KDB: stack backtrace: >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>0xfffffe004b3fa470 >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 >>>panic() at panic+0x43/frame 0xfffffe004b3fa520 >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 >>>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 >>>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp >>= >>>0xfffffe004b3fa7e0 --- >>>propagate_priority() at propagate_priority+0x153/frame >>>0xfffffe004b3fa7e0 >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >>>0xfffffe004b3fa920 >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 >>>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 >>>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 >>>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 >>>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>>Uptime: 3m25s >>>Dumping 921 out of 7974 >>>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% >>> >>>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 >>>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" >>>(OFFSETOF_CURTHREAD)); >>>(kgdb) #0 __curthread () at >>>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 >>>#1 doadump (textdump=1) at >>>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 >>>#2 0xffffffff8068aead in kern_reboot (howto=260) >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 >>>#3 0xffffffff8068b369 in vpanic (fmt=, ap=>>out>) >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 >>>#4 0xffffffff8068b163 in panic (fmt=) >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 >>>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, >>eva=12) >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 >>>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, >>>usermode=0) >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 >>>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 >>>#8 >>>#9 propagate_priority (td=0xfffff8003e43b000) >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 >>>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, >>> owner=, queue=-512) >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 >>>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, >>> v=) at >>/opt/src/svn-current/sys/kern/kern_mutex.c:654 >>>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( >>> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, >>vp=0xfffff80132e4eb40) >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 >>>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 >>>#14 0xffffffff80766206 in __mnt_vnode_next_active >>>(mvp=0xfffff80002449800, >>> mp=) at >>/opt/src/svn-current/sys/kern/vfs_subr.c:5682 >>>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 >>>#16 0xffffffff8076b4a6 in sync_fsync (ap=) >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 >>>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( >>> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) >>> at vnode_if.c:1312 >>>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, >>> td=0xfffff800061dc5a0) at ./vnode_if.h:549 >>>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, >>> slp=) at >>/opt/src/svn-current/sys/kern/vfs_subr.c:2316 >>>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 >>>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 >>>, >>> arg=0x0, frame=0xfffffe004b3faac0) >>> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 >>>#22 >>> >>> >>>dmesg output: >>> >>>Updating motd:. >>>Mounting late filesystems:. >>>Starting nscd. >>>Security policy loaded: MAC/ntpd (mac_ntpd) >>>Starting ntpd. >>>Starting yppasswdd. >>>kernel trap 12 with interrupts disabled >>> >>> >>>Fatal trap 12: page fault while in kernel mode >>>cpuid = 0; apic id = 00 >>>fault virtual address = 0xc >>>fault code = supervisor read data, page not present >>>instruction pointer = 0x20:0xffffffff806f0633 >>>stack pointer = 0x28:0xfffffe004b7fa7c0 >>>frame pointer = 0x28:0xfffffe004b7fa7e0 >>>code segment = base 0x0, limit 0xfffff, type 0x1b >>> = DPL 0, pres 1, long 1, def32 0, gran 1 >>>processor eflags = resume, IOPL = 0 >>>current process = 26 (syncer) >>>trap number = 12 >>>panic: page fault >>>cpuid = 0 >>>time = 1566820700 >>>KDB: stack backtrace: >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>0xfffffe004b7fa470 >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 >>>panic() at panic+0x43/frame 0xfffffe004b7fa520 >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 >>>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 >>>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp >>= >>>0xfffffe004b7fa7e0 --- >>>propagate_priority() at propagate_priority+0x153/frame >>>0xfffffe004b7fa7e0 >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >>>0xfffffe004b7fa920 >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>>Uptime: 1m38s >>>Dumping 810 out of 7974 >>>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- >> >>This may be a simple case of increasing the kernel stack. I'll try this >>at noon. > > Increasing kernel stack pages from 8 to 20 still results in the panic. > > > -- > Pardon the typos and autocorrect, small keyboard in use. > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Aug 26 20:15:12 2019 Return-Path: Delivered-To: svn-src-head@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 9ECEFE40BF; Mon, 26 Aug 2019 20:15:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HNXb2wGtz3N7q; Mon, 26 Aug 2019 20:15:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2LOMiqX2fSrVc2LONimzLk; Mon, 26 Aug 2019 14:15:08 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=u4J8QU_s_-lIpTMvNuEA:9 a=7rGe7H_wMalzTzRd:21 a=rQ4BupQ3IxZE0W-Y:21 a=P72zRhDHRApVOsr8:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id E0FBF3FB; Mon, 26 Aug 2019 13:15:05 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7QKF5WV050008; Mon, 26 Aug 2019 13:15:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7QKF5Q1049991; Mon, 26 Aug 2019 13:15:05 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908262015.x7QKF5Q1049991@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Mon, 26 Aug 2019 11:56:43 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 13:15:05 -0700 X-CMAE-Envelope: MS4wfD9c+PFg6rxoqmm9IKr3DJ0+D6RN4Yf4F3QPn7Z8s8yCOX2iYMXPyBoWjMEOETSrCUi90CB7fUg/D+y8i9fs9Av6VGMY7Jx8jEo981MQQIN4PauMGqcq eDTy8lt49fiJJVyyHwKUAXCnxGm1xLCkMNqjvqpJ+5U2QZLC9Z3yDku7LSIoL3KqMhN+/AR0heJqIr85El128R9HGFV1/UMLJdOKOCLYTiRdLQqkT7HMF/pO mhD0TBqxjyGgyB4S5ZqZOcCtzXQ7T/kAtG64yD6fHORbp7nm6NztzrCGkOtuXLew X-Rspamd-Queue-Id: 46HNXb2wGtz3N7q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.89 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; RCVD_IN_DNSWL_NONE(0.00)[137.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.33)[ip: (-5.95), ipnet: 64.59.128.0/20(-3.15), asn: 6327(-2.45), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 20:15:12 -0000 In message , Cy Schubert wr ites: > On August 26, 2019 8:40:50 AM PDT, Cy Schubert wr > ote: > >On August 26, 2019 7:11:22 AM PDT, Cy Schubert > > wrote: > >>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy > >>Schubert wr > >>ites: > >>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik > >>wrote: > >>> >Author: mjg > >>> >Date: Sun Aug 25 05:13:15 2019 > >>> >New Revision: 351472 > >>> >URL: https://svnweb.freebsd.org/changeset/base/351472 > >>> > > >>> >Log: > >>> > nullfs: reduce areas protected by vnode interlock > >>> > > >>> >Some places only take the interlock to hold the vnode, which was a > >>> >requiremnt > >>> >before they started being manipulated with atomics. Use the newly > >>> >introduced > >>> > vholdnz to bump the count. > >>> > > >>> > Reviewed by: kib > >>> > Tested by: pho > >>> > Sponsored by: The FreeBSD Foundation > >>> > Differential Revision: https://reviews.freebsd.org/D21358 > >>> > > >>> >Modified: > >>> > head/sys/fs/nullfs/null_vnops.c > >>> > > >>> >Modified: head/sys/fs/nullfs/null_vnops.c > >>> > >>>========================================================================== > == > >>> == > >>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 > >2019 (r35147 > >>> 1) > >>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 > >2019 (r35147 > >>> 2) > >>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > >>> > * We prevent it from being recycled by holding the vno > de > >>> > * here. > >>> > */ > >>> >- vholdl(lvp); > >>> >+ vholdnz(lvp); > >>> > error = VOP_LOCK(lvp, flags); > >>> > > >>> > /* > >>> >@@ -710,31 +710,16 @@ static int > >>> > null_unlock(struct vop_unlock_args *ap) > >>> > { > >>> > struct vnode *vp = ap->a_vp; > >>> >- int flags = ap->a_flags; > >>> >- int mtxlkflag = 0; > >>> > struct null_node *nn; > >>> > struct vnode *lvp; > >>> > int error; > >>> > > >>> >- if ((flags & LK_INTERLOCK) != 0) > >>> >- mtxlkflag = 1; > >>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { > >>> >- VI_LOCK(vp); > >>> >- mtxlkflag = 2; > >>> >- } > >>> > nn = VTONULL(vp); > >>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { > >>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); > >>> >- flags |= LK_INTERLOCK; > >>> >- vholdl(lvp); > >>> >- VI_UNLOCK(vp); > >>> >- error = VOP_UNLOCK(lvp, flags); > >>> >+ vholdnz(lvp); > >>> >+ error = VOP_UNLOCK(lvp, 0); > >>> > vdrop(lvp); > >>> >- if (mtxlkflag == 0) > >>> >- VI_LOCK(vp); > >>> > } else { > >>> >- if (mtxlkflag == 2) > >>> >- VI_UNLOCK(vp); > >>> > error = vop_stdunlock(ap); > >>> > } > >>> > > >>> >@@ -845,10 +830,8 @@ null_getwritemount(struct > >>vop_getwritemount_args > >>> >*ap) > >>> > VI_LOCK(vp); > >>> > xp = VTONULL(vp); > >>> > if (xp && (lowervp = xp->null_lowervp)) { > >>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); > >>> >+ vholdnz(lowervp); > >>> > VI_UNLOCK(vp); > >>> >- vholdl(lowervp); > >>> >- VI_UNLOCK(lowervp); > >>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > >>> > vdrop(lowervp); > >>> > } else { > >>> > >>> Hi mjg@, > >>> > >>> This causes trap 12 a few seconds after mountlate during boot. > >>Reverting this > >>> commit allowed it to boot. > >>> > >>> Sorry for no backtrace. I managed to > >>> revert and test just prior to rushing out to catch the bus, with no > >>time to > >>> craft a proper email. I'll post the backtrace when I arrive at work. > >> > >>Hi mjg@, > >> > >>The gory details below. Don't be fooled by the panic when yppasswd is > >>started. I was able to reproduce this panic in single user by simply > >>mounting and using a nullfs. > >> > >>kernel trap 12 with interrupts disabled > >> > >> > >>Fatal trap 12: page fault while in kernel mode > >>cpuid = 0; apic id = 00 > >>fault virtual address = 0xc > >>fault code = supervisor read data, page not present > >>instruction pointer = 0x20:0xffffffff806f0633 > >>stack pointer = 0x28:0xfffffe004b3fa7c0 > >>frame pointer = 0x28:0xfffffe004b3fa7e0 > >>code segment = base 0x0, limit 0xfffff, type 0x1b > >> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>processor eflags = resume, IOPL = 0 > >>current process = 26 (syncer) > >>trap number = 12 > >>panic: page fault > >>cpuid = 0 > >>time = 1566821203 > >>KDB: stack backtrace: > >>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>0xfffffe004b3fa470 > >>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 > >>panic() at panic+0x43/frame 0xfffffe004b3fa520 > >>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 > >>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 > >>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 > >>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 > >>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp > >= > >>0xfffffe004b3fa7e0 --- > >>propagate_priority() at propagate_priority+0x153/frame > >>0xfffffe004b3fa7e0 > >>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 > >>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 > >>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>0xfffffe004b3fa920 > >>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 > >>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 > >>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 > >>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 > >>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 > >>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 > >>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>Uptime: 3m25s > >>Dumping 921 out of 7974 > >>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% > >> > >>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" > >>(OFFSETOF_CURTHREAD)); > >>(kgdb) #0 __curthread () at > >>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>#1 doadump (textdump=1) at > >>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 > >>#2 0xffffffff8068aead in kern_reboot (howto=260) > >> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 > >>#3 0xffffffff8068b369 in vpanic (fmt=, ap= >>out>) > >> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 > >>#4 0xffffffff8068b163 in panic (fmt=) > >> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 > >>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, > >eva=12) > >> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 > >>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, > >>usermode=0) > >> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 > >>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) > >> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 > >>#8 > >>#9 propagate_priority (td=0xfffff8003e43b000) > >> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 > >>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, > >> owner=, queue=-512) > >> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 > >>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, > >> v=) at > >/opt/src/svn-current/sys/kern/kern_mutex.c:654 > >>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( > >> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, > >vp=0xfffff80132e4eb40) > >> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 > >>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) > >> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 > >>#14 0xffffffff80766206 in __mnt_vnode_next_active > >>(mvp=0xfffff80002449800, > >> mp=) at > >/opt/src/svn-current/sys/kern/vfs_subr.c:5682 > >>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) > >> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 > >>#16 0xffffffff8076b4a6 in sync_fsync (ap=) > >> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 > >>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( > >> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) > >> at vnode_if.c:1312 > >>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, > >> td=0xfffff800061dc5a0) at ./vnode_if.h:549 > >>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, > >> slp=) at > >/opt/src/svn-current/sys/kern/vfs_subr.c:2316 > >>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 > >>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 > >>, > >> arg=0x0, frame=0xfffffe004b3faac0) > >> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 > >>#22 > >> > >> > >>dmesg output: > >> > >>Updating motd:. > >>Mounting late filesystems:. > >>Starting nscd. > >>Security policy loaded: MAC/ntpd (mac_ntpd) > >>Starting ntpd. > >>Starting yppasswdd. > >>kernel trap 12 with interrupts disabled > >> > >> > >>Fatal trap 12: page fault while in kernel mode > >>cpuid = 0; apic id = 00 > >>fault virtual address = 0xc > >>fault code = supervisor read data, page not present > >>instruction pointer = 0x20:0xffffffff806f0633 > >>stack pointer = 0x28:0xfffffe004b7fa7c0 > >>frame pointer = 0x28:0xfffffe004b7fa7e0 > >>code segment = base 0x0, limit 0xfffff, type 0x1b > >> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>processor eflags = resume, IOPL = 0 > >>current process = 26 (syncer) > >>trap number = 12 > >>panic: page fault > >>cpuid = 0 > >>time = 1566820700 > >>KDB: stack backtrace: > >>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>0xfffffe004b7fa470 > >>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 > >>panic() at panic+0x43/frame 0xfffffe004b7fa520 > >>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 > >>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 > >>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 > >>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 > >>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp > >= > >>0xfffffe004b7fa7e0 --- > >>propagate_priority() at propagate_priority+0x153/frame > >>0xfffffe004b7fa7e0 > >>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 > >>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 > >>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>0xfffffe004b7fa920 > >>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 > >>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 > >>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>Uptime: 1m38s > >>Dumping 810 out of 7974 > >>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- > > > >This may be a simple case of increasing the kernel stack. I'll try this > >at noon. > > Increasing kernel stack pages from 8 to 20 still results in the panic. Pfft. Obviously. td->td_blocked is NULL. I've run out of noon hour but I'll put this out there even if this is half baked and not fully analyzed (got to get back to $JOB) but td->td_turnstile is NULL at frame 11. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Aug 26 20:17:49 2019 Return-Path: Delivered-To: svn-src-head@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 A9D2FE41F8; Mon, 26 Aug 2019 20:17:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HNbc3VkWz3NKj; Mon, 26 Aug 2019 20:17:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2LQuiqZ9jSrVc2LQvin03k; Mon, 26 Aug 2019 14:17:46 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=BrtT2lZyVd4BvNs1i8sA:9 a=082q3YohYhMu5kk3:21 a=dPDYV4cP5bbATGA8:21 a=8HBsMUk44bn0z0wV:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id EB01A40E; Mon, 26 Aug 2019 13:17:43 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7QKHhCV050140; Mon, 26 Aug 2019 13:17:43 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7QKHhOu050137; Mon, 26 Aug 2019 13:17:43 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908262017.x7QKHhOu050137@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> Comments: In-reply-to Mateusz Guzik message dated "Mon, 26 Aug 2019 22:15:01 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 13:17:43 -0700 X-CMAE-Envelope: MS4wfFsWrUUBPo/AqYvh+ANBXj7kpoHJa8hXII97Aw/WOIWDqCNK/cDsU7kQmyUhPKEum5zUFfPrZwWjNcMK7efud8tWp7yHCni6e8JF+okbjhVrse/QnuqI gtwPSQnfhCvLxlDKTVWd1+S6d/M+EgNDnEP+xzAYzPrxuMwtQLSrAxUfm74JvpPSisnmcFcJU8I5Ego5LiUgtH/u7IaEEj2XQud9Va9ZLNChwLPHVt1CvGr+ xMAd+KwSUuB75fPEE4UI7ppNDf+MeGrxldCnUSmKbf4= X-Rspamd-Queue-Id: 46HNbc3VkWz3NKj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.85 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; RCVD_IN_DNSWL_NONE(0.00)[139.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.28)[ip: (-5.71), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.45), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 20:17:49 -0000 Thanks. My lunch hour is over. I'll try this after I get home from $JOB. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Mateusz Guzik writes: > Does this do the trick for you? > > https://people.freebsd.org/~mjg/vop_unlock-interlock.diff > > On 8/26/19, Cy Schubert wrote: > > On August 26, 2019 8:40:50 AM PDT, Cy Schubert > > wrote: > >>On August 26, 2019 7:11:22 AM PDT, Cy Schubert > >> wrote: > >>>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy > >>>Schubert wr > >>>ites: > >>>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik > >>>wrote: > >>>> >Author: mjg > >>>> >Date: Sun Aug 25 05:13:15 2019 > >>>> >New Revision: 351472 > >>>> >URL: https://svnweb.freebsd.org/changeset/base/351472 > >>>> > > >>>> >Log: > >>>> > nullfs: reduce areas protected by vnode interlock > >>>> > > >>>> >Some places only take the interlock to hold the vnode, which was a > >>>> >requiremnt > >>>> >before they started being manipulated with atomics. Use the newly > >>>> >introduced > >>>> > vholdnz to bump the count. > >>>> > > >>>> > Reviewed by: kib > >>>> > Tested by: pho > >>>> > Sponsored by: The FreeBSD Foundation > >>>> > Differential Revision: https://reviews.freebsd.org/D21358 > >>>> > > >>>> >Modified: > >>>> > head/sys/fs/nullfs/null_vnops.c > >>>> > > >>>> >Modified: head/sys/fs/nullfs/null_vnops.c > >>>> > >>>>========================================================================= > === > >>>> == > >>>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 > >>2019 (r35147 > >>>> 1) > >>>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 > >>2019 (r35147 > >>>> 2) > >>>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > >>>> > * We prevent it from being recycled by holding the vno > de > >>>> > * here. > >>>> > */ > >>>> >- vholdl(lvp); > >>>> >+ vholdnz(lvp); > >>>> > error = VOP_LOCK(lvp, flags); > >>>> > > >>>> > /* > >>>> >@@ -710,31 +710,16 @@ static int > >>>> > null_unlock(struct vop_unlock_args *ap) > >>>> > { > >>>> > struct vnode *vp = ap->a_vp; > >>>> >- int flags = ap->a_flags; > >>>> >- int mtxlkflag = 0; > >>>> > struct null_node *nn; > >>>> > struct vnode *lvp; > >>>> > int error; > >>>> > > >>>> >- if ((flags & LK_INTERLOCK) != 0) > >>>> >- mtxlkflag = 1; > >>>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { > >>>> >- VI_LOCK(vp); > >>>> >- mtxlkflag = 2; > >>>> >- } > >>>> > nn = VTONULL(vp); > >>>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { > >>>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); > >>>> >- flags |= LK_INTERLOCK; > >>>> >- vholdl(lvp); > >>>> >- VI_UNLOCK(vp); > >>>> >- error = VOP_UNLOCK(lvp, flags); > >>>> >+ vholdnz(lvp); > >>>> >+ error = VOP_UNLOCK(lvp, 0); > >>>> > vdrop(lvp); > >>>> >- if (mtxlkflag == 0) > >>>> >- VI_LOCK(vp); > >>>> > } else { > >>>> >- if (mtxlkflag == 2) > >>>> >- VI_UNLOCK(vp); > >>>> > error = vop_stdunlock(ap); > >>>> > } > >>>> > > >>>> >@@ -845,10 +830,8 @@ null_getwritemount(struct > >>>vop_getwritemount_args > >>>> >*ap) > >>>> > VI_LOCK(vp); > >>>> > xp = VTONULL(vp); > >>>> > if (xp && (lowervp = xp->null_lowervp)) { > >>>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); > >>>> >+ vholdnz(lowervp); > >>>> > VI_UNLOCK(vp); > >>>> >- vholdl(lowervp); > >>>> >- VI_UNLOCK(lowervp); > >>>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > >>>> > vdrop(lowervp); > >>>> > } else { > >>>> > >>>> Hi mjg@, > >>>> > >>>> This causes trap 12 a few seconds after mountlate during boot. > >>>Reverting this > >>>> commit allowed it to boot. > >>>> > >>>> Sorry for no backtrace. I managed to > >>>> revert and test just prior to rushing out to catch the bus, with no > >>>time to > >>>> craft a proper email. I'll post the backtrace when I arrive at work. > >>> > >>>Hi mjg@, > >>> > >>>The gory details below. Don't be fooled by the panic when yppasswd is > >>>started. I was able to reproduce this panic in single user by simply > >>>mounting and using a nullfs. > >>> > >>>kernel trap 12 with interrupts disabled > >>> > >>> > >>>Fatal trap 12: page fault while in kernel mode > >>>cpuid = 0; apic id = 00 > >>>fault virtual address = 0xc > >>>fault code = supervisor read data, page not present > >>>instruction pointer = 0x20:0xffffffff806f0633 > >>>stack pointer = 0x28:0xfffffe004b3fa7c0 > >>>frame pointer = 0x28:0xfffffe004b3fa7e0 > >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>processor eflags = resume, IOPL = 0 > >>>current process = 26 (syncer) > >>>trap number = 12 > >>>panic: page fault > >>>cpuid = 0 > >>>time = 1566821203 > >>>KDB: stack backtrace: > >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>0xfffffe004b3fa470 > >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 > >>>panic() at panic+0x43/frame 0xfffffe004b3fa520 > >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 > >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 > >>>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 > >>>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 > >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp > >>= > >>>0xfffffe004b3fa7e0 --- > >>>propagate_priority() at propagate_priority+0x153/frame > >>>0xfffffe004b3fa7e0 > >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 > >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 > >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>>0xfffffe004b3fa920 > >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 > >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 > >>>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 > >>>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 > >>>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 > >>>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 > >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>>Uptime: 3m25s > >>>Dumping 921 out of 7974 > >>>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% > >>> > >>>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" > >>>(OFFSETOF_CURTHREAD)); > >>>(kgdb) #0 __curthread () at > >>>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>>#1 doadump (textdump=1) at > >>>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 > >>>#2 0xffffffff8068aead in kern_reboot (howto=260) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 > >>>#3 0xffffffff8068b369 in vpanic (fmt=, ap= >>>out>) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 > >>>#4 0xffffffff8068b163 in panic (fmt=) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 > >>>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, > >>eva=12) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 > >>>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, > >>>usermode=0) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 > >>>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 > >>>#8 > >>>#9 propagate_priority (td=0xfffff8003e43b000) > >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 > >>>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, > >>> owner=, queue=-512) > >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 > >>>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, > >>> v=) at > >>/opt/src/svn-current/sys/kern/kern_mutex.c:654 > >>>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( > >>> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, > >>vp=0xfffff80132e4eb40) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 > >>>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 > >>>#14 0xffffffff80766206 in __mnt_vnode_next_active > >>>(mvp=0xfffff80002449800, > >>> mp=) at > >>/opt/src/svn-current/sys/kern/vfs_subr.c:5682 > >>>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 > >>>#16 0xffffffff8076b4a6 in sync_fsync (ap=) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 > >>>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( > >>> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) > >>> at vnode_if.c:1312 > >>>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, > >>> td=0xfffff800061dc5a0) at ./vnode_if.h:549 > >>>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, > >>> slp=) at > >>/opt/src/svn-current/sys/kern/vfs_subr.c:2316 > >>>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 > >>>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 > >>>, > >>> arg=0x0, frame=0xfffffe004b3faac0) > >>> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 > >>>#22 > >>> > >>> > >>>dmesg output: > >>> > >>>Updating motd:. > >>>Mounting late filesystems:. > >>>Starting nscd. > >>>Security policy loaded: MAC/ntpd (mac_ntpd) > >>>Starting ntpd. > >>>Starting yppasswdd. > >>>kernel trap 12 with interrupts disabled > >>> > >>> > >>>Fatal trap 12: page fault while in kernel mode > >>>cpuid = 0; apic id = 00 > >>>fault virtual address = 0xc > >>>fault code = supervisor read data, page not present > >>>instruction pointer = 0x20:0xffffffff806f0633 > >>>stack pointer = 0x28:0xfffffe004b7fa7c0 > >>>frame pointer = 0x28:0xfffffe004b7fa7e0 > >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>processor eflags = resume, IOPL = 0 > >>>current process = 26 (syncer) > >>>trap number = 12 > >>>panic: page fault > >>>cpuid = 0 > >>>time = 1566820700 > >>>KDB: stack backtrace: > >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>0xfffffe004b7fa470 > >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 > >>>panic() at panic+0x43/frame 0xfffffe004b7fa520 > >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 > >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 > >>>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 > >>>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 > >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp > >>= > >>>0xfffffe004b7fa7e0 --- > >>>propagate_priority() at propagate_priority+0x153/frame > >>>0xfffffe004b7fa7e0 > >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 > >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 > >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>>0xfffffe004b7fa920 > >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 > >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 > >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>>Uptime: 1m38s > >>>Dumping 810 out of 7974 > >>>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- > >> > >>This may be a simple case of increasing the kernel stack. I'll try this > >>at noon. > > > > Increasing kernel stack pages from 8 to 20 still results in the panic. > > > > > > -- > > Pardon the typos and autocorrect, small keyboard in use. > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Aug 26 20:20:11 2019 Return-Path: Delivered-To: svn-src-head@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 244CBE42EC; Mon, 26 Aug 2019 20:20:11 +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 46HNfM0Cb5z3NVZ; Mon, 26 Aug 2019 20:20:11 +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 DCFC5B7A9; Mon, 26 Aug 2019 20:20:10 +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 x7QKKA5A021699; Mon, 26 Aug 2019 20:20:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7QKKAtS021698; Mon, 26 Aug 2019 20:20:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908262020.x7QKKAtS021698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 26 Aug 2019 20:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351518 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 351518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 20:20:11 -0000 Author: markj Date: Mon Aug 26 20:20:10 2019 New Revision: 351518 URL: https://svnweb.freebsd.org/changeset/base/351518 Log: Fix a few nits in vm_pqbatch_process_page(). - Don't bother masking off non-queue state flags when loading the page's atomic state, since it is only required for one of the function's assertions. Update the assertion instead. - Remove an incorrect comment regarding synchronization with the page daemon. The page daemon only ever checks for PGA_ENQUEUED with the page queue lock held. - When clearing requeue flags, only clear the flags that have been acted upon. Reviewed by: kib (previous version) Discussed with: alc Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21368 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Aug 26 18:57:29 2019 (r351517) +++ head/sys/vm/vm_page.c Mon Aug 26 20:20:10 2019 (r351518) @@ -3081,9 +3081,10 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa * the page queue lock held. In this case it is about to free the page, * which must not have any queue state. */ - qflags = atomic_load_8(&m->aflags) & PGA_QUEUE_STATE_MASK; - KASSERT(pq == vm_page_pagequeue(m) || qflags == 0, - ("page %p doesn't belong to queue %p but has queue state %#x", + qflags = atomic_load_8(&m->aflags); + KASSERT(pq == vm_page_pagequeue(m) || + (qflags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p doesn't belong to queue %p but has aflags %#x", m, pq, qflags)); if ((qflags & PGA_DEQUEUE) != 0) { @@ -3097,6 +3098,13 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa vm_pagequeue_cnt_inc(pq); vm_page_aflag_set(m, PGA_ENQUEUED); } + + /* + * Give PGA_REQUEUE_HEAD precedence over PGA_REQUEUE. + * In particular, if both flags are set in close succession, + * only PGA_REQUEUE_HEAD will be applied, even if it was set + * first. + */ if ((qflags & PGA_REQUEUE_HEAD) != 0) { KASSERT(m->queue == PQ_INACTIVE, ("head enqueue not supported for page %p", m)); @@ -3105,12 +3113,8 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa } else TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - /* - * PGA_REQUEUE and PGA_REQUEUE_HEAD must be cleared after - * setting PGA_ENQUEUED in order to synchronize with the - * page daemon. - */ - vm_page_aflag_clear(m, PGA_REQUEUE | PGA_REQUEUE_HEAD); + vm_page_aflag_clear(m, qflags & (PGA_REQUEUE | + PGA_REQUEUE_HEAD)); } } From owner-svn-src-head@freebsd.org Mon Aug 26 22:00:41 2019 Return-Path: Delivered-To: svn-src-head@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 714CBE63DB; Mon, 26 Aug 2019 22:00:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 46HQtK2P3sz3yQ1; Mon, 26 Aug 2019 22:00:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id l7so41296588ioj.6; Mon, 26 Aug 2019 15:00:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=3rLu+6wFnU1khWQofdzWu+RcbeDQ9a1GxxQMonNZUD4=; b=j2R26M7cYrFBjIYKrDqBItY47elQHiBHEHOHGiArfxU5UnzYyFPVi59ylmSY2gj3BY ZNaxhkG2OsXOtfNZBi/2R8XaitWc59ArgxgXV+OHO0BcQLYD+wNqroYuWQbMelvizFnM bIbpI3uSZciWrMacMpqKLTEsRH9KjiPPLLRQ6atKwILbXHJVU+NXdvYVdFgrqmuHilKt ZaM7jK+5CrI+i3rQKs/m00LYVE4UVl6J9BR8z1aXgM1K39SySe2hxB9Si+4OImvLlTwC pm2uA+hfTVsBJvEsOSnOoh21EDKDBzJGcKK9gnQ2FtxFoK/oYebytsrkoSOVmbKbkVhk 0Sqg== X-Gm-Message-State: APjAAAUwdKw/P1dD3oT9Jq5GPdaPD2l0JvZ/DOwfhLAlJD86isLej0Dj SYHpTeBpvGh7dLPhjeP7k0Kzi/mW X-Google-Smtp-Source: APXvYqwgdxb/46ZZaA8bd2FC9YqX1HzebMekZJeG8rOEjpNEJVH82IksByr6l+5R5r3qJq9xBpX6AQ== X-Received: by 2002:a02:ba99:: with SMTP id g25mr20436076jao.20.1566856840030; Mon, 26 Aug 2019 15:00:40 -0700 (PDT) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com. [209.85.166.53]) by smtp.gmail.com with ESMTPSA id d6sm17432165iod.17.2019.08.26.15.00.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2019 15:00:39 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id p12so41304343iog.5; Mon, 26 Aug 2019 15:00:39 -0700 (PDT) X-Received: by 2002:a5d:8599:: with SMTP id f25mr26946955ioj.265.1566856839560; Mon, 26 Aug 2019 15:00:39 -0700 (PDT) MIME-Version: 1.0 References: <201908261727.x7QHRbsc020978@repo.freebsd.org> In-Reply-To: <201908261727.x7QHRbsc020978@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 26 Aug 2019 15:00:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351514 - head/sys/dev/pci To: Alexander Motin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HQtK2P3sz3yQ1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 22:00:41 -0000 Hi Alexander, On Mon, Aug 26, 2019 at 10:27 AM Alexander Motin wrote: > > Author: mav > Date: Mon Aug 26 17:27:36 2019 > New Revision: 351514 > ... > - device_printf(dev, > - "HotPlug Command Timed Out - forcing detach\n"); > - sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); > - sc->flags |= PCIB_DETACHING; > - pcib_pcie_hotplug_update(sc, 0, 0, true); > + device_printf(dev, "HotPlug Command Timed Out\n"); > + sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; If this case is expected (and it seems like it is, at least in relatively common hardware), and the kernel isn't taking an action based on it anymore (formerly, it would then cause detach), is there any reason to print a message at all? What information should a user glean from the message, or what action should be taken? It seems like Nothing and None, respectively. So perhaps it is better to not print anything in this case? Or maybe mask it behind bootverbose. Best, Conrad From owner-svn-src-head@freebsd.org Tue Aug 27 00:01:59 2019 Return-Path: Delivered-To: svn-src-head@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 8257CC08B4; Tue, 27 Aug 2019 00:01:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46HTZH2dqlz442g; Tue, 27 Aug 2019 00:01:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19358E2C1; Tue, 27 Aug 2019 00:01:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7R01w5u052435; Tue, 27 Aug 2019 00:01:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7R01vUB052426; Tue, 27 Aug 2019 00:01:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908270001.x7R01vUB052426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Aug 2019 00:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/tools/switch_tls X-SVN-Commit-Revision: 351522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 00:01:59 -0000 Author: jhb Date: Tue Aug 27 00:01:56 2019 New Revision: 351522 URL: https://svnweb.freebsd.org/changeset/base/351522 Log: Add kernel-side support for in-kernel TLS. KTLS adds support for in-kernel framing and encryption of Transport Layer Security (1.0-1.2) data on TCP sockets. KTLS only supports offload of TLS for transmitted data. Key negotation must still be performed in userland. Once completed, transmit session keys for a connection are provided to the kernel via a new TCP_TXTLS_ENABLE socket option. All subsequent data transmitted on the socket is placed into TLS frames and encrypted using the supplied keys. Any data written to a KTLS-enabled socket via write(2), aio_write(2), or sendfile(2) is assumed to be application data and is encoded in TLS frames with an application data type. Individual records can be sent with a custom type (e.g. handshake messages) via sendmsg(2) with a new control message (TLS_SET_RECORD_TYPE) specifying the record type. At present, rekeying is not supported though the in-kernel framework should support rekeying. KTLS makes use of the recently added unmapped mbufs to store TLS frames in the socket buffer. Each TLS frame is described by a single ext_pgs mbuf. The ext_pgs structure contains the header of the TLS record (and trailer for encrypted records) as well as references to the associated TLS session. KTLS supports two primary methods of encrypting TLS frames: software TLS and ifnet TLS. Software TLS marks mbufs holding socket data as not ready via M_NOTREADY similar to sendfile(2) when TLS framing information is added to an unmapped mbuf in ktls_frame(). ktls_enqueue() is then called to schedule TLS frames for encryption. In the case of sendfile_iodone() calls ktls_enqueue() instead of pru_ready() leaving the mbufs marked M_NOTREADY until encryption is completed. For other writes (vn_sendfile when pages are available, write(2), etc.), the PRUS_NOTREADY is set when invoking pru_send() along with invoking ktls_enqueue(). A pool of worker threads (the "KTLS" kernel process) encrypts TLS frames queued via ktls_enqueue(). Each TLS frame is temporarily mapped using the direct map and passed to a software encryption backend to perform the actual encryption. (Note: The use of PHYS_TO_DMAP could be replaced with sf_bufs if someone wished to make this work on architectures without a direct map.) KTLS supports pluggable software encryption backends. Internally, Netflix uses proprietary pure-software backends. This commit includes a simple backend in a new ktls_ocf.ko module that uses the kernel's OpenCrypto framework to provide AES-GCM encryption of TLS frames. As a result, software TLS is now a bit of a misnomer as it can make use of hardware crypto accelerators. Once software encryption has finished, the TLS frame mbufs are marked ready via pru_ready(). At this point, the encrypted data appears as regular payload to the TCP stack stored in unmapped mbufs. ifnet TLS permits a NIC to offload the TLS encryption and TCP segmentation. In this mode, a new send tag type (IF_SND_TAG_TYPE_TLS) is allocated on the interface a socket is routed over and associated with a TLS session. TLS records for a TLS session using ifnet TLS are not marked M_NOTREADY but are passed down the stack unencrypted. The ip_output_send() and ip6_output_send() helper functions that apply send tags to outbound IP packets verify that the send tag of the TLS record matches the outbound interface. If so, the packet is tagged with the TLS send tag and sent to the interface. The NIC device driver must recognize packets with the TLS send tag and schedule them for TLS encryption and TCP segmentation. If the the outbound interface does not match the interface in the TLS send tag, the packet is dropped. In addition, a task is scheduled to refresh the TLS send tag for the TLS session. If a new TLS send tag cannot be allocated, the connection is dropped. If a new TLS send tag is allocated, however, subsequent packets will be tagged with the correct TLS send tag. (This latter case has been tested by configuring both ports of a Chelsio T6 in a lagg and failing over from one port to another. As the connections migrated to the new port, new TLS send tags were allocated for the new port and connections resumed without being dropped.) ifnet TLS can be enabled and disabled on supported network interfaces via new '[-]txtls[46]' options to ifconfig(8). ifnet TLS is supported across both vlan devices and lagg interfaces using failover, lacp with flowid enabled, or lacp with flowid enabled. Applications may request the current KTLS mode of a connection via a new TCP_TXTLS_MODE socket option. They can also use this socket option to toggle between software and ifnet TLS modes. In addition, a testing tool is available in tools/tools/switch_tls. This is modeled on tcpdrop and uses similar syntax. However, instead of dropping connections, -s is used to force KTLS connections to switch to software TLS and -i is used to switch to ifnet TLS. Various sysctls and counters are available under the kern.ipc.tls sysctl node. The kern.ipc.tls.enable node must be set to true to enable KTLS (it is off by default). The use of unmapped mbufs must also be enabled via kern.ipc.mb_use_ext_pgs to enable KTLS. KTLS is enabled via the KERN_TLS kernel option. This patch is the culmination of years of work by several folks including Scott Long and Randall Stewart for the original design and implementation; Drew Gallatin for several optimizations including the use of ext_pgs mbufs, the M_NOTREADY mechanism for TLS records awaiting software encryption, and pluggable software crypto backends; and John Baldwin for modifications to support hardware TLS offload. Reviewed by: gallatin, hselasky, rrs Obtained from: Netflix Sponsored by: Netflix, Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21277 Added: head/sys/kern/uipc_ktls.c (contents, props changed) head/sys/modules/ktls_ocf/ head/sys/modules/ktls_ocf/Makefile (contents, props changed) head/sys/opencrypto/ktls_ocf.c (contents, props changed) head/sys/sys/ktls.h (contents, props changed) head/tools/tools/switch_tls/ head/tools/tools/switch_tls/Makefile (contents, props changed) head/tools/tools/switch_tls/switch_tls.c (contents, props changed) Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/share/man/man4/tcp.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/modules/Makefile head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if.h head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/netinet/ip_output.c head/sys/netinet/tcp.h head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/netinet6/ip6_output.c head/sys/sys/mbuf.h head/sys/sys/param.h head/sys/sys/sockbuf.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Aug 26 21:00:14 2019 (r351521) +++ head/sbin/ifconfig/ifconfig.8 Tue Aug 27 00:01:56 2019 (r351522) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd August 15, 2019 +.Dd August 26, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -538,6 +538,28 @@ large receive offloading, enable LRO on the interface. If the driver supports .Xr tcp 4 large receive offloading, disable LRO on the interface. +.It Cm txtls +Transmit TLS offload encrypts Transport Layer Security (TLS) records and +segments the encrypted record into one or more +.Xr tcp 4 +segments over either +.Xr ip 4 +or +.Xr ip6 4 . +If the driver supports transmit TLS offload, +enable transmit TLS offload on the interface. +Some drivers may not be able to support transmit TLS offload for +.Xr ip 4 +and +.Xr ip6 4 +packets, so they may enable only one of them. +.It Fl txtls +If the driver supports transmit TLS offload, +disable transmit TLS offload on the interface. +It will always disable TLS for +.Xr ip 4 +and +.Xr ip6 4 . .It Cm nomap If the driver supports unmapped network buffers, enable them on the interface. Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Mon Aug 26 21:00:14 2019 (r351521) +++ head/sbin/ifconfig/ifconfig.c Tue Aug 27 00:01:56 2019 (r351522) @@ -1257,7 +1257,7 @@ unsetifdescr(const char *val, int value, int s, const "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" /* * Print the status of the interface. If an address family was @@ -1585,6 +1585,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-toe", -IFCAP_TOE, setifcap), DEF_CMD("lro", IFCAP_LRO, setifcap), DEF_CMD("-lro", -IFCAP_LRO, setifcap), + DEF_CMD("txtls", IFCAP_TXTLS, setifcap), + DEF_CMD("-txtls", -IFCAP_TXTLS, setifcap), DEF_CMD("wol", IFCAP_WOL, setifcap), DEF_CMD("-wol", -IFCAP_WOL, setifcap), DEF_CMD("wol_ucast", IFCAP_WOL_UCAST, setifcap), Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Aug 26 21:00:14 2019 (r351521) +++ head/share/man/man4/tcp.4 Tue Aug 27 00:01:56 2019 (r351522) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd July 23, 2019 +.Dd August 26, 2019 .Dt TCP 4 .Os .Sh NAME @@ -293,6 +293,51 @@ If an SADB entry cannot be found for the destination, the system does not send any outgoing segments and drops any inbound segments. .Pp Each dropped segment is taken into account in the TCP protocol statistics. +.It Dv TCP_TXTLS_ENABLE +Enable in-kernel Transport Layer Security (TLS) for data written to this +socket. +The +.Vt struct tls_so_enable +argument defines the encryption and authentication algorithms and keys +used to encrypt the socket data as well as the maximum TLS record +payload size. +.Pp +All data written to this socket will be encapsulated in TLS records +and subsequently encrypted. +By default all data written to this socket is treated as application data. +Individual TLS records with a type other than application data +(for example, handshake messages), +may be transmitted by invoking +.Xr sendmsg 2 +with a custom TLS record type set in a +.Dv TLS_SET_RECORD_TYPE +control message. +The payload of this control message is a single byte holding the desired +TLS record type. +.Pp +Data read from this socket will still be encrypted and must be parsed by +a TLS-aware consumer. +.Pp +At present, only a single key may be set on a socket. +As such, users of this option must disable rekeying. +.It Dv TCP_TXTLS_MODE +The integer argument can be used to get or set the current TLS mode of a +socket. +Setting the mode can only used to toggle between software and NIC TLS after +TLS has been initially enabled via the +.Dv TCP_TXTLS_ENABLE +option. +The available modes are: +.Bl -tag -width "Dv TCP_TLS_MODE_IFNET" +.It Dv TCP_TLS_MODE_NONE +In-kernel TLS framing and encryption is not enabled for this socket. +.It Dv TCP_TLS_MODE_SW +TLS records are encrypted by the kernel prior to placing the data in the +socket buffer. +Typically this encryption is performed in software. +.It Dv TCP_TLS_MODE_IFNET +TLS records are encrypted by the network interface card (NIC). +.El .El .Pp The option level for the Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 26 21:00:14 2019 (r351521) +++ head/sys/conf/NOTES Tue Aug 27 00:01:56 2019 (r351522) @@ -654,6 +654,10 @@ options IPSEC #IP security (requires device crypto) options IPSEC_SUPPORT #options IPSEC_DEBUG #debug for IP security + +# TLS framing and encryption of data transmitted over TCP sockets. +options KERN_TLS # TLS transmit offload + # # SMB/CIFS requester # NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Aug 26 21:00:14 2019 (r351521) +++ head/sys/conf/files Tue Aug 27 00:01:56 2019 (r351522) @@ -3862,6 +3862,7 @@ kern/tty_ttydisc.c standard kern/uipc_accf.c standard kern/uipc_debug.c optional ddb kern/uipc_domain.c standard +kern/uipc_ktls.c optional kern_tls kern/uipc_mbuf.c standard kern/uipc_mbuf2.c standard kern/uipc_mbufhash.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Aug 26 21:00:14 2019 (r351521) +++ head/sys/conf/options Tue Aug 27 00:01:56 2019 (r351522) @@ -435,6 +435,7 @@ IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h IPSEC_SUPPORT opt_ipsec.h IPSTEALTH +KERN_TLS KRPC LIBALIAS LIBMCHAIN Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Aug 26 21:00:14 2019 (r351521) +++ head/sys/kern/kern_mbuf.c Tue Aug 27 00:01:56 2019 (r351522) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" +#include "opt_kern_tls.h" #include #include @@ -41,10 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -112,10 +115,10 @@ int nmbjumbop; /* limits number of page size jumbo c int nmbjumbo9; /* limits number of 9k jumbo clusters */ int nmbjumbo16; /* limits number of 16k jumbo clusters */ -bool mb_use_ext_pgs; /* use EXT_PGS mbufs for sendfile */ +bool mb_use_ext_pgs; /* use EXT_PGS mbufs for sendfile & TLS */ SYSCTL_BOOL(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLFLAG_RWTUN, &mb_use_ext_pgs, 0, - "Use unmapped mbufs for sendfile(2)"); + "Use unmapped mbufs for sendfile(2) and TLS offload"); static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ @@ -1281,13 +1284,27 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_jumbo16, m->m_ext.ext_buf); uma_zfree(zone_mbuf, mref); break; - case EXT_PGS: + case EXT_PGS: { +#ifdef KERN_TLS + struct mbuf_ext_pgs *pgs; + struct ktls_session *tls; +#endif + KASSERT(mref->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); mref->m_ext.ext_free(mref); - uma_zfree(zone_extpgs, mref->m_ext.ext_pgs); +#ifdef KERN_TLS + pgs = mref->m_ext.ext_pgs; + tls = pgs->tls; + if (tls != NULL && + !refcount_release_if_not_last(&tls->refcount)) + ktls_enqueue_to_free(pgs); + else +#endif + uma_zfree(zone_extpgs, mref->m_ext.ext_pgs); uma_zfree(zone_mbuf, mref); break; + } case EXT_SFBUF: case EXT_NET_DRV: case EXT_MOD_TYPE: Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Mon Aug 26 21:00:14 2019 (r351521) +++ head/sys/kern/kern_sendfile.c Tue Aug 27 00:01:56 2019 (r351522) @@ -30,12 +30,15 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kern_tls.h" + #include #include #include #include #include #include +#include #include #include #include @@ -85,6 +88,7 @@ struct sf_io { int npages; struct socket *so; struct mbuf *m; + struct ktls_session *tls; vm_page_t pa[]; }; @@ -262,6 +266,15 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i if (!refcount_release(&sfio->nios)) return; +#ifdef INVARIANTS + if ((sfio->m->m_flags & M_EXT) != 0 && + sfio->m->m_ext.ext_type == EXT_PGS) + KASSERT(sfio->tls == sfio->m->m_ext.ext_pgs->tls, + ("TLS session mismatch")); + else + KASSERT(sfio->tls == NULL, + ("non-ext_pgs mbuf with TLS session")); +#endif CURVNET_SET(so->so_vnet); if (sfio->error) { /* @@ -279,12 +292,29 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i so->so_error = EIO; mb_free_notready(sfio->m, sfio->npages); +#ifdef KERN_TLS + } else if (sfio->tls != NULL && sfio->tls->sw_encrypt != NULL) { + /* + * I/O operation is complete, but we still need to + * encrypt. We cannot do this in the interrupt thread + * of the disk controller, so forward the mbufs to a + * different thread. + * + * Donate the socket reference from sfio to rather + * than explicitly invoking soref(). + */ + ktls_enqueue(sfio->m, so, sfio->npages); + goto out_with_ref; +#endif } else (void)(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, sfio->npages); SOCK_LOCK(so); sorele(so); +#ifdef KERN_TLS +out_with_ref: +#endif CURVNET_RESTORE(); free(sfio, M_TEMP); } @@ -526,6 +556,9 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h struct vnode *vp; struct vm_object *obj; struct socket *so; +#ifdef KERN_TLS + struct ktls_session *tls; +#endif struct mbuf_ext_pgs *ext_pgs; struct mbuf *m, *mh, *mhtail; struct sf_buf *sf; @@ -534,12 +567,18 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h struct vattr va; off_t off, sbytes, rem, obj_size; int bsize, error, ext_pgs_idx, hdrlen, max_pgs, softerr; +#ifdef KERN_TLS + int tls_enq_cnt; +#endif bool use_ext_pgs; obj = NULL; so = NULL; m = mh = NULL; sfs = NULL; +#ifdef KERN_TLS + tls = NULL; +#endif hdrlen = sbytes = 0; softerr = 0; use_ext_pgs = false; @@ -576,6 +615,9 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h * we implement that, but possibly shouldn't. */ (void)sblock(&so->so_snd, SBL_WAIT | SBL_NOINTR); +#ifdef KERN_TLS + tls = ktls_hold(so->so_snd.sb_tls_info); +#endif /* * Loop through the pages of the file, starting with the requested @@ -669,7 +711,14 @@ retry_space: if (hdr_uio != NULL && hdr_uio->uio_resid > 0) { hdr_uio->uio_td = td; hdr_uio->uio_rw = UIO_WRITE; - mh = m_uiotombuf(hdr_uio, M_WAITOK, space, 0, 0); +#ifdef KERN_TLS + if (tls != NULL) + mh = m_uiotombuf(hdr_uio, M_WAITOK, space, + tls->params.max_frame_len, M_NOMAP); + else +#endif + mh = m_uiotombuf(hdr_uio, M_WAITOK, + space, 0, 0); hdrlen = m_length(mh, &mhtail); space -= hdrlen; /* @@ -743,6 +792,15 @@ retry_space: sfio->so = so; sfio->error = 0; +#ifdef KERN_TLS + /* + * This doesn't use ktls_hold() because sfio->m will + * also have a reference on 'tls' that will be valid + * for all of sfio's lifetime. + */ + sfio->tls = tls; +#endif + error = sendfile_swapin(obj, sfio, &nios, off, space, npages, rhpages, flags); if (error != 0) { @@ -763,11 +821,22 @@ retry_space: * bufs are restricted to TCP as that is what has been * tested. In particular, unmapped mbufs have not * been tested with UNIX-domain sockets. + * + * TLS frames always require unmapped mbufs. */ - if (mb_use_ext_pgs && - so->so_proto->pr_protocol == IPPROTO_TCP) { + if ((mb_use_ext_pgs && + so->so_proto->pr_protocol == IPPROTO_TCP) +#ifdef KERN_TLS + || tls != NULL +#endif + ) { use_ext_pgs = true; - max_pgs = MBUF_PEXT_MAX_PGS; +#ifdef KERN_TLS + if (tls != NULL) + max_pgs = num_pages(tls->params.max_frame_len); + else +#endif + max_pgs = MBUF_PEXT_MAX_PGS; /* Start at last index, to wrap on first use. */ ext_pgs_idx = max_pgs - 1; @@ -946,6 +1015,14 @@ prepend_header: __func__, m_length(m, NULL), space, hdrlen)); CURVNET_SET(so->so_vnet); +#ifdef KERN_TLS + if (tls != NULL) { + error = ktls_frame(m, tls, &tls_enq_cnt, + TLS_RLTYPE_APP); + if (error != 0) + goto done; + } +#endif if (nios == 0) { /* * If sendfile_swapin() didn't initiate any I/Os, @@ -954,8 +1031,16 @@ prepend_header: * PRUS_NOTREADY flag. */ free(sfio, M_TEMP); - error = (*so->so_proto->pr_usrreqs->pru_send) - (so, 0, m, NULL, NULL, td); +#ifdef KERN_TLS + if (tls != NULL && tls->sw_encrypt != NULL) { + error = (*so->so_proto->pr_usrreqs->pru_send) + (so, PRUS_NOTREADY, m, NULL, NULL, td); + soref(so); + ktls_enqueue(m, so, tls_enq_cnt); + } else +#endif + error = (*so->so_proto->pr_usrreqs->pru_send) + (so, 0, m, NULL, NULL, td); } else { sfio->npages = npages; soref(so); @@ -1019,6 +1104,10 @@ out: mtx_destroy(&sfs->mtx); free(sfs, M_TEMP); } +#ifdef KERN_TLS + if (tls != NULL) + ktls_free(tls); +#endif if (error == ERESTART) error = EINTR; Added: head/sys/kern/uipc_ktls.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/uipc_ktls.c Tue Aug 27 00:01:56 2019 (r351522) @@ -0,0 +1,1450 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2014-2019 Netflix Inc. + * + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_rss.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) +#include +#endif +#include +#ifdef RSS +#include +#include +#endif +#if defined(INET) || defined(INET6) +#include +#include +#endif +#include +#include +#include +#include +#include +#include + +struct ktls_wq { + struct mtx mtx; + STAILQ_HEAD(, mbuf_ext_pgs) head; + bool running; +} __aligned(CACHE_LINE_SIZE); + +static struct ktls_wq *ktls_wq; +static struct proc *ktls_proc; +LIST_HEAD(, ktls_crypto_backend) ktls_backends; +static struct rmlock ktls_backends_lock; +static uma_zone_t ktls_session_zone; +static uint16_t ktls_cpuid_lookup[MAXCPU]; + +SYSCTL_NODE(_kern_ipc, OID_AUTO, tls, CTLFLAG_RW, 0, + "Kernel TLS offload"); +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, stats, CTLFLAG_RW, 0, + "Kernel TLS offload stats"); + +static int ktls_allow_unload; +SYSCTL_INT(_kern_ipc_tls, OID_AUTO, allow_unload, CTLFLAG_RDTUN, + &ktls_allow_unload, 0, "Allow software crypto modules to unload"); + +#ifdef RSS +static int ktls_bind_threads = 1; +#else +static int ktls_bind_threads; +#endif +SYSCTL_INT(_kern_ipc_tls, OID_AUTO, bind_threads, CTLFLAG_RDTUN, + &ktls_bind_threads, 0, + "Bind crypto threads to cores or domains at boot"); + +static u_int ktls_maxlen = 16384; +SYSCTL_UINT(_kern_ipc_tls, OID_AUTO, maxlen, CTLFLAG_RWTUN, + &ktls_maxlen, 0, "Maximum TLS record size"); + +static int ktls_number_threads; +SYSCTL_INT(_kern_ipc_tls_stats, OID_AUTO, threads, CTLFLAG_RD, + &ktls_number_threads, 0, + "Number of TLS threads in thread-pool"); + +static bool ktls_offload_enable; +SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, enable, CTLFLAG_RW, + &ktls_offload_enable, 0, + "Enable support for kernel TLS offload"); + +static bool ktls_cbc_enable = true; +SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, cbc_enable, CTLFLAG_RW, + &ktls_cbc_enable, 1, + "Enable Support of AES-CBC crypto for kernel TLS"); + +static counter_u64_t ktls_tasks_active; +SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, + &ktls_tasks_active, "Number of active tasks"); + +static counter_u64_t ktls_cnt_on; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, so_inqueue, CTLFLAG_RD, + &ktls_cnt_on, "Number of TLS records in queue to tasks for SW crypto"); + +static counter_u64_t ktls_offload_total; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, offload_total, + CTLFLAG_RD, &ktls_offload_total, + "Total successful TLS setups (parameters set)"); + +static counter_u64_t ktls_offload_enable_calls; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, enable_calls, + CTLFLAG_RD, &ktls_offload_enable_calls, + "Total number of TLS enable calls made"); + +static counter_u64_t ktls_offload_active; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, active, CTLFLAG_RD, + &ktls_offload_active, "Total Active TLS sessions"); + +static counter_u64_t ktls_offload_failed_crypto; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, failed_crypto, CTLFLAG_RD, + &ktls_offload_failed_crypto, "Total TLS crypto failures"); + +static counter_u64_t ktls_switch_to_ifnet; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_to_ifnet, CTLFLAG_RD, + &ktls_switch_to_ifnet, "TLS sessions switched from SW to ifnet"); + +static counter_u64_t ktls_switch_to_sw; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_to_sw, CTLFLAG_RD, + &ktls_switch_to_sw, "TLS sessions switched from ifnet to SW"); + +static counter_u64_t ktls_switch_failed; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_failed, CTLFLAG_RD, + &ktls_switch_failed, "TLS sessions unable to switch between SW and ifnet"); + +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, sw, CTLFLAG_RD, 0, + "Software TLS session stats"); +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, ifnet, CTLFLAG_RD, 0, + "Hardware (ifnet) TLS session stats"); + +static counter_u64_t ktls_sw_cbc; +SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, cbc, CTLFLAG_RD, &ktls_sw_cbc, + "Active number of software TLS sessions using AES-CBC"); + +static counter_u64_t ktls_sw_gcm; +SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, gcm, CTLFLAG_RD, &ktls_sw_gcm, + "Active number of software TLS sessions using AES-GCM"); + +static counter_u64_t ktls_ifnet_cbc; +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, cbc, CTLFLAG_RD, + &ktls_ifnet_cbc, + "Active number of ifnet TLS sessions using AES-CBC"); + +static counter_u64_t ktls_ifnet_gcm; +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, gcm, CTLFLAG_RD, + &ktls_ifnet_gcm, + "Active number of ifnet TLS sessions using AES-GCM"); + +static counter_u64_t ktls_ifnet_reset; +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset, CTLFLAG_RD, + &ktls_ifnet_reset, "TLS sessions updated to a new ifnet send tag"); + +static counter_u64_t ktls_ifnet_reset_dropped; +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset_dropped, CTLFLAG_RD, + &ktls_ifnet_reset_dropped, + "TLS sessions dropped after failing to update ifnet send tag"); + +static counter_u64_t ktls_ifnet_reset_failed; +SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset_failed, CTLFLAG_RD, + &ktls_ifnet_reset_failed, + "TLS sessions that failed to allocate a new ifnet send tag"); + +static int ktls_ifnet_permitted; +SYSCTL_UINT(_kern_ipc_tls_ifnet, OID_AUTO, permitted, CTLFLAG_RWTUN, + &ktls_ifnet_permitted, 1, + "Whether to permit hardware (ifnet) TLS sessions"); + +static MALLOC_DEFINE(M_KTLS, "ktls", "Kernel TLS"); + +static void ktls_cleanup(struct ktls_session *tls); +#if defined(INET) || defined(INET6) +static void ktls_reset_send_tag(void *context, int pending); +#endif +static void ktls_work_thread(void *ctx); + +int +ktls_crypto_backend_register(struct ktls_crypto_backend *be) +{ + struct ktls_crypto_backend *curr_be, *tmp; + + if (be->api_version != KTLS_API_VERSION) { + printf("KTLS: API version mismatch (%d vs %d) for %s\n", + be->api_version, KTLS_API_VERSION, + be->name); + return (EINVAL); + } + + rm_wlock(&ktls_backends_lock); + printf("KTLS: Registering crypto method %s with prio %d\n", + be->name, be->prio); + if (LIST_EMPTY(&ktls_backends)) { + LIST_INSERT_HEAD(&ktls_backends, be, next); + } else { + LIST_FOREACH_SAFE(curr_be, &ktls_backends, next, tmp) { + if (curr_be->prio < be->prio) { + LIST_INSERT_BEFORE(curr_be, be, next); + break; + } + if (LIST_NEXT(curr_be, next) == NULL) { + LIST_INSERT_AFTER(curr_be, be, next); + break; + } + } + } + rm_wunlock(&ktls_backends_lock); + return (0); +} + +int +ktls_crypto_backend_deregister(struct ktls_crypto_backend *be) +{ + struct ktls_crypto_backend *tmp; + + /* + * Don't error if the backend isn't registered. This permits + * MOD_UNLOAD handlers to use this function unconditionally. + */ + rm_wlock(&ktls_backends_lock); + LIST_FOREACH(tmp, &ktls_backends, next) { + if (tmp == be) + break; + } + if (tmp == NULL) { + rm_wunlock(&ktls_backends_lock); + return (0); + } + + if (!ktls_allow_unload) { + rm_wunlock(&ktls_backends_lock); + printf( + "KTLS: Deregistering crypto method %s is not supported\n", + be->name); + return (EBUSY); + } + + if (be->use_count) { + rm_wunlock(&ktls_backends_lock); + return (EBUSY); + } + + LIST_REMOVE(be, next); + rm_wunlock(&ktls_backends_lock); + return (0); +} + +#if defined(INET) || defined(INET6) +static uint16_t +ktls_get_cpu(struct socket *so) +{ + struct inpcb *inp; + uint16_t cpuid; + + inp = sotoinpcb(so); +#ifdef RSS + cpuid = rss_hash2cpuid(inp->inp_flowid, inp->inp_flowtype); + if (cpuid != NETISR_CPUID_NONE) + return (cpuid); +#endif + /* + * Just use the flowid to shard connections in a repeatable + * fashion. Note that some crypto backends rely on the + * serialization provided by having the same connection use + * the same queue. + */ + cpuid = ktls_cpuid_lookup[inp->inp_flowid % ktls_number_threads]; + return (cpuid); +} +#endif + +static void +ktls_init(void *dummy __unused) +{ + struct thread *td; + struct pcpu *pc; + cpuset_t mask; + int error, i; + + ktls_tasks_active = counter_u64_alloc(M_WAITOK); + ktls_cnt_on = counter_u64_alloc(M_WAITOK); + ktls_offload_total = counter_u64_alloc(M_WAITOK); + ktls_offload_enable_calls = counter_u64_alloc(M_WAITOK); + ktls_offload_active = counter_u64_alloc(M_WAITOK); + ktls_offload_failed_crypto = counter_u64_alloc(M_WAITOK); + ktls_switch_to_ifnet = counter_u64_alloc(M_WAITOK); + ktls_switch_to_sw = counter_u64_alloc(M_WAITOK); + ktls_switch_failed = counter_u64_alloc(M_WAITOK); + ktls_sw_cbc = counter_u64_alloc(M_WAITOK); + ktls_sw_gcm = counter_u64_alloc(M_WAITOK); + ktls_ifnet_cbc = counter_u64_alloc(M_WAITOK); + ktls_ifnet_gcm = counter_u64_alloc(M_WAITOK); + ktls_ifnet_reset = counter_u64_alloc(M_WAITOK); + ktls_ifnet_reset_dropped = counter_u64_alloc(M_WAITOK); + ktls_ifnet_reset_failed = counter_u64_alloc(M_WAITOK); + + rm_init(&ktls_backends_lock, "ktls backends"); + LIST_INIT(&ktls_backends); + + ktls_wq = malloc(sizeof(*ktls_wq) * (mp_maxid + 1), M_KTLS, + M_WAITOK | M_ZERO); + + ktls_session_zone = uma_zcreate("ktls_session", + sizeof(struct ktls_session), +#ifdef INVARIANTS + trash_ctor, trash_dtor, trash_init, trash_fini, +#else + NULL, NULL, NULL, NULL, +#endif + UMA_ALIGN_CACHE, 0); + + /* + * Initialize the workqueues to run the TLS work. We create a + * work queue for each CPU. + */ + CPU_FOREACH(i) { + STAILQ_INIT(&ktls_wq[i].head); + mtx_init(&ktls_wq[i].mtx, "ktls work queue", NULL, MTX_DEF); + error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], + &ktls_proc, &td, 0, 0, "KTLS", "ktls_thr_%d", i); + if (error) + panic("Can't add KTLS thread %d error %d", i, error); + + /* + * Bind threads to cores. If ktls_bind_threads is > + * 1, then we bind to the NUMA domain. + */ + if (ktls_bind_threads) { + if (ktls_bind_threads > 1) { + pc = pcpu_find(i); + CPU_COPY(&cpuset_domain[pc->pc_domain], &mask); + } else { + CPU_SETOF(i, &mask); + } + error = cpuset_setthread(td->td_tid, &mask); + if (error) + panic( + "Unable to bind KTLS thread for CPU %d error %d", + i, error); + } + ktls_cpuid_lookup[ktls_number_threads] = i; + ktls_number_threads++; + } + printf("KTLS: Initialized %d threads\n", ktls_number_threads); +} +SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); + +#if defined(INET) || defined(INET6) +static int +ktls_create_session(struct socket *so, struct tls_enable *en, + struct ktls_session **tlsp) +{ + struct ktls_session *tls; + int error; + + /* Only TLS 1.0 - 1.2 are supported. */ + if (en->tls_vmajor != TLS_MAJOR_VER_ONE) + return (EINVAL); + if (en->tls_vminor < TLS_MINOR_VER_ZERO || + en->tls_vminor > TLS_MINOR_VER_TWO) + return (EINVAL); + + if (en->auth_key_len < 0 || en->auth_key_len > TLS_MAX_PARAM_SIZE) + return (EINVAL); + if (en->cipher_key_len < 0 || en->cipher_key_len > TLS_MAX_PARAM_SIZE) + return (EINVAL); + if (en->iv_len < 0 || en->iv_len > TLS_MAX_PARAM_SIZE) + return (EINVAL); + + /* All supported algorithms require a cipher key. */ + if (en->cipher_key_len == 0) + return (EINVAL); + + /* No flags are currently supported. */ + if (en->flags != 0) + return (EINVAL); + + /* Common checks for supported algorithms. */ + switch (en->cipher_algorithm) { + case CRYPTO_AES_NIST_GCM_16: + /* + * auth_algorithm isn't used, but permit GMAC values + * for compatibility. + */ + switch (en->auth_algorithm) { + case 0: + case CRYPTO_AES_128_NIST_GMAC: + case CRYPTO_AES_192_NIST_GMAC: + case CRYPTO_AES_256_NIST_GMAC: + break; + default: + return (EINVAL); + } + if (en->auth_key_len != 0) + return (EINVAL); + if (en->iv_len != TLS_AEAD_GCM_LEN) + return (EINVAL); + break; + case CRYPTO_AES_CBC: + switch (en->auth_algorithm) { + case CRYPTO_SHA1_HMAC: + /* + * TLS 1.0 requires an implicit IV. TLS 1.1+ + * all use explicit IVs. + */ + if (en->tls_vminor == TLS_MINOR_VER_ZERO) { + if (en->iv_len != TLS_CBC_IMPLICIT_IV_LEN) + return (EINVAL); + break; + } + + /* FALLTHROUGH */ + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + /* Ignore any supplied IV. */ + en->iv_len = 0; + break; + default: + return (EINVAL); + } + if (en->auth_key_len == 0) + return (EINVAL); + break; + default: + return (EINVAL); + } + + tls = uma_zalloc(ktls_session_zone, M_WAITOK | M_ZERO); + + counter_u64_add(ktls_offload_active, 1); + + refcount_init(&tls->refcount, 1); + TASK_INIT(&tls->reset_tag_task, 0, ktls_reset_send_tag, tls); + + tls->wq_index = ktls_get_cpu(so); + + tls->params.cipher_algorithm = en->cipher_algorithm; + tls->params.auth_algorithm = en->auth_algorithm; + tls->params.tls_vmajor = en->tls_vmajor; + tls->params.tls_vminor = en->tls_vminor; + tls->params.flags = en->flags; + tls->params.max_frame_len = min(TLS_MAX_MSG_SIZE_V10_2, ktls_maxlen); + + /* Set the header and trailer lengths. */ + tls->params.tls_hlen = sizeof(struct tls_record_layer); + switch (en->cipher_algorithm) { + case CRYPTO_AES_NIST_GCM_16: + tls->params.tls_hlen += 8; + tls->params.tls_tlen = AES_GMAC_HASH_LEN; + tls->params.tls_bs = 1; + break; + case CRYPTO_AES_CBC: + switch (en->auth_algorithm) { + case CRYPTO_SHA1_HMAC: + if (en->tls_vminor == TLS_MINOR_VER_ZERO) { + /* Implicit IV, no nonce. */ + } else { + tls->params.tls_hlen += AES_BLOCK_LEN; + } + tls->params.tls_tlen = AES_BLOCK_LEN + + SHA1_HASH_LEN; + break; + case CRYPTO_SHA2_256_HMAC: + tls->params.tls_hlen += AES_BLOCK_LEN; + tls->params.tls_tlen = AES_BLOCK_LEN + + SHA2_256_HASH_LEN; + break; + case CRYPTO_SHA2_384_HMAC: + tls->params.tls_hlen += AES_BLOCK_LEN; + tls->params.tls_tlen = AES_BLOCK_LEN + + SHA2_384_HASH_LEN; + break; + default: + panic("invalid hmac"); + } + tls->params.tls_bs = AES_BLOCK_LEN; + break; + default: + panic("invalid cipher"); + } + + KASSERT(tls->params.tls_hlen <= MBUF_PEXT_HDR_LEN, + ("TLS header length too long: %d", tls->params.tls_hlen)); + KASSERT(tls->params.tls_tlen <= MBUF_PEXT_TRAIL_LEN, + ("TLS trailer length too long: %d", tls->params.tls_tlen)); + + if (en->auth_key_len != 0) { + tls->params.auth_key_len = en->auth_key_len; + tls->params.auth_key = malloc(en->auth_key_len, M_KTLS, + M_WAITOK); + error = copyin(en->auth_key, tls->params.auth_key, + en->auth_key_len); + if (error) + goto out; + } + + tls->params.cipher_key_len = en->cipher_key_len; + tls->params.cipher_key = malloc(en->cipher_key_len, M_KTLS, M_WAITOK); + error = copyin(en->cipher_key, tls->params.cipher_key, + en->cipher_key_len); + if (error) + goto out; + + /* + * This holds the implicit portion of the nonce for GCM and + * the initial implicit IV for TLS 1.0. The explicit portions + * of the IV are generated in ktls_frame() and ktls_seq(). + */ + if (en->iv_len != 0) { + MPASS(en->iv_len <= sizeof(tls->params.iv)); + tls->params.iv_len = en->iv_len; + error = copyin(en->iv, tls->params.iv, en->iv_len); + if (error) + goto out; + } + + *tlsp = tls; + return (0); + +out: + ktls_cleanup(tls); + return (error); +} + +static struct ktls_session * +ktls_clone_session(struct ktls_session *tls) +{ + struct ktls_session *tls_new; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 27 00:14:47 2019 Return-Path: Delivered-To: svn-src-head@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 4938CC1018; Tue, 27 Aug 2019 00:14:47 +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 46HTs31JMzz44hr; Tue, 27 Aug 2019 00:14:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 96DF71F737; Tue, 27 Aug 2019 00:14:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908270001.x7R01vUB052426@repo.freebsd.org> 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: Mon, 26 Aug 2019 17:14:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201908270001.x7R01vUB052426@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 00:14:47 -0000 On 8/26/19 5:01 PM, John Baldwin wrote: > Author: jhb > Date: Tue Aug 27 00:01:56 2019 > New Revision: 351522 > URL: https://svnweb.freebsd.org/changeset/base/351522 > > Log: > Add kernel-side support for in-kernel TLS. The length of the commit message notwithstanding, there is still quite a bit more work to do on this front. Making use of KTLS requires an SSL library that understands the new functionality, and for the full performance gain you want an application that makes use of SSL_sendfile. Netflix has both of these in the form of patches to OpenSSL and nginx. I'm currently working on a patchset suitable for merging into upstream OpenSSL's master (the Linux KTLS patches are merged into OpenSSL master already, so the FreeBSD patches are fairly small). One thing to note is that while the KTLS OCF backend in this commit is functional, it is not ideal. One of the SW crypto backends Netflix uses internally is based on Intel's ISA-L crypto library. I put together a port for this based on the public ISA-L crpyto library repository on GitHub today and hope to have it up for review soon. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 27 00:26:02 2019 Return-Path: Delivered-To: svn-src-head@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 98AE5C1419; Tue, 27 Aug 2019 00:26:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HV612dGYz45G2; Tue, 27 Aug 2019 00:26:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2PJ6itjbkSrVc2PJ8inw3Q; Mon, 26 Aug 2019 18:25:58 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=FzyXbN09CKM9lWlxBvcA:9 a=M5MHzXmQ627LDLKR:21 a=1a13K5QEN1O5AAsE:21 a=lfw7kk5U3L1hpzWQ:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 246B3568; Mon, 26 Aug 2019 17:25:56 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7R0PtEH008597; Mon, 26 Aug 2019 17:25:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7R0PtNT008594; Mon, 26 Aug 2019 17:25:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908270025.x7R0PtNT008594@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> Comments: In-reply-to Mateusz Guzik message dated "Mon, 26 Aug 2019 22:15:01 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 17:25:55 -0700 X-CMAE-Envelope: MS4wfP5ezlWols/Km8ui44eBQIj6ZE+j95xATIY0pgPhNdNg4UV2vPDquhS4IC7yDNyaWh4l+FK+74gn/dNF6dK0vzNzjVZaqLNEV8BWdIMq7Y4N2YqV7Jhs NZsF/FAVabrotJgLpzSLV61He4R1OIN3wWqCkb/8YZcIcpv7gSumt3L+LM8enOajE3TclkPM1hzV704b5Tb3wI8Gv+SnI23sljSvUiUUGOVGYC2+HVZ6/FwN NxLMORRkPxoR9hh+r2wH86wqQPn01sXaAENI9z4IqnA= X-Rspamd-Queue-Id: 46HV612dGYz45G2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; RCVD_IN_DNSWL_NONE(0.00)[139.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.27)[ip: (-5.69), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.44), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 00:26:02 -0000 It won't build. Did you intend VOP_UNLOCK(vp,LK_INTERLOCK)? --- vfs_subr.o --- /opt/src/svn-current/sys/kern/vfs_subr.c:1037:17: error: too few arguments to function call, expected 2, have 1 VOP_UNLOCK(vp); ~~~~~~~~~~ ^ ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here static __inline int VOP_UNLOCK( ^ /opt/src/svn-current/sys/kern/vfs_subr.c:1401:16: error: too few arguments to function call, expected 2, have 1 VOP_UNLOCK(vp); ~~~~~~~~~~ ^ ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here static __inline int VOP_UNLOCK( ^ /opt/src/svn-current/sys/kern/vfs_subr.c:1413:15: error: too few arguments to function call, expected 2, have 1 VOP_UNLOCK(vp); ~~~~~~~~~~ ^ ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here static __inline int VOP_UNLOCK( ^ 3 errors generated. *** [vfs_subr.o] Error code 1 make[2]: stopped in /export/obj/opt/src/svn-current/amd64.amd64/sys/BREAK -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Mateusz Guzik writes: > Does this do the trick for you? > > https://people.freebsd.org/~mjg/vop_unlock-interlock.diff > > On 8/26/19, Cy Schubert wrote: > > On August 26, 2019 8:40:50 AM PDT, Cy Schubert > > wrote: > >>On August 26, 2019 7:11:22 AM PDT, Cy Schubert > >> wrote: > >>>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy > >>>Schubert wr > >>>ites: > >>>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik > >>>wrote: > >>>> >Author: mjg > >>>> >Date: Sun Aug 25 05:13:15 2019 > >>>> >New Revision: 351472 > >>>> >URL: https://svnweb.freebsd.org/changeset/base/351472 > >>>> > > >>>> >Log: > >>>> > nullfs: reduce areas protected by vnode interlock > >>>> > > >>>> >Some places only take the interlock to hold the vnode, which was a > >>>> >requiremnt > >>>> >before they started being manipulated with atomics. Use the newly > >>>> >introduced > >>>> > vholdnz to bump the count. > >>>> > > >>>> > Reviewed by: kib > >>>> > Tested by: pho > >>>> > Sponsored by: The FreeBSD Foundation > >>>> > Differential Revision: https://reviews.freebsd.org/D21358 > >>>> > > >>>> >Modified: > >>>> > head/sys/fs/nullfs/null_vnops.c > >>>> > > >>>> >Modified: head/sys/fs/nullfs/null_vnops.c > >>>> > >>>>========================================================================= > === > >>>> == > >>>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 > >>2019 (r35147 > >>>> 1) > >>>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 > >>2019 (r35147 > >>>> 2) > >>>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > >>>> > * We prevent it from being recycled by holding the vno > de > >>>> > * here. > >>>> > */ > >>>> >- vholdl(lvp); > >>>> >+ vholdnz(lvp); > >>>> > error = VOP_LOCK(lvp, flags); > >>>> > > >>>> > /* > >>>> >@@ -710,31 +710,16 @@ static int > >>>> > null_unlock(struct vop_unlock_args *ap) > >>>> > { > >>>> > struct vnode *vp = ap->a_vp; > >>>> >- int flags = ap->a_flags; > >>>> >- int mtxlkflag = 0; > >>>> > struct null_node *nn; > >>>> > struct vnode *lvp; > >>>> > int error; > >>>> > > >>>> >- if ((flags & LK_INTERLOCK) != 0) > >>>> >- mtxlkflag = 1; > >>>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { > >>>> >- VI_LOCK(vp); > >>>> >- mtxlkflag = 2; > >>>> >- } > >>>> > nn = VTONULL(vp); > >>>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { > >>>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); > >>>> >- flags |= LK_INTERLOCK; > >>>> >- vholdl(lvp); > >>>> >- VI_UNLOCK(vp); > >>>> >- error = VOP_UNLOCK(lvp, flags); > >>>> >+ vholdnz(lvp); > >>>> >+ error = VOP_UNLOCK(lvp, 0); > >>>> > vdrop(lvp); > >>>> >- if (mtxlkflag == 0) > >>>> >- VI_LOCK(vp); > >>>> > } else { > >>>> >- if (mtxlkflag == 2) > >>>> >- VI_UNLOCK(vp); > >>>> > error = vop_stdunlock(ap); > >>>> > } > >>>> > > >>>> >@@ -845,10 +830,8 @@ null_getwritemount(struct > >>>vop_getwritemount_args > >>>> >*ap) > >>>> > VI_LOCK(vp); > >>>> > xp = VTONULL(vp); > >>>> > if (xp && (lowervp = xp->null_lowervp)) { > >>>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); > >>>> >+ vholdnz(lowervp); > >>>> > VI_UNLOCK(vp); > >>>> >- vholdl(lowervp); > >>>> >- VI_UNLOCK(lowervp); > >>>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > >>>> > vdrop(lowervp); > >>>> > } else { > >>>> > >>>> Hi mjg@, > >>>> > >>>> This causes trap 12 a few seconds after mountlate during boot. > >>>Reverting this > >>>> commit allowed it to boot. > >>>> > >>>> Sorry for no backtrace. I managed to > >>>> revert and test just prior to rushing out to catch the bus, with no > >>>time to > >>>> craft a proper email. I'll post the backtrace when I arrive at work. > >>> > >>>Hi mjg@, > >>> > >>>The gory details below. Don't be fooled by the panic when yppasswd is > >>>started. I was able to reproduce this panic in single user by simply > >>>mounting and using a nullfs. > >>> > >>>kernel trap 12 with interrupts disabled > >>> > >>> > >>>Fatal trap 12: page fault while in kernel mode > >>>cpuid = 0; apic id = 00 > >>>fault virtual address = 0xc > >>>fault code = supervisor read data, page not present > >>>instruction pointer = 0x20:0xffffffff806f0633 > >>>stack pointer = 0x28:0xfffffe004b3fa7c0 > >>>frame pointer = 0x28:0xfffffe004b3fa7e0 > >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>processor eflags = resume, IOPL = 0 > >>>current process = 26 (syncer) > >>>trap number = 12 > >>>panic: page fault > >>>cpuid = 0 > >>>time = 1566821203 > >>>KDB: stack backtrace: > >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>0xfffffe004b3fa470 > >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 > >>>panic() at panic+0x43/frame 0xfffffe004b3fa520 > >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 > >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 > >>>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 > >>>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 > >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp > >>= > >>>0xfffffe004b3fa7e0 --- > >>>propagate_priority() at propagate_priority+0x153/frame > >>>0xfffffe004b3fa7e0 > >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 > >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 > >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>>0xfffffe004b3fa920 > >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 > >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 > >>>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 > >>>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 > >>>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 > >>>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 > >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>>Uptime: 3m25s > >>>Dumping 921 out of 7974 > >>>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% > >>> > >>>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" > >>>(OFFSETOF_CURTHREAD)); > >>>(kgdb) #0 __curthread () at > >>>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >>>#1 doadump (textdump=1) at > >>>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 > >>>#2 0xffffffff8068aead in kern_reboot (howto=260) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 > >>>#3 0xffffffff8068b369 in vpanic (fmt=, ap= >>>out>) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 > >>>#4 0xffffffff8068b163 in panic (fmt=) > >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 > >>>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, > >>eva=12) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 > >>>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, > >>>usermode=0) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 > >>>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) > >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 > >>>#8 > >>>#9 propagate_priority (td=0xfffff8003e43b000) > >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 > >>>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, > >>> owner=, queue=-512) > >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 > >>>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, > >>> v=) at > >>/opt/src/svn-current/sys/kern/kern_mutex.c:654 > >>>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( > >>> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, > >>vp=0xfffff80132e4eb40) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 > >>>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 > >>>#14 0xffffffff80766206 in __mnt_vnode_next_active > >>>(mvp=0xfffff80002449800, > >>> mp=) at > >>/opt/src/svn-current/sys/kern/vfs_subr.c:5682 > >>>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 > >>>#16 0xffffffff8076b4a6 in sync_fsync (ap=) > >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 > >>>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( > >>> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) > >>> at vnode_if.c:1312 > >>>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, > >>> td=0xfffff800061dc5a0) at ./vnode_if.h:549 > >>>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, > >>> slp=) at > >>/opt/src/svn-current/sys/kern/vfs_subr.c:2316 > >>>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 > >>>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 > >>>, > >>> arg=0x0, frame=0xfffffe004b3faac0) > >>> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 > >>>#22 > >>> > >>> > >>>dmesg output: > >>> > >>>Updating motd:. > >>>Mounting late filesystems:. > >>>Starting nscd. > >>>Security policy loaded: MAC/ntpd (mac_ntpd) > >>>Starting ntpd. > >>>Starting yppasswdd. > >>>kernel trap 12 with interrupts disabled > >>> > >>> > >>>Fatal trap 12: page fault while in kernel mode > >>>cpuid = 0; apic id = 00 > >>>fault virtual address = 0xc > >>>fault code = supervisor read data, page not present > >>>instruction pointer = 0x20:0xffffffff806f0633 > >>>stack pointer = 0x28:0xfffffe004b7fa7c0 > >>>frame pointer = 0x28:0xfffffe004b7fa7e0 > >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>processor eflags = resume, IOPL = 0 > >>>current process = 26 (syncer) > >>>trap number = 12 > >>>panic: page fault > >>>cpuid = 0 > >>>time = 1566820700 > >>>KDB: stack backtrace: > >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>0xfffffe004b7fa470 > >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 > >>>panic() at panic+0x43/frame 0xfffffe004b7fa520 > >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 > >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 > >>>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 > >>>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 > >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp > >>= > >>>0xfffffe004b7fa7e0 --- > >>>propagate_priority() at propagate_priority+0x153/frame > >>>0xfffffe004b7fa7e0 > >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 > >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 > >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >>>0xfffffe004b7fa920 > >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 > >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 > >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >>>Uptime: 1m38s > >>>Dumping 810 out of 7974 > >>>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- > >> > >>This may be a simple case of increasing the kernel stack. I'll try this > >>at noon. > > > > Increasing kernel stack pages from 8 to 20 still results in the panic. > > > > > > -- > > Pardon the typos and autocorrect, small keyboard in use. > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 00:52:15 2019 Return-Path: Delivered-To: svn-src-head@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 2DC72C2081; Tue, 27 Aug 2019 00:52:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (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 46HVhG2nwYz47Rp; Tue, 27 Aug 2019 00:52:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x344.google.com with SMTP id c7so17098476otp.1; Mon, 26 Aug 2019 17:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZQdubpB58tOMYx676cpn8qULFq0/zw7MSWLyfWfd0v0=; b=VBHCxLtZ9tSFldPSuN9YIe76PeCrPn7KxtxRmjKyCn+Xu4MmWg/x1yzJQTodFbCxFB bvQpuVdvBR0PGB7m00gZtmUUHlvHfz/vhwXk2/taWOVJemsk/1HDzrWd0QNm74mgTKMh //tW31rJuf3s5gRHS/RCObkmib7LDe0wQjh/Xxp5vtAPaX1hOQNWM49dIOzTMKZCEGj7 qoi/xkmRINxx3k2wm6wL0ZPPwCkLDPuxlAVdkpeaOz1SH8TjGF2TjrYtHNoUD8Tbn0sC N6+zjpe3GTecXyiexJMeF5vdEZ7Acf4FcDgY+V+UpifeYjk9I6AvzYEKYD8xwlZ82E9k VAyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZQdubpB58tOMYx676cpn8qULFq0/zw7MSWLyfWfd0v0=; b=UWRwDYEXuSy54APE6uQ0ic2qEr+x/iL5nOmaesoLxlrmLDs9fCeBlV8QjT1fGMCm0e 2YE2NYNLjVRPdvm8dHWRE34WBqgneH4mJkOYDiqg2Pjk1cTR4T36x3bCjZfi9JWx7rSJ E06L0oux80bfS9b293r2ZaEi2syRU/ObdNbybJ7ZNq5Fj/VZ7h88cmTeACMZ8YfCmMLg p1pz9BBQzzA1p86l+DDd4Gvhp6rEI006T7jTlOIVemMWTTTgvfr4BlXlWT6UjDjapSFZ AgRCCYj5TCUKHrpyFpuRt/nI7DG3MZVzwr/x2YAmhHbjv5plAcRwsA4mF4kkQjantpum oeBg== X-Gm-Message-State: APjAAAUyeoQ5dJ7ZOwa6DPOz0wJevlY8Mauu49W8/AcR0XfaLA22pWD5 cmS4zbv9CSYZGWaS6MnVslOW6trq60UU4T6rq4R1Cg== X-Google-Smtp-Source: APXvYqwxQq7ooKgj3JBb069/27Hsa3pIdSc4pkqUXK+m6UarcaJXtRu7PS9/IQzyj+TZM3/QvkybSmb9spMl1shTEoY= X-Received: by 2002:a9d:744b:: with SMTP id p11mr16847125otk.201.1566867133173; Mon, 26 Aug 2019 17:52:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Mon, 26 Aug 2019 17:52:12 -0700 (PDT) In-Reply-To: <201908270025.x7R0PtNT008594@slippy.cwsent.com> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> From: Mateusz Guzik Date: Tue, 27 Aug 2019 02:52:12 +0200 Message-ID: Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HVhG2nwYz47Rp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VBHCxLtZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::344 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.97 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.09), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.3.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]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 00:52:15 -0000 Sorry for the half-assed patch. I have a patch to remove the flags argument and the change above was port of it. Try this please: https://people.freebsd.org/~mjg/patches/vop_unlock-interlock2.diff On 8/27/19, Cy Schubert wrote: > It won't build. Did you intend VOP_UNLOCK(vp,LK_INTERLOCK)? > > --- vfs_subr.o --- > /opt/src/svn-current/sys/kern/vfs_subr.c:1037:17: error: too few arguments > to function call, expected 2, have 1 > VOP_UNLOCK(vp); > ~~~~~~~~~~ ^ > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > static __inline int VOP_UNLOCK( > ^ > /opt/src/svn-current/sys/kern/vfs_subr.c:1401:16: error: too few arguments > to function call, expected 2, have 1 > VOP_UNLOCK(vp); > ~~~~~~~~~~ ^ > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > static __inline int VOP_UNLOCK( > ^ > /opt/src/svn-current/sys/kern/vfs_subr.c:1413:15: error: too few arguments > to function call, expected 2, have 1 > VOP_UNLOCK(vp); > ~~~~~~~~~~ ^ > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > static __inline int VOP_UNLOCK( > ^ > 3 errors generated. > *** [vfs_subr.o] Error code 1 > > make[2]: stopped in /export/obj/opt/src/svn-current/amd64.amd64/sys/BREAK > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > In message > om> > , Mateusz Guzik writes: >> Does this do the trick for you? >> >> https://people.freebsd.org/~mjg/vop_unlock-interlock.diff >> >> On 8/26/19, Cy Schubert wrote: >> > On August 26, 2019 8:40:50 AM PDT, Cy Schubert >> > >> > wrote: >> >>On August 26, 2019 7:11:22 AM PDT, Cy Schubert >> >> wrote: >> >>>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy >> >>>Schubert wr >> >>>ites: >> >>>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik >> >>>wrote: >> >>>> >Author: mjg >> >>>> >Date: Sun Aug 25 05:13:15 2019 >> >>>> >New Revision: 351472 >> >>>> >URL: https://svnweb.freebsd.org/changeset/base/351472 >> >>>> > >> >>>> >Log: >> >>>> > nullfs: reduce areas protected by vnode interlock >> >>>> > >> >>>> >Some places only take the interlock to hold the vnode, which was a >> >>>> >requiremnt >> >>>> >before they started being manipulated with atomics. Use the newly >> >>>> >introduced >> >>>> > vholdnz to bump the count. >> >>>> > >> >>>> > Reviewed by: kib >> >>>> > Tested by: pho >> >>>> > Sponsored by: The FreeBSD Foundation >> >>>> > Differential Revision: https://reviews.freebsd.org/D21358 >> >>>> > >> >>>> >Modified: >> >>>> > head/sys/fs/nullfs/null_vnops.c >> >>>> > >> >>>> >Modified: head/sys/fs/nullfs/null_vnops.c >> >>>> >> >>>>========================================================================= >> === >> >>>> == >> >>>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 >> >>2019 (r35147 >> >>>> 1) >> >>>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 >> >>2019 (r35147 >> >>>> 2) >> >>>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) >> >>>> > * We prevent it from being recycled by holding the vno >> de >> >>>> > * here. >> >>>> > */ >> >>>> >- vholdl(lvp); >> >>>> >+ vholdnz(lvp); >> >>>> > error = VOP_LOCK(lvp, flags); >> >>>> > >> >>>> > /* >> >>>> >@@ -710,31 +710,16 @@ static int >> >>>> > null_unlock(struct vop_unlock_args *ap) >> >>>> > { >> >>>> > struct vnode *vp = ap->a_vp; >> >>>> >- int flags = ap->a_flags; >> >>>> >- int mtxlkflag = 0; >> >>>> > struct null_node *nn; >> >>>> > struct vnode *lvp; >> >>>> > int error; >> >>>> > >> >>>> >- if ((flags & LK_INTERLOCK) != 0) >> >>>> >- mtxlkflag = 1; >> >>>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { >> >>>> >- VI_LOCK(vp); >> >>>> >- mtxlkflag = 2; >> >>>> >- } >> >>>> > nn = VTONULL(vp); >> >>>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { >> >>>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); >> >>>> >- flags |= LK_INTERLOCK; >> >>>> >- vholdl(lvp); >> >>>> >- VI_UNLOCK(vp); >> >>>> >- error = VOP_UNLOCK(lvp, flags); >> >>>> >+ vholdnz(lvp); >> >>>> >+ error = VOP_UNLOCK(lvp, 0); >> >>>> > vdrop(lvp); >> >>>> >- if (mtxlkflag == 0) >> >>>> >- VI_LOCK(vp); >> >>>> > } else { >> >>>> >- if (mtxlkflag == 2) >> >>>> >- VI_UNLOCK(vp); >> >>>> > error = vop_stdunlock(ap); >> >>>> > } >> >>>> > >> >>>> >@@ -845,10 +830,8 @@ null_getwritemount(struct >> >>>vop_getwritemount_args >> >>>> >*ap) >> >>>> > VI_LOCK(vp); >> >>>> > xp = VTONULL(vp); >> >>>> > if (xp && (lowervp = xp->null_lowervp)) { >> >>>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); >> >>>> >+ vholdnz(lowervp); >> >>>> > VI_UNLOCK(vp); >> >>>> >- vholdl(lowervp); >> >>>> >- VI_UNLOCK(lowervp); >> >>>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); >> >>>> > vdrop(lowervp); >> >>>> > } else { >> >>>> >> >>>> Hi mjg@, >> >>>> >> >>>> This causes trap 12 a few seconds after mountlate during boot. >> >>>Reverting this >> >>>> commit allowed it to boot. >> >>>> >> >>>> Sorry for no backtrace. I managed to >> >>>> revert and test just prior to rushing out to catch the bus, with no >> >>>time to >> >>>> craft a proper email. I'll post the backtrace when I arrive at work. >> >>> >> >>>Hi mjg@, >> >>> >> >>>The gory details below. Don't be fooled by the panic when yppasswd is >> >>>started. I was able to reproduce this panic in single user by simply >> >>>mounting and using a nullfs. >> >>> >> >>>kernel trap 12 with interrupts disabled >> >>> >> >>> >> >>>Fatal trap 12: page fault while in kernel mode >> >>>cpuid = 0; apic id = 00 >> >>>fault virtual address = 0xc >> >>>fault code = supervisor read data, page not present >> >>>instruction pointer = 0x20:0xffffffff806f0633 >> >>>stack pointer = 0x28:0xfffffe004b3fa7c0 >> >>>frame pointer = 0x28:0xfffffe004b3fa7e0 >> >>>code segment = base 0x0, limit 0xfffff, type 0x1b >> >>> = DPL 0, pres 1, long 1, def32 0, gran 1 >> >>>processor eflags = resume, IOPL = 0 >> >>>current process = 26 (syncer) >> >>>trap number = 12 >> >>>panic: page fault >> >>>cpuid = 0 >> >>>time = 1566821203 >> >>>KDB: stack backtrace: >> >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> >>>0xfffffe004b3fa470 >> >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 >> >>>panic() at panic+0x43/frame 0xfffffe004b3fa520 >> >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 >> >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 >> >>>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 >> >>>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 >> >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp >> >>= >> >>>0xfffffe004b3fa7e0 --- >> >>>propagate_priority() at propagate_priority+0x153/frame >> >>>0xfffffe004b3fa7e0 >> >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 >> >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 >> >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >> >>>0xfffffe004b3fa920 >> >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 >> >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 >> >>>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 >> >>>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 >> >>>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 >> >>>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 >> >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> >>>Uptime: 3m25s >> >>>Dumping 921 out of 7974 >> >>>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% >> >>> >> >>>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 >> >>>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" >> >>>(OFFSETOF_CURTHREAD)); >> >>>(kgdb) #0 __curthread () at >> >>>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 >> >>>#1 doadump (textdump=1) at >> >>>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 >> >>>#2 0xffffffff8068aead in kern_reboot (howto=260) >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 >> >>>#3 0xffffffff8068b369 in vpanic (fmt=, ap=> >>>out>) >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 >> >>>#4 0xffffffff8068b163 in panic (fmt=) >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 >> >>>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, >> >>eva=12) >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 >> >>>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, >> >>>usermode=0) >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 >> >>>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 >> >>>#8 >> >>>#9 propagate_priority (td=0xfffff8003e43b000) >> >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 >> >>>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, >> >>> owner=, queue=-512) >> >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 >> >>>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, >> >>> v=) at >> >>/opt/src/svn-current/sys/kern/kern_mutex.c:654 >> >>>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( >> >>> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, >> >>vp=0xfffff80132e4eb40) >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 >> >>>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 >> >>>#14 0xffffffff80766206 in __mnt_vnode_next_active >> >>>(mvp=0xfffff80002449800, >> >>> mp=) at >> >>/opt/src/svn-current/sys/kern/vfs_subr.c:5682 >> >>>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 >> >>>#16 0xffffffff8076b4a6 in sync_fsync (ap=) >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 >> >>>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( >> >>> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) >> >>> at vnode_if.c:1312 >> >>>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, >> >>> td=0xfffff800061dc5a0) at ./vnode_if.h:549 >> >>>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, >> >>> slp=) at >> >>/opt/src/svn-current/sys/kern/vfs_subr.c:2316 >> >>>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 >> >>>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 >> >>>, >> >>> arg=0x0, frame=0xfffffe004b3faac0) >> >>> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 >> >>>#22 >> >>> >> >>> >> >>>dmesg output: >> >>> >> >>>Updating motd:. >> >>>Mounting late filesystems:. >> >>>Starting nscd. >> >>>Security policy loaded: MAC/ntpd (mac_ntpd) >> >>>Starting ntpd. >> >>>Starting yppasswdd. >> >>>kernel trap 12 with interrupts disabled >> >>> >> >>> >> >>>Fatal trap 12: page fault while in kernel mode >> >>>cpuid = 0; apic id = 00 >> >>>fault virtual address = 0xc >> >>>fault code = supervisor read data, page not present >> >>>instruction pointer = 0x20:0xffffffff806f0633 >> >>>stack pointer = 0x28:0xfffffe004b7fa7c0 >> >>>frame pointer = 0x28:0xfffffe004b7fa7e0 >> >>>code segment = base 0x0, limit 0xfffff, type 0x1b >> >>> = DPL 0, pres 1, long 1, def32 0, gran 1 >> >>>processor eflags = resume, IOPL = 0 >> >>>current process = 26 (syncer) >> >>>trap number = 12 >> >>>panic: page fault >> >>>cpuid = 0 >> >>>time = 1566820700 >> >>>KDB: stack backtrace: >> >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> >>>0xfffffe004b7fa470 >> >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 >> >>>panic() at panic+0x43/frame 0xfffffe004b7fa520 >> >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 >> >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 >> >>>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 >> >>>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 >> >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp >> >>= >> >>>0xfffffe004b7fa7e0 --- >> >>>propagate_priority() at propagate_priority+0x153/frame >> >>>0xfffffe004b7fa7e0 >> >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 >> >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 >> >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame >> >>>0xfffffe004b7fa920 >> >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 >> >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 >> >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> >>>Uptime: 1m38s >> >>>Dumping 810 out of 7974 >> >>>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- >> >> >> >>This may be a simple case of increasing the kernel stack. I'll try this >> >>at noon. >> > >> > Increasing kernel stack pages from 8 to 20 still results in the panic. >> > >> > >> > -- >> > Pardon the typos and autocorrect, small keyboard in use. >> > Cheers, >> > Cy Schubert >> > FreeBSD UNIX: Web: http://www.FreeBSD.org >> > >> > The need of the many outweighs the greed of the few. >> > >> >> >> -- >> Mateusz Guzik > > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 01:16:03 2019 Return-Path: Delivered-To: svn-src-head@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 7F8E5C2D96; Tue, 27 Aug 2019 01:16:03 +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 46HWCl2pTLz48mx; Tue, 27 Aug 2019 01:16:03 +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 43690F07B; Tue, 27 Aug 2019 01:16:03 +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 x7R1G3uA098316; Tue, 27 Aug 2019 01:16:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7R1G37I098315; Tue, 27 Aug 2019 01:16:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201908270116.x7R1G37I098315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 27 Aug 2019 01:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351524 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 351524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 01:16:03 -0000 Author: np Date: Tue Aug 27 01:16:02 2019 New Revision: 351524 URL: https://svnweb.freebsd.org/changeset/base/351524 Log: cxgbe/t4_tom: Limit work requests with immediate payload to a single descriptor. The per-tid tx credits are in demand during active Tx and it's best not to use too many just for payload. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 27 00:29:30 2019 (r351523) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 27 01:16:02 2019 (r351524) @@ -540,7 +540,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) static inline int max_imm_payload(int tx_credits) { - const int n = 2; /* Use only up to 2 desc for imm. data WR */ + const int n = 1; /* Use no more than one desc for imm. data WR */ KASSERT(tx_credits >= 0 && tx_credits <= MAX_OFLD_TX_CREDITS, From owner-svn-src-head@freebsd.org Tue Aug 27 01:33:45 2019 Return-Path: Delivered-To: svn-src-head@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 25BC1C3BFE; Tue, 27 Aug 2019 01:33:45 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (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 46HWc81Brnz49yh; Tue, 27 Aug 2019 01:33:43 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-oi1-x234.google.com with SMTP id o6so13671435oic.9; Mon, 26 Aug 2019 18:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W6hlwlQRev3D/J6RJj43HtGFrLvZhpRkme9+vXIn61c=; b=jcf5hOyUQwBj43nkvV3KtZoVDbSWiHVrM2VtY8nNSOpZlWVGDR/o+HRiyMXgnnZPEP AHY/SnDamyslgE6rbLwCJaVLRAPvP9qiAuN2skTYQ3POyPFLF7GsA5ea/aZv51gHp0E8 9/6LCVhBMAqkZCmJqU1AgcP5x9bHo1rP/ZxVaSS/0wNPOXvC8qg3I5A3tLuZD/nZ0Vkr ewUzykEONRWF6EyaldYh/sTFwQYg9rDgW2xKU4+tJuryP5zwD8i0+WrWThDfFCEhaGdb VhZrupnbEwYPqJEeGxgYa01tz5RTV5wXb+IfAfrTtctE9EpjOp9Xhoxq8BSVEjYMmq4d 5FoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=W6hlwlQRev3D/J6RJj43HtGFrLvZhpRkme9+vXIn61c=; b=a/3NDWStVGz2/rTVrSZC9hDdZHnXPhy6Vsul0gKEo5oRVSow5+Z/uDYiNJDQxhrXTc 3XNFbepzci9+PYlo9ZSh9yrk0TqZUtxVo8sf9o836VTPR6Qa67Wkwrn+suAv71x4TLzz k6tRX/ChQmH6i927BEC78ASnDsgFTwluYCWF5Uhf7Inyp/t5ZBfE5yDbG38A2EPE9zZw 9fRFu5zOyrnryTDrQYg7amQhqYcr2PJrGKpcEw62qz7JIzaRw/3fDl/nHrj2tuNz0ZAY pDF8B0B/wDsUxGk+SRpoeTVP2AY1nWDsF+CQHBz39RDarmOIpEvcPT5an2zLRwVNuSEF lQQQ== X-Gm-Message-State: APjAAAW4K1rRkCxPCszlFTbFqrgOJhEFyIlWfggXKdba0lEFtskW3UqO SXB1iMoqa6q3uhgvnNvdFUcDCDt8LeE= X-Google-Smtp-Source: APXvYqx7Imlu0ZBkbA4tJ59gcBZ07gAFB+PXWdSXrFQagcxA6dhyYowN488ClF/B2G+mW9t7jeo8yA== X-Received: by 2002:aca:2809:: with SMTP id 9mr14506330oix.163.1566869622061; Mon, 26 Aug 2019 18:33:42 -0700 (PDT) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id e2sm4665091otl.67.2019.08.26.18.33.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2019 18:33:41 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r351514 - head/sys/dev/pci To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201908261727.x7QHRbsc020978@repo.freebsd.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <38e64dee-013a-f46e-0937-8834dc6065aa@FreeBSD.org> Date: Mon, 26 Aug 2019 21:33:40 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46HWc81Brnz49yh X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=jcf5hOyU; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::234 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-6.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.82)[ip: (-8.84), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; RCVD_IN_DNSWL_NONE(0.00)[4.3.2.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]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 01:33:45 -0000 On 26.08.2019 18:00, Conrad Meyer wrote: > On Mon, Aug 26, 2019 at 10:27 AM Alexander Motin wrote: >> >> Author: mav >> Date: Mon Aug 26 17:27:36 2019 >> New Revision: 351514 >> ... >> - device_printf(dev, >> - "HotPlug Command Timed Out - forcing detach\n"); >> - sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); >> - sc->flags |= PCIB_DETACHING; >> - pcib_pcie_hotplug_update(sc, 0, 0, true); >> + device_printf(dev, "HotPlug Command Timed Out\n"); >> + sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING; > > If this case is expected (and it seems like it is, at least in > relatively common hardware), and the kernel isn't taking an action > based on it anymore (formerly, it would then cause detach), is there > any reason to print a message at all? What information should a user > glean from the message, or what action should be taken? It seems like > Nothing and None, respectively. So perhaps it is better to not print > anything in this case? Or maybe mask it behind bootverbose. While you may be right, for now I would leave it visible just to show that something went wrong, in case somebody wish to diagnose some real issue that may have same symptoms. It is just one line per event, so it should not be too annoying. Most people will never see it, since PCIe hot-plug is still very rare. On the mentioned Supermicro board ACPI actually blocks hot-plug support, since FreeBSD does not announce ASPM capability. This is the next real issue we need to think about. Cosmetics will follow later. -- Alexander Motin From owner-svn-src-head@freebsd.org Tue Aug 27 03:41:27 2019 Return-Path: Delivered-To: svn-src-head@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 86210C7AA6; Tue, 27 Aug 2019 03:41:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HZRV2HJ8z4HYQ; Tue, 27 Aug 2019 03:41:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2SMDiffpzUIS22SMEirknQ; Mon, 26 Aug 2019 21:41:23 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=PrR0O5JK02BW0l_2Nk8A:9 a=AwRyc7TPWctOo_KJ:21 a=P6d614OK1xefZgYy:21 a=bhKgQFQpCuPVnCNV:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1A2579A8; Mon, 26 Aug 2019 20:41:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7R3fJni062391; Mon, 26 Aug 2019 20:41:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7R3fJne062385; Mon, 26 Aug 2019 20:41:19 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908270341.x7R3fJne062385@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> Comments: In-reply-to Mateusz Guzik message dated "Tue, 27 Aug 2019 02:52:12 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 20:41:19 -0700 X-CMAE-Envelope: MS4wfAY4gPVtC3NfJrJh64qfPzHJFrhy6AfYZYoUwnXOwdl9yRdJqPd3ZIedkSQAQrPsBsBWbjUk523bZjptrSaIrqW5qccJBRaUjvxspNqYX1pyMIj9RFGI 7GuYy2IlbEOdzXDfQ8QZ5uoGpLooLi6JvS8AUJRwcrUWHUiPkU1hjhO7SHHwMB4aE1EhDyyhujeSFsZJbHuopFSaJAeGJv7QGXGBcCFgGtZWldfb2JQGjEGT p/czWj1DfrlanskL2ohxHdyqguTTzISzAKUB0FG7ryE= X-Rspamd-Queue-Id: 46HZRV2HJ8z4HYQ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-5.06 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; RCVD_IN_DNSWL_NONE(0.00)[13.134.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.49)[ip: (-6.78), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.44), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 03:41:27 -0000 Making progress: Unread portion of the kernel message buffer: panic: null_unlock: LK_INTERLOCK passed cpuid = 2 time = 1566868081 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0054a954e0 vpanic() at vpanic+0x19d/frame 0xfffffe0054a95530 panic() at panic+0x43/frame 0xfffffe0054a95590 null_unlock() at null_unlock+0x8a/frame 0xfffffe0054a955d0 VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a955f0 unionfs_unlock() at unionfs_unlock+0x124/frame 0xfffffe0054a95650 VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a95670 vfs_domount() at vfs_domount+0xc3f/frame 0xfffffe0054a958a0 vfs_donmount() at vfs_donmount+0x934/frame 0xfffffe0054a95940 sys_nmount() at sys_nmount+0x69/frame 0xfffffe0054a95980 amd64_syscall() at amd64_syscall+0x3ae/frame 0xfffffe0054a95ab0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0054a95ab0 --- syscall (378, FreeBSD ELF64, sys_nmount), rip = 0x2bed6a4a, rsp = 0x7fffffffe2e8, rbp = 0x7fffffffec70 --- Uptime: 1m35s -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Mateusz Guzik writes: > Sorry for the half-assed patch. I have a patch to remove the flags > argument and the change above was port of it. > > Try this please: > https://people.freebsd.org/~mjg/patches/vop_unlock-interlock2.diff > > On 8/27/19, Cy Schubert wrote: > > It won't build. Did you intend VOP_UNLOCK(vp,LK_INTERLOCK)? > > > > --- vfs_subr.o --- > > /opt/src/svn-current/sys/kern/vfs_subr.c:1037:17: error: too few arguments > > to function call, expected 2, have 1 > > VOP_UNLOCK(vp); > > ~~~~~~~~~~ ^ > > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > > static __inline int VOP_UNLOCK( > > ^ > > /opt/src/svn-current/sys/kern/vfs_subr.c:1401:16: error: too few arguments > > to function call, expected 2, have 1 > > VOP_UNLOCK(vp); > > ~~~~~~~~~~ ^ > > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > > static __inline int VOP_UNLOCK( > > ^ > > /opt/src/svn-current/sys/kern/vfs_subr.c:1413:15: error: too few arguments > > to function call, expected 2, have 1 > > VOP_UNLOCK(vp); > > ~~~~~~~~~~ ^ > > ./vnode_if.h:873:1: note: 'VOP_UNLOCK' declared here > > static __inline int VOP_UNLOCK( > > ^ > > 3 errors generated. > > *** [vfs_subr.o] Error code 1 > > > > make[2]: stopped in /export/obj/opt/src/svn-current/amd64.amd64/sys/BREAK > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > > In message > > > om> > > , Mateusz Guzik writes: > >> Does this do the trick for you? > >> > >> https://people.freebsd.org/~mjg/vop_unlock-interlock.diff > >> > >> On 8/26/19, Cy Schubert wrote: > >> > On August 26, 2019 8:40:50 AM PDT, Cy Schubert > >> > > >> > wrote: > >> >>On August 26, 2019 7:11:22 AM PDT, Cy Schubert > >> >> wrote: > >> >>>In message <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>, Cy > >> >>>Schubert wr > >> >>>ites: > >> >>>> On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik > >> >>>wrote: > >> >>>> >Author: mjg > >> >>>> >Date: Sun Aug 25 05:13:15 2019 > >> >>>> >New Revision: 351472 > >> >>>> >URL: https://svnweb.freebsd.org/changeset/base/351472 > >> >>>> > > >> >>>> >Log: > >> >>>> > nullfs: reduce areas protected by vnode interlock > >> >>>> > > >> >>>> >Some places only take the interlock to hold the vnode, which was a > >> >>>> >requiremnt > >> >>>> >before they started being manipulated with atomics. Use the newly > >> >>>> >introduced > >> >>>> > vholdnz to bump the count. > >> >>>> > > >> >>>> > Reviewed by: kib > >> >>>> > Tested by: pho > >> >>>> > Sponsored by: The FreeBSD Foundation > >> >>>> > Differential Revision: https://reviews.freebsd.org/D21358 > >> >>>> > > >> >>>> >Modified: > >> >>>> > head/sys/fs/nullfs/null_vnops.c > >> >>>> > > >> >>>> >Modified: head/sys/fs/nullfs/null_vnops.c > >> >>>> > >> >>>>====================================================================== > === > >> === > >> >>>> == > >> >>>> >--- head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:11:43 > >> >>2019 (r35147 > >> >>>> 1) > >> >>>> >+++ head/sys/fs/nullfs/null_vnops.c Sun Aug 25 05:13:15 > >> >>2019 (r35147 > >> >>>> 2) > >> >>>> >@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap) > >> >>>> > * We prevent it from being recycled by holding the vno > >> de > >> >>>> > * here. > >> >>>> > */ > >> >>>> >- vholdl(lvp); > >> >>>> >+ vholdnz(lvp); > >> >>>> > error = VOP_LOCK(lvp, flags); > >> >>>> > > >> >>>> > /* > >> >>>> >@@ -710,31 +710,16 @@ static int > >> >>>> > null_unlock(struct vop_unlock_args *ap) > >> >>>> > { > >> >>>> > struct vnode *vp = ap->a_vp; > >> >>>> >- int flags = ap->a_flags; > >> >>>> >- int mtxlkflag = 0; > >> >>>> > struct null_node *nn; > >> >>>> > struct vnode *lvp; > >> >>>> > int error; > >> >>>> > > >> >>>> >- if ((flags & LK_INTERLOCK) != 0) > >> >>>> >- mtxlkflag = 1; > >> >>>> >- else if (mtx_owned(VI_MTX(vp)) == 0) { > >> >>>> >- VI_LOCK(vp); > >> >>>> >- mtxlkflag = 2; > >> >>>> >- } > >> >>>> > nn = VTONULL(vp); > >> >>>> > if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { > >> >>>> >- VI_LOCK_FLAGS(lvp, MTX_DUPOK); > >> >>>> >- flags |= LK_INTERLOCK; > >> >>>> >- vholdl(lvp); > >> >>>> >- VI_UNLOCK(vp); > >> >>>> >- error = VOP_UNLOCK(lvp, flags); > >> >>>> >+ vholdnz(lvp); > >> >>>> >+ error = VOP_UNLOCK(lvp, 0); > >> >>>> > vdrop(lvp); > >> >>>> >- if (mtxlkflag == 0) > >> >>>> >- VI_LOCK(vp); > >> >>>> > } else { > >> >>>> >- if (mtxlkflag == 2) > >> >>>> >- VI_UNLOCK(vp); > >> >>>> > error = vop_stdunlock(ap); > >> >>>> > } > >> >>>> > > >> >>>> >@@ -845,10 +830,8 @@ null_getwritemount(struct > >> >>>vop_getwritemount_args > >> >>>> >*ap) > >> >>>> > VI_LOCK(vp); > >> >>>> > xp = VTONULL(vp); > >> >>>> > if (xp && (lowervp = xp->null_lowervp)) { > >> >>>> >- VI_LOCK_FLAGS(lowervp, MTX_DUPOK); > >> >>>> >+ vholdnz(lowervp); > >> >>>> > VI_UNLOCK(vp); > >> >>>> >- vholdl(lowervp); > >> >>>> >- VI_UNLOCK(lowervp); > >> >>>> > VOP_GETWRITEMOUNT(lowervp, ap->a_mpp); > >> >>>> > vdrop(lowervp); > >> >>>> > } else { > >> >>>> > >> >>>> Hi mjg@, > >> >>>> > >> >>>> This causes trap 12 a few seconds after mountlate during boot. > >> >>>Reverting this > >> >>>> commit allowed it to boot. > >> >>>> > >> >>>> Sorry for no backtrace. I managed to > >> >>>> revert and test just prior to rushing out to catch the bus, with no > >> >>>time to > >> >>>> craft a proper email. I'll post the backtrace when I arrive at work. > >> >>> > >> >>>Hi mjg@, > >> >>> > >> >>>The gory details below. Don't be fooled by the panic when yppasswd is > >> >>>started. I was able to reproduce this panic in single user by simply > >> >>>mounting and using a nullfs. > >> >>> > >> >>>kernel trap 12 with interrupts disabled > >> >>> > >> >>> > >> >>>Fatal trap 12: page fault while in kernel mode > >> >>>cpuid = 0; apic id = 00 > >> >>>fault virtual address = 0xc > >> >>>fault code = supervisor read data, page not present > >> >>>instruction pointer = 0x20:0xffffffff806f0633 > >> >>>stack pointer = 0x28:0xfffffe004b3fa7c0 > >> >>>frame pointer = 0x28:0xfffffe004b3fa7e0 > >> >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >> >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >> >>>processor eflags = resume, IOPL = 0 > >> >>>current process = 26 (syncer) > >> >>>trap number = 12 > >> >>>panic: page fault > >> >>>cpuid = 0 > >> >>>time = 1566821203 > >> >>>KDB: stack backtrace: > >> >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >> >>>0xfffffe004b3fa470 > >> >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b3fa4c0 > >> >>>panic() at panic+0x43/frame 0xfffffe004b3fa520 > >> >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b3fa580 > >> >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b3fa5e0 > >> >>>trap() at trap+0x29d/frame 0xfffffe004b3fa6f0 > >> >>>calltrap() at calltrap+0x8/frame 0xfffffe004b3fa6f0 > >> >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b3fa7c0, rbp > >> >>= > >> >>>0xfffffe004b3fa7e0 --- > >> >>>propagate_priority() at propagate_priority+0x153/frame > >> >>>0xfffffe004b3fa7e0 > >> >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b3fa830 > >> >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b3fa8c0 > >> >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >> >>>0xfffffe004b3fa920 > >> >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b3fa980 > >> >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b3fa9c0 > >> >>>VOP_FSYNC_APV() at VOP_FSYNC_APV+0x56/frame 0xfffffe004b3fa9e0 > >> >>>sched_sync() at sched_sync+0x379/frame 0xfffffe004b3faa70 > >> >>>fork_exit() at fork_exit+0x83/frame 0xfffffe004b3faab0 > >> >>>fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004b3faab0 > >> >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >> >>>Uptime: 3m25s > >> >>>Dumping 921 out of 7974 > >> >>>MB:..2%..11%..21%..32%..42%..51%..61%..72%..82%..91% > >> >>> > >> >>>__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >> >>>246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" > >> >>>(OFFSETOF_CURTHREAD)); > >> >>>(kgdb) #0 __curthread () at > >> >>>/opt/src/svn-current/sys/amd64/include/pcpu.h:246 > >> >>>#1 doadump (textdump=1) at > >> >>>/opt/src/svn-current/sys/kern/kern_shutdown.c:392 > >> >>>#2 0xffffffff8068aead in kern_reboot (howto=260) > >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:479 > >> >>>#3 0xffffffff8068b369 in vpanic (fmt=, ap= >> >>>out>) > >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:905 > >> >>>#4 0xffffffff8068b163 in panic (fmt=) > >> >>> at /opt/src/svn-current/sys/kern/kern_shutdown.c:832 > >> >>>#5 0xffffffff80a11c2c in trap_fatal (frame=0xfffffe004b3fa700, > >> >>eva=12) > >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:943 > >> >>>#6 0xffffffff80a11c79 in trap_pfault (frame=0xfffffe004b3fa700, > >> >>>usermode=0) > >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:767 > >> >>>#7 0xffffffff80a1126d in trap (frame=0xfffffe004b3fa700) > >> >>> at /opt/src/svn-current/sys/amd64/amd64/trap.c:443 > >> >>>#8 > >> >>>#9 propagate_priority (td=0xfffff8003e43b000) > >> >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:279 > >> >>>#10 0xffffffff806f13db in turnstile_wait (ts=0xfffff8000258a780, > >> >>> owner=, queue=-512) > >> >>> at /opt/src/svn-current/sys/kern/subr_turnstile.c:785 > >> >>>#11 0xffffffff80669271 in __mtx_lock_sleep (c=0xfffff80132e4ebf0, > >> >>> v=) at > >> >>/opt/src/svn-current/sys/kern/kern_mutex.c:654 > >> >>>#12 0xffffffff80767b1b in mnt_vnode_next_active_relock ( > >> >>> mvp=0xfffff80002449800, mp=0xfffff80132d1e000, > >> >>vp=0xfffff80132e4eb40) > >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5590 > >> >>>#13 mnt_vnode_next_active (mvp=, mp=0xfffff80132d1e000) > >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:5649 > >> >>>#14 0xffffffff80766206 in __mnt_vnode_next_active > >> >>>(mvp=0xfffff80002449800, > >> >>> mp=) at > >> >>/opt/src/svn-current/sys/kern/vfs_subr.c:5682 > >> >>>#15 vfs_msync (mp=0xfffff80132d1e000, flags=2) > >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4238 > >> >>>#16 0xffffffff8076b4a6 in sync_fsync (ap=) > >> >>> at /opt/src/svn-current/sys/kern/vfs_subr.c:4468 > >> >>>#17 0xffffffff80a7be46 in VOP_FSYNC_APV ( > >> >>> vop=0xffffffff80cb4120 , a=0xfffffe004b3faa08) > >> >>> at vnode_if.c:1312 > >> >>>#18 0xffffffff80769319 in VOP_FSYNC (vp=, waitfor=3, > >> >>> td=0xfffff800061dc5a0) at ./vnode_if.h:549 > >> >>>#19 sync_vnode (bo=, td=0xfffff800061dc5a0, > >> >>> slp=) at > >> >>/opt/src/svn-current/sys/kern/vfs_subr.c:2316 > >> >>>#20 sched_sync () at /opt/src/svn-current/sys/kern/vfs_subr.c:2418 > >> >>>#21 0xffffffff80647e33 in fork_exit (callout=0xffffffff80768fa0 > >> >>>, > >> >>> arg=0x0, frame=0xfffffe004b3faac0) > >> >>> at /opt/src/svn-current/sys/kern/kern_fork.c:1045 > >> >>>#22 > >> >>> > >> >>> > >> >>>dmesg output: > >> >>> > >> >>>Updating motd:. > >> >>>Mounting late filesystems:. > >> >>>Starting nscd. > >> >>>Security policy loaded: MAC/ntpd (mac_ntpd) > >> >>>Starting ntpd. > >> >>>Starting yppasswdd. > >> >>>kernel trap 12 with interrupts disabled > >> >>> > >> >>> > >> >>>Fatal trap 12: page fault while in kernel mode > >> >>>cpuid = 0; apic id = 00 > >> >>>fault virtual address = 0xc > >> >>>fault code = supervisor read data, page not present > >> >>>instruction pointer = 0x20:0xffffffff806f0633 > >> >>>stack pointer = 0x28:0xfffffe004b7fa7c0 > >> >>>frame pointer = 0x28:0xfffffe004b7fa7e0 > >> >>>code segment = base 0x0, limit 0xfffff, type 0x1b > >> >>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >> >>>processor eflags = resume, IOPL = 0 > >> >>>current process = 26 (syncer) > >> >>>trap number = 12 > >> >>>panic: page fault > >> >>>cpuid = 0 > >> >>>time = 1566820700 > >> >>>KDB: stack backtrace: > >> >>>db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >> >>>0xfffffe004b7fa470 > >> >>>vpanic() at vpanic+0x19d/frame 0xfffffe004b7fa4c0 > >> >>>panic() at panic+0x43/frame 0xfffffe004b7fa520 > >> >>>trap_fatal() at trap_fatal+0x39c/frame 0xfffffe004b7fa580 > >> >>>trap_pfault() at trap_pfault+0x49/frame 0xfffffe004b7fa5e0 > >> >>>trap() at trap+0x29d/frame 0xfffffe004b7fa6f0 > >> >>>calltrap() at calltrap+0x8/frame 0xfffffe004b7fa6f0 > >> >>>--- trap 0xc, rip = 0xffffffff806f0633, rsp = 0xfffffe004b7fa7c0, rbp > >> >>= > >> >>>0xfffffe004b7fa7e0 --- > >> >>>propagate_priority() at propagate_priority+0x153/frame > >> >>>0xfffffe004b7fa7e0 > >> >>>turnstile_wait() at turnstile_wait+0x32b/frame 0xfffffe004b7fa830 > >> >>>__mtx_lock_sleep() at __mtx_lock_sleep+0x191/frame 0xfffffe004b7fa8c0 > >> >>>mnt_vnode_next_active() at mnt_vnode_next_active+0x2cb/frame > >> >>>0xfffffe004b7fa920 > >> >>>vfs_msync() at vfs_msync+0x266/frame 0xfffffe004b7fa980 > >> >>>sync_fsync() at sync_fsync+0xe6/frame 0xfffffe004b7fa9c0 > >> >>>--- trap 0, rip = 0, rsp = 0, rbp = 0 --- > >> >>>Uptime: 1m38s > >> >>>Dumping 810 out of 7974 > >> >>>MB:..2%..12%..22%..32%..42%..52%..62%..72%..81%..91%---<>--- > >> >> > >> >>This may be a simple case of increasing the kernel stack. I'll try this > >> >>at noon. > >> > > >> > Increasing kernel stack pages from 8 to 20 still results in the panic. > >> > > >> > > >> > -- > >> > Pardon the typos and autocorrect, small keyboard in use. > >> > Cheers, > >> > Cy Schubert > >> > FreeBSD UNIX: Web: http://www.FreeBSD.org > >> > > >> > The need of the many outweighs the greed of the few. > >> > > >> > >> > >> -- > >> Mateusz Guzik > > > > > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 03:58:00 2019 Return-Path: Delivered-To: svn-src-head@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 AE556C82D2; Tue, 27 Aug 2019 03:58:00 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) (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 46HZpc0Hs7z4Jpg; Tue, 27 Aug 2019 03:57:59 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x244.google.com with SMTP id 16so13871050oiq.6; Mon, 26 Aug 2019 20:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=R22Rr96VbR5b3Aj7JH7+/PsoUHmca6enB02xtHPtzMM=; b=l/w0C4j7a91/0bbYTrP0/nNZiZsmlVmVeX4H7kM/gCX1WHPX6hoM5R/B1D8PLgnMyK OV9ls/lsoQzHBFPvMH3EjOHsMGU76GP+d6gWrPc0K49tw5wxfbq8PUVqTORfjVMXPQCn 1b2BSGOIKLPdzdqxcsOLfcXMHqp3A5S85GVlnJkP8cswAi+bXvcMQWA6E8zCUcMYpRa8 /r2/n3kRxxUNmJR+hTQmPlmoV7J4EW3uiHcZ6cIryjfZhIamXHqY9Z+tH45BcdaIZl0w OIKJDK1vOqWJtURF+kbdQBgf+t/XD0UuUjzrmVjWFTTGJLxDyGIzvvieNgHQ0WTABtze CR8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=R22Rr96VbR5b3Aj7JH7+/PsoUHmca6enB02xtHPtzMM=; b=pMn12LPAAyZlloqWXxlIr8tmj7hD0apDyrK/acimlHAW6F+LEHkdbfh/WU9yapplAR 1s76yV/usNvkU99c+oQ7XID2Yg2E8sKBfDkV/alJzmwihT+iLu+3Jq5cNE+M8p+uUMyg 88tKTvVlOA6F21m1L3LO6WPFVNPtkWpaLETSq7zNtEWwldnCUQdenEJV8DBnvWyOi5LZ JuQRQDWUowmQiKoMOSAvR3r/5DkR0NCvLTo4S6lUydY8Kn5f27UrNXb5JpajyTXz9DKg Tst9WNoCByTmW4gzxB11o/tXiGk2X5eqEFFCPgiNHoHI5pcwq1JqfKFoI9EE7a0kbPvf D+Yg== X-Gm-Message-State: APjAAAXLKOvMqjff4REvxSlK1CoAy7WyodhVF/JQQ8yFVukaz1DXR6cg SP0DG9MsTpgeh9GW/76uuLcRAUDvg9qKkWybOAUDCg== X-Google-Smtp-Source: APXvYqysdVUMmthPRPY++dkUQVWQZs+z7DKEmC1jRj/kcXny47TP08xxGtX2cGthc6PQjvpBLSTxSKYgVJscSXu1yrs= X-Received: by 2002:aca:bb42:: with SMTP id l63mr15186999oif.85.1566878278677; Mon, 26 Aug 2019 20:57:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Mon, 26 Aug 2019 20:57:58 -0700 (PDT) In-Reply-To: <201908270341.x7R3fJne062385@slippy.cwsent.com> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> <201908270341.x7R3fJne062385@slippy.cwsent.com> From: Mateusz Guzik Date: Tue, 27 Aug 2019 05:57:58 +0200 Message-ID: Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HZpc0Hs7z4Jpg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=l/w0C4j7; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::244 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.35), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.2.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]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 03:58:00 -0000 On 8/27/19, Cy Schubert wrote: > Making progress: > > Unread portion of the kernel message buffer: > > panic: null_unlock: LK_INTERLOCK passed > cpuid = 2 > time = 1566868081 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe0054a954e0 > vpanic() at vpanic+0x19d/frame 0xfffffe0054a95530 > panic() at panic+0x43/frame 0xfffffe0054a95590 > null_unlock() at null_unlock+0x8a/frame 0xfffffe0054a955d0 > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a955f0 > unionfs_unlock() at unionfs_unlock+0x124/frame 0xfffffe0054a95650 > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a95670 > vfs_domount() at vfs_domount+0xc3f/frame 0xfffffe0054a958a0 > vfs_donmount() at vfs_donmount+0x934/frame 0xfffffe0054a95940 > sys_nmount() at sys_nmount+0x69/frame 0xfffffe0054a95980 > amd64_syscall() at amd64_syscall+0x3ae/frame 0xfffffe0054a95ab0 > fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0054a95ab0 > --- syscall (378, FreeBSD ELF64, sys_nmount), rip = 0x2bed6a4a, rsp = > 0x7fffffffe2e8, rbp = 0x7fffffffec70 --- > Uptime: 1m35s > Ok, this explains everything. I did not think anyone uses unionfs, let alone stacked on top of nullfs. I'll have a patch later. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 04:17:44 2019 Return-Path: Delivered-To: svn-src-head@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 EB93DC8DE8; Tue, 27 Aug 2019 04:17:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46HbFM59QFz4Lj5; Tue, 27 Aug 2019 04:17:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2SvKiwUSiSrVc2SvMiobHh; Mon, 26 Aug 2019 22:17:41 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=UtRFE5K7Ulp2Whtco6EA:9 a=CjuIK1q_8ugA:10 a=7uh6xexeqkIA:10 a=9Wj_ytqOLHUA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=BVt-rVABO2UG3ysEI_l-:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 83254A83; Mon, 26 Aug 2019 21:17:38 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7R4Hc65024860; Mon, 26 Aug 2019 21:17:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7R4HcfE024857; Mon, 26 Aug 2019 21:17:38 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908270417.x7R4HcfE024857@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> <201908270341.x7R3fJne062385@slippy.cwsent.com> Comments: In-reply-to Mateusz Guzik message dated "Tue, 27 Aug 2019 05:57:58 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 21:17:38 -0700 X-CMAE-Envelope: MS4wfP9HOaC487ijs5Ar1oK8iox2bfVk4E4n/GQqj4+7BcVjX0RqOrqeCdsOEpo/ouy7ZXNcgtTR+sdp4++7HDY54rs3SS38QstetaxCm9eX2QRoXFkMJoeV d9mbZrKSSJftmX02KmEsQDIoKnDqzvzUYAzQ2bfyW0n/Cqp5WjWWr0pLkvniWG2JVYsWNIDK+5qc6Gquo1nLMd2a/NdOgw6aUABRAbcnz58aurgOfjH3K8No 6bHnVS7mMAhdnRUTSHHJfTnR0Lx3JMmnen3pgS5cvW0= X-Rspamd-Queue-Id: 46HbFM59QFz4Lj5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.94 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[138.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.38)[ip: (-6.23), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.44), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 04:17:45 -0000 In message , Mateusz Guzik writes: > On 8/27/19, Cy Schubert wrote: > > Making progress: > > > > Unread portion of the kernel message buffer: > > > > panic: null_unlock: LK_INTERLOCK passed > > cpuid = 2 > > time = 1566868081 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe0054a954e0 > > vpanic() at vpanic+0x19d/frame 0xfffffe0054a95530 > > panic() at panic+0x43/frame 0xfffffe0054a95590 > > null_unlock() at null_unlock+0x8a/frame 0xfffffe0054a955d0 > > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a955f0 > > unionfs_unlock() at unionfs_unlock+0x124/frame 0xfffffe0054a95650 > > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a95670 > > vfs_domount() at vfs_domount+0xc3f/frame 0xfffffe0054a958a0 > > vfs_donmount() at vfs_donmount+0x934/frame 0xfffffe0054a95940 > > sys_nmount() at sys_nmount+0x69/frame 0xfffffe0054a95980 > > amd64_syscall() at amd64_syscall+0x3ae/frame 0xfffffe0054a95ab0 > > fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0054a95ab0 > > --- syscall (378, FreeBSD ELF64, sys_nmount), rip = 0x2bed6a4a, rsp = > > 0x7fffffffe2e8, rbp = 0x7fffffffec70 --- > > Uptime: 1m35s > > > > Ok, this explains everything. I did not think anyone uses unionfs, > let alone stacked on top of nullfs. I'll have a patch later. It's for a few jails. Thanks for persevering. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Aug 27 04:19:42 2019 Return-Path: Delivered-To: svn-src-head@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 6A72AC8EA6; Tue, 27 Aug 2019 04:19:42 +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 46HbHf2svRz4Lr5; Tue, 27 Aug 2019 04:19:42 +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 58ECF191F1; Tue, 27 Aug 2019 04:19:42 +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 x7R4JgvC007434; Tue, 27 Aug 2019 04:19:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7R4JeLg007426; Tue, 27 Aug 2019 04:19:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201908270419.x7R4JeLg007426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 27 Aug 2019 04:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351540 - in head/sys/dev/cxgbe: . cxgbei iw_cxgbe tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . cxgbei iw_cxgbe tom X-SVN-Commit-Revision: 351540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 04:19:42 -0000 Author: np Date: Tue Aug 27 04:19:40 2019 New Revision: 351540 URL: https://svnweb.freebsd.org/changeset/base/351540 Log: cxgbe/t4_tom: Initialize all TOE connection parameters in one place. Remove now-redundant items from toepcb and synq_entry and the code to support them. Let the driver calculate tx_align, rx_coalesce, and sndbuf by default. Reviewed by: jhb@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21387 Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue Aug 27 04:19:40 2019 (r351540) @@ -697,7 +697,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) ISCSI_DATA_DIGEST_SIZE; } so->so_options |= SO_NO_DDP; - toep->ulp_mode = ULP_MODE_ISCSI; + toep->params.ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Tue Aug 27 04:19:40 2019 (r351540) @@ -1415,7 +1415,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw ret = c4iw_wait_for_reply(rdev, &ep->com.wr_wait, ep->hwtid, qhp->wq.sq.qid, ep->com.so, __func__); - toep->ulp_mode = ULP_MODE_RDMA; + toep->params.ulp_mode = ULP_MODE_RDMA; free_ird(rhp, qhp->attr.max_ird); return ret; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/t4_main.c Tue Aug 27 04:19:40 2019 (r351540) @@ -6229,9 +6229,9 @@ t4_sysctls(struct adapter *sc) "(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, " "3 = highspeed)"); - sc->tt.sndbuf = 256 * 1024; + sc->tt.sndbuf = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW, - &sc->tt.sndbuf, 0, "max hardware send buffer size"); + &sc->tt.sndbuf, 0, "hardware send buffer"); sc->tt.ddp = 0; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ddp", @@ -6239,7 +6239,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_zcopy", CTLFLAG_RW, &sc->tt.ddp, 0, "Enable zero-copy aio_read(2)"); - sc->tt.rx_coalesce = 1; + sc->tt.rx_coalesce = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_coalesce", CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); @@ -6251,7 +6251,7 @@ t4_sysctls(struct adapter *sc) CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, "I", "TCP ports that use inline TLS+TOE RX"); - sc->tt.tx_align = 1; + sc->tt.tx_align = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload"); Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 27 04:19:40 2019 (r351540) @@ -102,7 +102,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_h make_established(toep, be32toh(cpl->snd_isn) - 1, be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt); - if (toep->ulp_mode == ULP_MODE_TLS) + if (ulp_mode(toep) == ULP_MODE_TLS) tls_establish(toep); done: @@ -165,96 +165,6 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_he return (0); } -/* - * Options2 for active open. - */ -static uint32_t -calc_opt2a(struct socket *so, struct toepcb *toep, - const struct offload_settings *s) -{ - struct tcpcb *tp = so_sototcpcb(so); - struct port_info *pi = toep->vi->pi; - struct adapter *sc = pi->adapter; - uint32_t opt2 = 0; - - /* - * rx flow control, rx coalesce, congestion control, and tx pace are all - * explicitly set by the driver. On T5+ the ISS is also set by the - * driver to the value picked by the kernel. - */ - if (is_t4(sc)) { - opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; - opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; - } else { - opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ - opt2 |= F_T5_ISS; /* ISS provided in CPL */ - } - - if (s->sack > 0 || (s->sack < 0 && (tp->t_flags & TF_SACK_PERMIT))) - opt2 |= F_SACK_EN; - - if (s->tstamp > 0 || (s->tstamp < 0 && (tp->t_flags & TF_REQ_TSTMP))) - opt2 |= F_TSTAMPS_EN; - - if (tp->t_flags & TF_REQ_SCALE) - opt2 |= F_WND_SCALE_EN; - - if (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn == 1)) - opt2 |= F_CCTRL_ECN; - - /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ - - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - - /* These defaults are subject to ULP specific fixups later. */ - opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); - - opt2 |= V_PACE(0); - - if (s->cong_algo >= 0) - opt2 |= V_CONG_CNTRL(s->cong_algo); - else if (sc->tt.cong_algorithm >= 0) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); - else { - struct cc_algo *cc = CC_ALGO(tp); - - if (strcasecmp(cc->name, "reno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); - else if (strcasecmp(cc->name, "tahoe") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); - if (strcasecmp(cc->name, "newreno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - if (strcasecmp(cc->name, "highspeed") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); - else { - /* - * Use newreno in case the algorithm selected by the - * host stack is not supported by the hardware. - */ - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - } - } - - if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) - opt2 |= V_RX_COALESCE(M_RX_COALESCE); - - /* Note that ofld_rxq is already set according to s->rxq. */ - opt2 |= F_RSS_QUEUE_VALID; - opt2 |= V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); - -#ifdef USE_DDP_RX_FLOW_CONTROL - if (toep->ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_DDP; -#endif - - if (toep->ulp_mode == ULP_MODE_TLS) { - opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); - opt2 |= F_RX_FC_DISABLE; - } - - return (htobe32(opt2)); -} - void t4_init_connect_cpl_handlers(void) { @@ -322,7 +232,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; struct vi_info *vi; - int mtu_idx, rscale, qid_atid, rc, isipv6, txqid, rxqid; + int qid_atid, rc, isipv6; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); int reason; @@ -353,18 +263,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (!settings.offload) DONT_OFFLOAD_ACTIVE_OPEN(EPERM); - if (settings.txq >= 0 && settings.txq < vi->nofldtxq) - txqid = settings.txq; - else - txqid = arc4random() % vi->nofldtxq; - txqid += vi->first_ofld_txq; - if (settings.rxq >= 0 && settings.rxq < vi->nofldrxq) - rxqid = settings.rxq; - else - rxqid = arc4random() % vi->nofldrxq; - rxqid += vi->first_ofld_rxq; - - toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT | M_ZERO); + toep = alloc_toepcb(vi, M_NOWAIT); if (toep == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); @@ -377,27 +276,16 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (toep->l2te == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); + toep->vnet = so->so_vnet; + init_conn_params(vi, &settings, &inp->inp_inc, so, NULL, + toep->l2te->idx, &toep->params); + init_toepcb(vi, toep); + isipv6 = nam->sa_family == AF_INET6; wr = alloc_wrqe(act_open_cpl_size(sc, isipv6), toep->ctrlq); if (wr == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); - toep->vnet = so->so_vnet; - set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); - SOCKBUF_LOCK(&so->so_rcv); - toep->opt0_rcv_bufsize = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); - SOCKBUF_UNLOCK(&so->so_rcv); - - /* - * The kernel sets request_r_scale based on sb_max whereas we need to - * take hardware's MAX_RCV_WND into account too. This is normally a - * no-op as MAX_RCV_WND is much larger than the default sb_max. - */ - if (tp->t_flags & TF_REQ_SCALE) - rscale = tp->request_r_scale = select_rcv_wscale(); - else - rscale = 0; - mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, &settings); qid_atid = V_TID_QID(toep->ofld_rxq->iq.abs_id) | V_TID_TID(toep->tid) | V_TID_COOKIE(CPL_COOKIE_TOM); @@ -438,9 +326,13 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_port = inp->inp_fport; cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; - cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); - cpl->opt2 = calc_opt2a(so, toep, &settings); + cpl->opt0 = calc_options0(vi, &toep->params); + cpl->opt2 = calc_options2(vi, &toep->params); + + CTR6(KTR_CXGBE, + "%s: atid %u, toep %p, inp %p, opt0 %#016lx, opt2 %#08x", + __func__, toep->tid, toep, inp, be64toh(cpl->opt0), + be32toh(cpl->opt2)); } else { struct cpl_act_open_req *cpl = wrtod(wr); struct cpl_t5_act_open_req *cpl5 = (void *)cpl; @@ -467,13 +359,14 @@ t4_connect(struct toedev *tod, struct socket *so, stru qid_atid)); inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); - cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); - cpl->opt2 = calc_opt2a(so, toep, &settings); - } + cpl->opt0 = calc_options0(vi, &toep->params); + cpl->opt2 = calc_options2(vi, &toep->params); - CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, - toep->tid, tcpstates[tp->t_state], toep, inp); + CTR6(KTR_CXGBE, + "%s: atid %u, toep %p, inp %p, opt0 %#016lx, opt2 %#08x", + __func__, toep->tid, toep, inp, be64toh(cpl->opt0), + be32toh(cpl->opt2)); + } offload_socket(so, toep); rc = t4_l2t_send(sc, wr, toep->l2te); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 27 04:19:40 2019 (r351540) @@ -77,7 +77,7 @@ static void t4_aiotx_cancel(struct kaiocb *job); static void t4_aiotx_queue_toep(struct socket *so, struct toepcb *toep); void -send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) +send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) { struct wrqe *wr; struct fw_flowc_wr *flowc; @@ -91,17 +91,17 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), ("%s: flowc for tid %u sent already", __func__, toep->tid)); - if (ftxp != NULL) + if (tp != NULL) nparams = 8; else nparams = 6; - if (toep->ulp_mode == ULP_MODE_TLS) + if (ulp_mode(toep) == ULP_MODE_TLS) nparams++; if (toep->tls.fcplenmax != 0) nparams++; - if (toep->tc_idx != -1) { - MPASS(toep->tc_idx >= 0 && - toep->tc_idx < sc->chip_params->nsched_cls); + if (toep->params.tc_idx != -1) { + MPASS(toep->params.tc_idx >= 0 && + toep->params.tc_idx < sc->chip_params->nsched_cls); nparams++; } @@ -133,30 +133,23 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par FLOWC_PARAM(CH, pi->tx_chan); FLOWC_PARAM(PORT, pi->tx_chan); FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); - if (ftxp) { - uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); - - FLOWC_PARAM(SNDNXT, ftxp->snd_nxt); - FLOWC_PARAM(RCVNXT, ftxp->rcv_nxt); - FLOWC_PARAM(SNDBUF, sndbuf); - FLOWC_PARAM(MSS, ftxp->mss); - - CTR6(KTR_CXGBE, - "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x", - __func__, toep->tid, ftxp->mss, sndbuf, ftxp->snd_nxt, - ftxp->rcv_nxt); - } else { - FLOWC_PARAM(SNDBUF, 512); - FLOWC_PARAM(MSS, 512); - - CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); + FLOWC_PARAM(SNDBUF, toep->params.sndbuf); + FLOWC_PARAM(MSS, toep->params.emss); + if (tp) { + FLOWC_PARAM(SNDNXT, tp->snd_nxt); + FLOWC_PARAM(RCVNXT, tp->rcv_nxt); } - if (toep->ulp_mode == ULP_MODE_TLS) - FLOWC_PARAM(ULP_MODE, toep->ulp_mode); + CTR6(KTR_CXGBE, + "%s: tid %u, mss %u, sndbuf %u, snd_nxt 0x%x, rcv_nxt 0x%x", + __func__, toep->tid, toep->params.emss, toep->params.sndbuf, + tp ? tp->snd_nxt : 0, tp ? tp->rcv_nxt : 0); + + if (ulp_mode(toep) == ULP_MODE_TLS) + FLOWC_PARAM(ULP_MODE, ulp_mode(toep)); if (toep->tls.fcplenmax != 0) FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); - if (toep->tc_idx != -1) - FLOWC_PARAM(SCHEDCLASS, toep->tc_idx); + if (toep->params.tc_idx != -1) + FLOWC_PARAM(SCHEDCLASS, toep->params.tc_idx); #undef FLOWC_PARAM KASSERT(paramidx == nparams, ("nparams mismatch")); @@ -197,7 +190,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb MPASS(tc_idx >= 0 && tc_idx < sc->chip_params->nsched_cls); } - if (toep->tc_idx != tc_idx) { + if (toep->params.tc_idx != tc_idx) { struct wrqe *wr; struct fw_flowc_wr *flowc; int nparams = 1, flowclen, flowclen16; @@ -236,9 +229,9 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb t4_wrq_tx(sc, wr); } - if (toep->tc_idx >= 0) - t4_release_cl_rl(sc, port_id, toep->tc_idx); - toep->tc_idx = tc_idx; + if (toep->params.tc_idx >= 0) + t4_release_cl_rl(sc, port_id, toep->params.tc_idx); + toep->params.tc_idx = tc_idx; return (0); } @@ -313,30 +306,30 @@ assign_rxopt(struct tcpcb *tp, uint16_t opt) INP_LOCK_ASSERT(inp); - toep->tcp_opt = opt; - toep->mtu_idx = G_TCPOPT_MSS(opt); - tp->t_maxseg = sc->params.mtus[toep->mtu_idx]; + toep->params.mtu_idx = G_TCPOPT_MSS(opt); + tp->t_maxseg = sc->params.mtus[toep->params.mtu_idx]; if (inp->inp_inc.inc_flags & INC_ISIPV6) tp->t_maxseg -= sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else tp->t_maxseg -= sizeof(struct ip) + sizeof(struct tcphdr); - toep->emss = tp->t_maxseg; + toep->params.emss = tp->t_maxseg; if (G_TCPOPT_TSTAMP(opt)) { + toep->params.tstamp = 1; + toep->params.emss -= TCPOLEN_TSTAMP_APPA; tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); - toep->emss -= TCPOLEN_TSTAMP_APPA; - } + } else + toep->params.tstamp = 0; - CTR6(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), t_maxseg %u, emss %u", - __func__, toep->tid, toep->mtu_idx, - sc->params.mtus[G_TCPOPT_MSS(opt)], tp->t_maxseg, toep->emss); - - if (G_TCPOPT_SACK(opt)) + if (G_TCPOPT_SACK(opt)) { + toep->params.sack = 1; tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ - else + } else { + toep->params.sack = 0; tp->t_flags &= ~TF_SACK_PERMIT; /* sack disallowed by peer */ + } if (G_TCPOPT_WSCALE_OK(opt)) tp->t_flags |= TF_RCVD_SCALE; @@ -346,7 +339,13 @@ assign_rxopt(struct tcpcb *tp, uint16_t opt) (TF_RCVD_SCALE | TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; tp->snd_scale = G_TCPOPT_SND_WSCALE(opt); - } + } else + toep->params.wscale = 0; + + CTR6(KTR_CXGBE, + "assign_rxopt: tid %d, mtu_idx %u, emss %u, ts %u, sack %u, wscale %u", + toep->tid, toep->params.mtu_idx, toep->params.emss, + toep->params.tstamp, toep->params.sack, toep->params.wscale); } /* @@ -361,9 +360,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui struct inpcb *inp = toep->inp; struct socket *so = inp->inp_socket; struct tcpcb *tp = intotcpcb(inp); - long bufsize; uint16_t tcpopt = be16toh(opt); - struct flowc_tx_params ftxp; INP_WLOCK_ASSERT(inp); KASSERT(tp->t_state == TCPS_SYN_SENT || @@ -379,7 +376,7 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = (u_int)toep->opt0_rcv_bufsize << 10; + tp->rcv_wnd = (u_int)toep->params.opt0_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; @@ -390,20 +387,8 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->snd_max = iss + 1; assign_rxopt(tp, tcpopt); + send_flowc_wr(toep, tp); - SOCKBUF_LOCK(&so->so_snd); - if (so->so_snd.sb_flags & SB_AUTOSIZE && V_tcp_do_autosndbuf) - bufsize = V_tcp_autosndbuf_max; - else - bufsize = sbspace(&so->so_snd); - SOCKBUF_UNLOCK(&so->so_snd); - - ftxp.snd_nxt = tp->snd_nxt; - ftxp.rcv_nxt = tp->rcv_nxt; - ftxp.snd_space = bufsize; - ftxp.mss = toep->emss; - send_flowc_wr(toep, &ftxp); - soisconnected(so); } @@ -459,7 +444,7 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) SOCKBUF_LOCK_ASSERT(sb); rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { if (toep->tls.rcv_over >= rx_credits) { toep->tls.rcv_over -= rx_credits; rx_credits = 0; @@ -578,7 +563,7 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove, int ulp_submode, int txalign) + unsigned int plen, uint8_t credits, int shove, int ulp_submode) { struct fw_ofld_tx_data_wr *txwr = dst; @@ -586,20 +571,18 @@ write_tx_wr(void *dst, struct toepcb *toep, unsigned i V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); - txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(toep->ulp_mode) | + txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(ulp_mode(toep)) | V_TX_ULP_SUBMODE(ulp_submode) | V_TX_URG(0) | V_TX_SHOVE(shove)); txwr->plen = htobe32(plen); - if (txalign > 0) { - struct tcpcb *tp = intotcpcb(toep->inp); - - if (plen < 2 * toep->emss) + if (toep->params.tx_align > 0) { + if (plen < 2 * toep->params.emss) txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE); else txwr->lsodisable_to_flags |= htobe32(F_FW_OFLD_TX_DATA_WR_ALIGNPLD | - (tp->t_flags & TF_NODELAY ? 0 : + (toep->params.nagle == 0 ? 0 : F_FW_OFLD_TX_DATA_WR_ALIGNPLDSHOVE)); } } @@ -694,11 +677,11 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); - KASSERT(toep->ulp_mode == ULP_MODE_NONE || - toep->ulp_mode == ULP_MODE_TCPDDP || - toep->ulp_mode == ULP_MODE_TLS || - toep->ulp_mode == ULP_MODE_RDMA, - ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + KASSERT(ulp_mode(toep) == ULP_MODE_NONE || + ulp_mode(toep) == ULP_MODE_TCPDDP || + ulp_mode(toep) == ULP_MODE_TLS || + ulp_mode(toep) == ULP_MODE_RDMA, + ("%s: ulp_mode %u for toep %p", __func__, ulp_mode(toep), toep)); #ifdef VERBOSE_TRACES CTR5(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d", @@ -837,8 +820,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, plen, credits, shove, 0, - sc->tt.tx_align); + write_tx_wr(txwr, toep, plen, plen, credits, shove, 0); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -856,8 +838,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, plen, credits, shove, 0, - sc->tt.tx_align); + write_tx_wr(txwr, toep, 0, plen, credits, shove, 0); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -877,7 +858,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep toep->tx_nocompl >= toep->tx_total / 4) compl = 1; - if (compl || toep->ulp_mode == ULP_MODE_RDMA) { + if (compl || ulp_mode(toep) == ULP_MODE_RDMA) { txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); toep->tx_nocompl = 0; toep->plen_nocompl = 0; @@ -951,8 +932,8 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, INP_WLOCK_ASSERT(inp); KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); - KASSERT(toep->ulp_mode == ULP_MODE_ISCSI, - ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + KASSERT(ulp_mode(toep) == ULP_MODE_ISCSI, + ("%s: ulp_mode %u for toep %p", __func__, ulp_mode(toep), toep)); if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) return; @@ -1035,7 +1016,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); write_tx_wr(txwr, toep, plen, adjusted_plen, credits, - shove, ulp_submode, sc->tt.tx_align); + shove, ulp_submode); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -1053,7 +1034,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, txwr = wrtod(wr); credits = howmany(wr_len, 16); write_tx_wr(txwr, toep, 0, adjusted_plen, credits, - shove, ulp_submode, sc->tt.tx_align); + shove, ulp_submode); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -1119,7 +1100,7 @@ t4_tod_output(struct toedev *tod, struct tcpcb *tp) ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, 0); @@ -1145,7 +1126,7 @@ t4_send_fin(struct toedev *tod, struct tcpcb *tp) toep->flags |= TPF_SEND_FIN; if (tp->t_state >= TCPS_ESTABLISHED) { - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, 0); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, 0); @@ -1232,7 +1213,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head so = inp->inp_socket; socantrcvmore(so); - if (toep->ulp_mode == ULP_MODE_TCPDDP) { + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { DDP_LOCK(toep); if (__predict_false(toep->ddp.flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) @@ -1240,7 +1221,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head DDP_UNLOCK(toep); } - if (toep->ulp_mode != ULP_MODE_RDMA) { + if (ulp_mode(toep) != ULP_MODE_RDMA) { KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt), ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt, be32toh(cpl->rcv_nxt))); @@ -1551,14 +1532,14 @@ do_rx_data(struct sge_iq *iq, const struct rss_header tp->rcv_nxt += len; if (tp->rcv_wnd < len) { - KASSERT(toep->ulp_mode == ULP_MODE_RDMA, + KASSERT(ulp_mode(toep) == ULP_MODE_RDMA, ("%s: negative window size", __func__)); } tp->rcv_wnd -= len; tp->t_rcvtime = ticks; - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_LOCK(toep); so = inp_inpcbtosocket(inp); sb = &so->so_rcv; @@ -1569,7 +1550,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header __func__, tid, len); m_freem(m); SOCKBUF_UNLOCK(sb); - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_UNLOCK(toep); INP_WUNLOCK(inp); @@ -1600,7 +1581,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header sb->sb_flags &= ~SB_AUTOSIZE; } - if (toep->ulp_mode == ULP_MODE_TCPDDP) { + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { int changed = !(toep->ddp.flags & DDP_ON) ^ cpl->ddp_off; if (toep->ddp.waiting_count != 0 || toep->ddp.active_count != 0) @@ -1643,7 +1624,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header tp->rcv_adv += rx_credits; } - if (toep->ulp_mode == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && + if (ulp_mode(toep) == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && sbavail(sb) != 0) { CTR2(KTR_CXGBE, "%s: tid %u queueing AIO task", __func__, tid); @@ -1651,7 +1632,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header } sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(sb); - if (toep->ulp_mode == ULP_MODE_TCPDDP) + if (ulp_mode(toep) == ULP_MODE_TCPDDP) DDP_UNLOCK(toep); INP_WUNLOCK(inp); @@ -1761,7 +1742,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header #endif toep->flags &= ~TPF_TX_SUSPENDED; CURVNET_SET(toep->vnet); - if (toep->ulp_mode == ULP_MODE_ISCSI) + if (ulp_mode(toep) == ULP_MODE_ISCSI) t4_push_pdus(sc, toep, plen); else if (tls_tx_key(toep)) t4_push_tls_records(sc, toep, plen); @@ -1774,7 +1755,7 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header SOCKBUF_LOCK(sb); sbu = sbused(sb); - if (toep->ulp_mode == ULP_MODE_ISCSI) { + if (ulp_mode(toep) == ULP_MODE_ISCSI) { if (__predict_false(sbu > 0)) { /* Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 27 04:19:40 2019 (r351540) @@ -767,7 +767,7 @@ do_rx_data_ddp(struct sge_iq *iq, const struct rss_hea __func__, vld, tid, toep); } - if (toep->ulp_mode == ULP_MODE_ISCSI) { + if (ulp_mode(toep) == ULP_MODE_ISCSI) { t4_cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); return (0); } Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 27 04:19:40 2019 (r351540) @@ -348,7 +348,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry struct ifnet *ifp = m->m_pkthdr.rcvif; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; struct wrqe *wr; struct fw_flowc_wr *flowc; struct cpl_abort_req *req; @@ -368,8 +368,8 @@ send_reset_synqe(struct toedev *tod, struct synq_entry return; /* abort already in progress */ synqe->flags |= TPF_ABORT_SHUTDOWN; - ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; - ofld_rxq = &sc->sge.ofld_rxq[synqe->rxqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; + ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; /* The wrqe will have two WRs - a flowc followed by an abort_req */ flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -836,7 +836,7 @@ done_with_synqe(struct adapter *sc, struct synq_entry { struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; int ntids; INP_WLOCK_ASSERT(inp); @@ -887,7 +887,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss INP_WLOCK(inp); - ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; /* * If we'd initiated an abort earlier the reply to it is responsible for @@ -962,28 +962,6 @@ t4_offload_socket(struct toedev *tod, void *arg, struc synqe->flags |= TPF_SYNQE_EXPANDED; } -static inline void -save_qids_in_synqe(struct synq_entry *synqe, struct vi_info *vi, - struct offload_settings *s) -{ - uint32_t txqid, rxqid; - - if (s->txq >= 0 && s->txq < vi->nofldtxq) - txqid = s->txq; - else - txqid = arc4random() % vi->nofldtxq; - txqid += vi->first_ofld_txq; - - if (s->rxq >= 0 && s->rxq < vi->nofldrxq) - rxqid = s->rxq; - else - rxqid = arc4random() % vi->nofldrxq; - rxqid += vi->first_ofld_rxq; - - synqe->txqid = txqid; - synqe->rxqid = rxqid; -} - static void t4opt_to_tcpopt(const struct tcp_options *t4opt, struct tcpopt *to) { @@ -1006,95 +984,6 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc to->to_flags |= TOF_SACKPERM; } -/* - * Options2 for passive open. - */ -static uint32_t -calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, - const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode, - struct cc_algo *cc, const struct offload_settings *s) -{ - struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid]; - uint32_t opt2 = 0; - - /* - * rx flow control, rx coalesce, congestion control, and tx pace are all - * explicitly set by the driver. On T5+ the ISS is also set by the - * driver to the value picked by the kernel. - */ - if (is_t4(sc)) { - opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; - opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; - } else { - opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ - opt2 |= F_T5_ISS; /* ISS provided in CPL */ - } - - if (tcpopt->sack && (s->sack > 0 || (s->sack < 0 && V_tcp_do_rfc1323))) - opt2 |= F_SACK_EN; - - if (tcpopt->tstamp && - (s->tstamp > 0 || (s->tstamp < 0 && V_tcp_do_rfc1323))) - opt2 |= F_TSTAMPS_EN; - - if (tcpopt->wsf < 15 && V_tcp_do_rfc1323) - opt2 |= F_WND_SCALE_EN; - - if (th->th_flags & (TH_ECE | TH_CWR) && - (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn))) - opt2 |= F_CCTRL_ECN; - - /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ - - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - - /* These defaults are subject to ULP specific fixups later. */ - opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); - - opt2 |= V_PACE(0); - - if (s->cong_algo >= 0) - opt2 |= V_CONG_CNTRL(s->cong_algo); - else if (sc->tt.cong_algorithm >= 0) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); - else { - if (strcasecmp(cc->name, "reno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); - else if (strcasecmp(cc->name, "tahoe") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); - if (strcasecmp(cc->name, "newreno") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - if (strcasecmp(cc->name, "highspeed") == 0) - opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); - else { - /* - * Use newreno in case the algorithm selected by the - * host stack is not supported by the hardware. - */ - opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); - } - } - - if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) - opt2 |= V_RX_COALESCE(M_RX_COALESCE); - - /* Note that ofld_rxq is already set according to s->rxq. */ - opt2 |= F_RSS_QUEUE_VALID; - opt2 |= V_RSS_QUEUE(ofld_rxq->iq.abs_id); - -#ifdef USE_DDP_RX_FLOW_CONTROL - if (ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_DDP; -#endif - - if (ulp_mode == ULP_MODE_TLS) { - opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); - opt2 |= F_RX_FC_DISABLE; - } - - return (htobe32(opt2)); -} - static void pass_accept_req_to_protohdrs(struct adapter *sc, const struct mbuf *m, struct in_conninfo *inc, struct tcphdr *th) @@ -1189,7 +1078,7 @@ send_synack(struct adapter *sc, struct synq_entry *syn { struct wrqe *wr; struct cpl_pass_accept_rpl *rpl; - struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[0]); @@ -1385,6 +1274,9 @@ found: } atomic_store_int(&synqe->ok_to_respond, 0); + init_conn_params(vi, &settings, &inc, so, &cpl->tcpopt, e->idx, + &synqe->params); + /* * If all goes well t4_syncache_respond will get called during * syncache_add. Note that syncache_add releases the pcb lock. @@ -1395,27 +1287,12 @@ found: if (atomic_load_int(&synqe->ok_to_respond) > 0) { uint64_t opt0; uint32_t opt2; - u_int wnd; - int rscale, mtu_idx, rx_credits; - mtu_idx = find_best_mtu_idx(sc, &inc, &settings); - rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); - wnd = min(wnd, MAX_RCV_WND); - rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); + opt0 = calc_options0(vi, &synqe->params); + opt2 = calc_options2(vi, &synqe->params); - save_qids_in_synqe(synqe, vi, &settings); - synqe->ulp_mode = select_ulp_mode(so, sc, &settings); - - opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, - synqe->ulp_mode, &settings); - opt2 = calc_opt2p(sc, pi, synqe->rxqid, &cpl->tcpopt, &th, - synqe->ulp_mode, CC_ALGO(intotcpcb(inp)), &settings); - insert_tid(sc, tid, synqe, ntids); synqe->tid = tid; - synqe->l2e_idx = e->idx; - synqe->rcv_bufsize = rx_credits; synqe->syn = m; m = NULL; @@ -1427,8 +1304,8 @@ found: } CTR6(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p, mode %d, SYNACK", - __func__, stid, tid, lctx, synqe, synqe->ulp_mode); + "%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x", + __func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2)); } else REJECT_PASS_ACCEPT_REQ(false); @@ -1540,18 +1417,19 @@ reset: return (0); } - KASSERT(synqe->rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], + KASSERT(synqe->params.rxq_idx == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], ("%s: CPL arrived on unexpected rxq. %d %d", __func__, - synqe->rxqid, (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); + synqe->params.rxq_idx, + (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); - toep = alloc_toepcb(vi, synqe->txqid, synqe->rxqid, M_NOWAIT); + toep = alloc_toepcb(vi, M_NOWAIT); if (toep == NULL) goto reset; toep->tid = tid; - toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; + toep->l2te = &sc->l2t->l2tab[synqe->params.l2t_idx]; toep->vnet = lctx->vnet; - set_ulp_mode(toep, synqe->ulp_mode); - toep->opt0_rcv_bufsize = synqe->rcv_bufsize; + bcopy(&synqe->params, &toep->params, sizeof(toep->params)); + init_toepcb(vi, toep); MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Tue Aug 27 04:16:42 2019 (r351539) +++ head/sys/dev/cxgbe/tom/t4_tls.c Tue Aug 27 04:19:40 2019 (r351540) @@ -590,7 +590,7 @@ program_key_context(struct tcpcb *tp, struct toepcb *t "KEY_WRITE_TX", uk_ctx->proto_ver); if (G_KEY_GET_LOC(uk_ctx->l_p_key) == KEY_WRITE_RX && - toep->ulp_mode != ULP_MODE_TLS) + ulp_mode(toep) != ULP_MODE_TLS) return (EOPNOTSUPP); /* Don't copy the 'tx' and 'rx' fields. */ @@ -788,7 +788,7 @@ t4_ctloutput_tls(struct socket *so, struct sockopt *so INP_WUNLOCK(inp); break; case TCP_TLSOM_CLR_TLS_TOM: - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { CTR2(KTR_CXGBE, "%s: tid %d CLR_TLS_TOM", __func__, toep->tid); tls_clr_ofld_mode(toep); @@ -797,7 +797,7 @@ t4_ctloutput_tls(struct socket *so, struct sockopt *so INP_WUNLOCK(inp); break; case TCP_TLSOM_CLR_QUIES: - if (toep->ulp_mode == ULP_MODE_TLS) { + if (ulp_mode(toep) == ULP_MODE_TLS) { CTR2(KTR_CXGBE, "%s: tid %d CLR_QUIES", __func__, toep->tid); tls_clr_quiesce(toep); @@ -820,7 +820,7 @@ t4_ctloutput_tls(struct socket *so, struct sockopt *so */ optval = TLS_TOM_NONE; if (can_tls_offload(td_adapter(toep->td))) { - switch (toep->ulp_mode) { + switch (ulp_mode(toep)) { case ULP_MODE_NONE: case ULP_MODE_TCPDDP: optval = TLS_TOM_TXONLY; @@ -853,7 +853,7 @@ tls_init_toep(struct toepcb *toep) tls_ofld->key_location = TLS_SFO_WR_CONTEXTLOC_DDR; tls_ofld->rx_key_addr = -1; tls_ofld->tx_key_addr = -1; - if (toep->ulp_mode == ULP_MODE_TLS) + if (ulp_mode(toep) == ULP_MODE_TLS) callout_init_mtx(&tls_ofld->handshake_timer, &tls_handshake_lock, 0); } @@ -882,7 +882,7 @@ void tls_uninit_toep(struct toepcb *toep) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 27 05:18:26 2019 Return-Path: Delivered-To: svn-src-head@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 0B6B7CA316; Tue, 27 Aug 2019 05:18:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (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 46HcbN5Ncqz4PJP; Tue, 27 Aug 2019 05:18:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x242.google.com with SMTP id b25so14016897oib.4; Mon, 26 Aug 2019 22:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1Bl6nG/cv4QU7TswMSuSRJDq7KYs5rKmg/gq+2bjjXg=; b=pZNB7QQEwJYmuBVVSt3rrhae2TocQC1whI71Hh2KZNmC+eSrgRVLQwgy3uLEDSUcam 9TuTKfdLHEq21cfgml0hD8myqKy7eAXUYmjSTa61HxkunC0QEYvF+ixlq1FjP14ojeHA I9V7wMSWSqd8P+eDOvUX1a0AEBeGmBSHZGuBwhl2zzwbuIORNM5+2WvRfGL4R2JY87Bs d5vpthAVdY9T+KnSK9+h3yS3qsSKEwt19DjAPckH1SJjSyDZfScNLlXC2Td/7lx9O6gY Bn9zESpcy6nj0V8sacwayDbziRgpyfiP1tHB3+YtPXga0+61SAXjzc5OMso1jNd6psX3 LutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1Bl6nG/cv4QU7TswMSuSRJDq7KYs5rKmg/gq+2bjjXg=; b=mJFDPHNJQVKIluvRSC7rwNGH016u/1GQJ9ygtuP0losrltGP78Cylz+4Hd6Lr4+tYt 5RA9Z8jax9+V0JrQR1BXUI/7TStZXsR0Zp5CN+38scHwcqbkZ8R6SnEab1l94W3H9QRh nRXlzIpbQhmFqnGBY91Ge2SnNmVxhaZk+yW92v64Rvd2eOB5mc8Epbh7yk7Xkf7y6s+o iTaUPrvXeX9kGIvf/qANmljQf0obGszzpN8uU2hKvQaOEa+rR2Mbk8/Tz2jDnvO9kqeJ 59hXGvKpJTrSn56DDbpxBPW9oLBlhP3ZfRIgakEEMb0JqRBw1F4G2Nv+Gd7TWoHPPlRn uouw== X-Gm-Message-State: APjAAAWFTw3Qn46phUCaCON0hKypt5/ymZqIkSgGymTN7YalUChBFY9o fuZ6GSo7XR4h20Oqtos9X8uigvloqml5YZBuhSM= X-Google-Smtp-Source: APXvYqzaXn13uNqcYd7TDfvL7viPm+cQdpMD7bHCFM8giYohDkvftbj5LXxqqnNp+3ciWqoHH2EXjth/IqpE9FJn73k= X-Received: by 2002:aca:bb42:: with SMTP id l63mr15346725oif.85.1566883103335; Mon, 26 Aug 2019 22:18:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Mon, 26 Aug 2019 22:18:22 -0700 (PDT) In-Reply-To: <201908270417.x7R4HcfE024857@slippy.cwsent.com> References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> <201908270341.x7R3fJne062385@slippy.cwsent.com> <201908270417.x7R4HcfE024857@slippy.cwsent.com> From: Mateusz Guzik Date: Tue, 27 Aug 2019 07:18:22 +0200 Message-ID: Subject: Re: svn commit: r351472 - head/sys/fs/nullfs To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46HcbN5Ncqz4PJP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pZNB7QQE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::242 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.45), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.4.2.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]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 05:18:26 -0000 This survived light testing for me: https://people.freebsd.org/~mjg/unionfs-interlock.diff note unionfs instantly panics with DEBUG_VFS_LOCKS regardless of any of this work. On 8/27/19, Cy Schubert wrote: > In message > om> > , Mateusz Guzik writes: >> On 8/27/19, Cy Schubert wrote: >> > Making progress: >> > >> > Unread portion of the kernel message buffer: >> > >> > panic: null_unlock: LK_INTERLOCK passed >> > cpuid = 2 >> > time = 1566868081 >> > KDB: stack backtrace: >> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> > 0xfffffe0054a954e0 >> > vpanic() at vpanic+0x19d/frame 0xfffffe0054a95530 >> > panic() at panic+0x43/frame 0xfffffe0054a95590 >> > null_unlock() at null_unlock+0x8a/frame 0xfffffe0054a955d0 >> > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a955f0 >> > unionfs_unlock() at unionfs_unlock+0x124/frame 0xfffffe0054a95650 >> > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a95670 >> > vfs_domount() at vfs_domount+0xc3f/frame 0xfffffe0054a958a0 >> > vfs_donmount() at vfs_donmount+0x934/frame 0xfffffe0054a95940 >> > sys_nmount() at sys_nmount+0x69/frame 0xfffffe0054a95980 >> > amd64_syscall() at amd64_syscall+0x3ae/frame 0xfffffe0054a95ab0 >> > fast_syscall_common() at fast_syscall_common+0x101/frame >> > 0xfffffe0054a95ab0 >> > --- syscall (378, FreeBSD ELF64, sys_nmount), rip = 0x2bed6a4a, rsp = >> > 0x7fffffffe2e8, rbp = 0x7fffffffec70 --- >> > Uptime: 1m35s >> > >> >> Ok, this explains everything. I did not think anyone uses unionfs, >> let alone stacked on top of nullfs. I'll have a patch later. > > It's for a few jails. Thanks for persevering. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 06:05:35 2019 Return-Path: Delivered-To: svn-src-head@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 9EDC5CBB01; Tue, 27 Aug 2019 06:05:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Hddp4KVfz4S4r; Tue, 27 Aug 2019 06:05:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 2UbiixAXySrVc2Ubjioq3M; Tue, 27 Aug 2019 00:05:32 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=XtL3EJd_C5O2CnR2E_EA:9 a=CjuIK1q_8ugA:10 a=7uh6xexeqkIA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=BVt-rVABO2UG3ysEI_l-:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C8F14BF3; Mon, 26 Aug 2019 23:05:28 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x7R65SkT005406; Mon, 26 Aug 2019 23:05:28 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x7R65Ss4005403; Mon, 26 Aug 2019 23:05:28 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908270605.x7R65Ss4005403@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mateusz Guzik cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351472 - head/sys/fs/nullfs In-reply-to: References: <201908250513.x7P5DFFx017824@repo.freebsd.org> <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com> <201908261411.x7QEBMWi075354@slippy.cwsent.com> <201908270025.x7R0PtNT008594@slippy.cwsent.com> <201908270341.x7R3fJne062385@slippy.cwsent.com> <201908270417.x7R4HcfE024857@slippy.cwsent.com> Comments: In-reply-to Mateusz Guzik message dated "Tue, 27 Aug 2019 07:18:22 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 26 Aug 2019 23:05:28 -0700 X-CMAE-Envelope: MS4wfLwlbdfF8kv232mVEklW4gXGN6H8sHifyvsPW5mgPETNDAUjPc7lzUhy0wTnDg+IUqMlNFqq04PTzKsrAjfJmnJkOR0QPD1fMIJ9VQydPi5mu3M5XXuG tUVlYaGp2e2eKirk+ecKXqeqy66W4o2Hd+IqjkCSm5zQPOMoOBKtJia9O53XrJZaTLzJJbzrxD+GCv7jKsfrf/IBZWMlkbjX1h+fJCa5RwX65dA75PG1GexN DLl/jr3AWbjz0ZK2WfQabLJFiMzD2hS8EUjMBB3mMKE= X-Rspamd-Queue-Id: 46Hddp4KVfz4S4r X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.89 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; RCVD_IN_DNSWL_NONE(0.00)[137.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.32)[ip: (-5.93), ipnet: 64.59.128.0/20(-3.14), asn: 6327(-2.44), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 06:05:35 -0000 It works for me too. Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Mateusz Guzik writes: > This survived light testing for me: > > https://people.freebsd.org/~mjg/unionfs-interlock.diff > > note unionfs instantly panics with DEBUG_VFS_LOCKS regardless > of any of this work. > > On 8/27/19, Cy Schubert wrote: > > In message > > > om> > > , Mateusz Guzik writes: > >> On 8/27/19, Cy Schubert wrote: > >> > Making progress: > >> > > >> > Unread portion of the kernel message buffer: > >> > > >> > panic: null_unlock: LK_INTERLOCK passed > >> > cpuid = 2 > >> > time = 1566868081 > >> > KDB: stack backtrace: > >> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >> > 0xfffffe0054a954e0 > >> > vpanic() at vpanic+0x19d/frame 0xfffffe0054a95530 > >> > panic() at panic+0x43/frame 0xfffffe0054a95590 > >> > null_unlock() at null_unlock+0x8a/frame 0xfffffe0054a955d0 > >> > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a955f0 > >> > unionfs_unlock() at unionfs_unlock+0x124/frame 0xfffffe0054a95650 > >> > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x56/frame 0xfffffe0054a95670 > >> > vfs_domount() at vfs_domount+0xc3f/frame 0xfffffe0054a958a0 > >> > vfs_donmount() at vfs_donmount+0x934/frame 0xfffffe0054a95940 > >> > sys_nmount() at sys_nmount+0x69/frame 0xfffffe0054a95980 > >> > amd64_syscall() at amd64_syscall+0x3ae/frame 0xfffffe0054a95ab0 > >> > fast_syscall_common() at fast_syscall_common+0x101/frame > >> > 0xfffffe0054a95ab0 > >> > --- syscall (378, FreeBSD ELF64, sys_nmount), rip = 0x2bed6a4a, rsp = > >> > 0x7fffffffe2e8, rbp = 0x7fffffffec70 --- > >> > Uptime: 1m35s > >> > > >> > >> Ok, this explains everything. I did not think anyone uses unionfs, > >> let alone stacked on top of nullfs. I'll have a patch later. > > > > It's for a few jails. Thanks for persevering. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > > > > > -- > Mateusz Guzik > From owner-svn-src-head@freebsd.org Tue Aug 27 08:21:15 2019 Return-Path: Delivered-To: svn-src-head@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 923B4CF93B; Tue, 27 Aug 2019 08:21:15 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mail.nginx.com (mail.nginx.com [206.251.255.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 46HhfM3P6Yz4bBK; Tue, 27 Aug 2019 08:21:15 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from [192.168.33.76] (unknown [82.204.252.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.nginx.com (Postfix) with ESMTPSA id E0DB82C50CDB; Tue, 27 Aug 2019 08:21:06 +0000 (UTC) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... To: John Baldwin References: <201908270001.x7R01vUB052426@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Maxim Konovalov Openpgp: preference=signencrypt Autocrypt: addr=maxim.konovalov@gmail.com; keydata= mQGiBDzqHSERBACUPYN18/fnXdsI3CsH/UgX7CL1yLSgTCTbEA7p/jPA78svM0KtaHdZG+mh ZH9u//SaPuKPoF6OST7pb5ee48bppzL8v1+zYIAUWib/ImR/ZEGi5SzMmYtNCrK3YTblaHoe KKSrVwYvFi4HYQZWG3hcXaozhZRVQTnGnDdQYriSVwCg24PlUzXu1n8lw+4zDlW3eGIkxEMD /RpnH5n8maXO5MYRvuBpGGTF7x3iV0somnLhQ1Th1WD/7OhRRzfRpXarG8ObyxyPx52et6tG V9IjSdO+uuVgtTUFRKsr6QYk/y49blntpGtd4kTHMy99Zt/GP/CBBWn7dQtMGABDobA0ZU5I LkSlZ+DHtZLEkIXljhxIyhbwsIQzBACKTwIrcF0trhi2dibKMOWqy8RYP5iKe1vXy5SCdcU7 HxicHGzI0oRdlCHTjh0pik8YWI24d18UdHDhvWHxbF/QCBbW+RAyiNASzzdsiIswo9Zvras/ NZbnagHBtP80kBhLVC4udmO7GKYxKjpgsuqihaFJdcpoxx8J6mv2sTxK1rQhTWF4aW0gS29u b3ZhbG92IDxtYXhpbUBuZ2lueC5jb20+iGUEExEKACUCGwMGCwkIBwMCBhUIAgkKCwQWAgMB Ah4BAheABQJT9a+bAhkBAAoJEOzw6QssFyCDIfkAnipxGxSmdmjVmbcHHykfNsAEJ2bvAJ47 cIgMc4xPafu4R6+g1FXMlGhDiLkBDQQ86h0kEAQAgnnpxiAEyPMbrmBFl+EPukQ+vAmPHsWJ R4ASroOK5IzRbvkuxY4Qs5JcgieLcXS3xByPK6k7x+ep0E/0kQLOKHk8hiaEcR/jrzitEjCR rknbnoDRD0esEoXYCXLBJnnqmxrmY1sWvae/W4g/a3llwhIRaxo8AGQyzAyb6FgLvmsAAwYD /jrEYR09a/j3g9rVgP8dsADIH3jxtnxCNkEINAWbchCvjQQOblhWWU0FKjtjDxjsanwCj5Zg QRPrSQQG0BNeviM1yWfg1L9SYZVfv29ryQw9znMBCWiJPvyEKQ5BkcLXnr3UcQ036mkSNdV2 w2MDOLtmiT048clx8V4lfT+vcK5kiEYEGBECAAYFAjzqHSQACgkQ7PDpCywXIINCNgCgxAU2 CBSYytZ08F0WHxxMeInrYi0An2zFJGYtLghVu9Q0P8Okqu2blMIC Message-ID: <285e9e26-a2fb-e882-c4bf-ce66e3814870@gmail.com> Date: Tue, 27 Aug 2019 11:21:04 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201908270001.x7R01vUB052426@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46HhfM3P6Yz4bBK X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 08:21:15 -0000 On 27/08/2019 03:01, John Baldwin wrote: > Author: jhb > Date: Tue Aug 27 00:01:56 2019 > New Revision: 351522 > URL: https://svnweb.freebsd.org/changeset/base/351522 > > Log: > Add kernel-side support for in-kernel TLS. > [...] > This patch is the culmination of years of work by several folks > including Scott Long and Randall Stewart for the original design and > implementation; Drew Gallatin for several optimizations including the > use of ext_pgs mbufs, the M_NOTREADY mechanism for TLS records > awaiting software encryption, and pluggable software crypto backends; > and John Baldwin for modifications to support hardware TLS offload. > This is super-cool, gentlemen! My congratulations with great job done. -- Maxim Konovalov From owner-svn-src-head@freebsd.org Tue Aug 27 08:28:39 2019 Return-Path: Delivered-To: svn-src-head@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 9F72CCFDCF; Tue, 27 Aug 2019 08:28:39 +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 46Hhpv3gPjz4bmk; Tue, 27 Aug 2019 08:28:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FC401BF08; Tue, 27 Aug 2019 08:28:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7R8SdEM055387; Tue, 27 Aug 2019 08:28:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7R8Sdmh055386; Tue, 27 Aug 2019 08:28:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908270828.x7R8Sdmh055386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Aug 2019 08:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351542 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 08:28:39 -0000 Author: kib Date: Tue Aug 27 08:28:38 2019 New Revision: 351542 URL: https://svnweb.freebsd.org/changeset/base/351542 Log: vn_vget_ino_gen(): relock the lower vnode on error. The function' interface assumes that the lower vnode is passed and returned locked always. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Aug 27 07:17:31 2019 (r351541) +++ head/sys/kern/vfs_vnops.c Tue Aug 27 08:28:38 2019 (r351542) @@ -2097,7 +2097,7 @@ vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, VOP_UNLOCK(vp, 0); error = alloc(mp, alloc_arg, lkflags, rvp); vfs_unbusy(mp); - if (*rvp != vp) + if (error != 0 || *rvp != vp) vn_lock(vp, ltype | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { if (error == 0) { From owner-svn-src-head@freebsd.org Tue Aug 27 09:20:02 2019 Return-Path: Delivered-To: svn-src-head@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 7565ED0FAD; Tue, 27 Aug 2019 09:20:02 +0000 (UTC) (envelope-from mmel@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 46HjyB2S5fz4f14; Tue, 27 Aug 2019 09:20:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 359271C7F7; Tue, 27 Aug 2019 09:20:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7R9K2CA085225; Tue, 27 Aug 2019 09:20:02 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7R9K1jJ085222; Tue, 27 Aug 2019 09:20:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908270920.x7R9K1jJ085222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 27 Aug 2019 09:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351543 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 351543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 09:20:02 -0000 Author: mmel Date: Tue Aug 27 09:20:01 2019 New Revision: 351543 URL: https://svnweb.freebsd.org/changeset/base/351543 Log: Add support for RK3288 into existing RockChip drivers. This patch ensures only minimal level of compatibility necessary to boot on RK3288 based boards. GPIO and pinctrl interaction, missing in current implementation, will be improved by own patch in the near future. MFC after: 2 weeks MFC with: r351452 Modified: head/sys/arm64/rockchip/if_dwc_rk.c head/sys/arm64/rockchip/rk_gpio.c head/sys/arm64/rockchip/rk_grf.c Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Tue Aug 27 08:28:38 2019 (r351542) +++ head/sys/arm64/rockchip/if_dwc_rk.c Tue Aug 27 09:20:01 2019 (r351543) @@ -65,6 +65,13 @@ __FBSDID("$FreeBSD$"); #define RK3328_GRF_MACPHY_CON3 0x0B0C #define RK3328_GRF_MACPHY_STATUS 0x0B10 +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk3288-gmac", 1}, + {"rockchip,rk3328-gmac", 1}, + {"rockchip,rk3399-gmac", 1}, + {NULL, 0} +}; + #ifdef notyet static void rk3328_set_delays(struct syscon *grf, phandle_t node) @@ -117,8 +124,7 @@ if_dwc_rk_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!(ofw_bus_is_compatible(dev, "rockchip,rk3328-gmac") || - ofw_bus_is_compatible(dev, "rockchip,rk3399-gmac"))) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Rockchip Gigabit Ethernet Controller"); Modified: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- head/sys/arm64/rockchip/rk_gpio.c Tue Aug 27 08:28:38 2019 (r351542) +++ head/sys/arm64/rockchip/rk_gpio.c Tue Aug 27 09:20:01 2019 (r351543) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_soc.h" - #include "gpio_if.h" #define RK_GPIO_SWPORTA_DR 0x00 /* Data register */ @@ -196,6 +194,7 @@ rk_gpio_pin_max(device_t dev, int *maxpin) { /* Each bank have always 32 pins */ + /* XXX not true*/ *maxpin = 32; return (0); } @@ -225,6 +224,7 @@ rk_gpio_pin_getflags(device_t dev, uint32_t pin, uint3 sc = device_get_softc(dev); + /* XXX Combine this with parent (pinctrl) */ RK_GPIO_LOCK(sc); reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); RK_GPIO_UNLOCK(sc); @@ -242,6 +242,7 @@ rk_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32 { /* Caps are managed by the pinctrl device */ + /* XXX Pass this to parent (pinctrl) */ *caps = 0; return (0); } @@ -254,6 +255,7 @@ rk_gpio_pin_setflags(device_t dev, uint32_t pin, uint3 sc = device_get_softc(dev); + /* XXX Combine this with parent (pinctrl) */ RK_GPIO_LOCK(sc); reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); @@ -394,6 +396,14 @@ rk_gpio_map_gpios(device_t bus, phandle_t dev, phandle return (0); } +static phandle_t +rk_gpio_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + static device_method_t rk_gpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, rk_gpio_probe), @@ -414,6 +424,9 @@ static device_method_t rk_gpio_methods[] = { DEVMETHOD(gpio_pin_config_32, rk_gpio_pin_config_32), DEVMETHOD(gpio_map_gpios, rk_gpio_map_gpios), + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, rk_gpio_get_node), + DEVMETHOD_END }; @@ -425,5 +438,10 @@ static driver_t rk_gpio_driver = { static devclass_t rk_gpio_devclass; +/* + * GPIO driver is always a child of rk_pinctrl driver and should be probed + * and attached within rk_pinctrl_attach function. Due to this, bus pass order + * must be same as bus pass order of rk_pinctrl driver. + */ EARLY_DRIVER_MODULE(rk_gpio, simplebus, rk_gpio_driver, - rk_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); + rk_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/rockchip/rk_grf.c ============================================================================== --- head/sys/arm64/rockchip/rk_grf.c Tue Aug 27 08:28:38 2019 (r351542) +++ head/sys/arm64/rockchip/rk_grf.c Tue Aug 27 09:20:01 2019 (r351543) @@ -44,16 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_soc.h" - static struct ofw_compat_data compat_data[] = { -#ifdef SOC_ROCKCHIP_RK3328 + {"rockchip,rk3288-grf", 1}, {"rockchip,rk3328-grf", 1}, -#endif -#ifdef SOC_ROCKCHIP_RK3399 {"rockchip,rk3399-grf", 1}, {"rockchip,rk3399-pmugrf", 1}, -#endif {NULL, 0} }; From owner-svn-src-head@freebsd.org Tue Aug 27 09:56:40 2019 Return-Path: Delivered-To: svn-src-head@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 91FE6D188C; Tue, 27 Aug 2019 09:56:40 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 46HkmR4Yqhz3BtS; Tue, 27 Aug 2019 09:56:39 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id i63so2324700wmg.4; Tue, 27 Aug 2019 02:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:cc:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=WK0lKMqesdW4pxEf2rIAmFAaCc0uJnbzqMsYYTMVE6o=; b=B523OmJL/V+dhMxSN0xAGJEJKYk6jAEu1bsnQWXbNgb+hFbAm9jrd5Q6jg7d3uVU9O e0Fm2cPEMVbSKqG6LIR9J6Qb7SzOvWc1myuhShSQpLKwqEBw5n6LAIV34nPaIembV4Tg NfebPoMvX5ahC+0soOdao4N34LRsV4IhDWok6xOX24YllrlkGjsROGs/l1Wev/J5ZMB4 osTuc19luKnFbuSMfpPFDvLOcGzC/5aV5ncEj43y/GAM+B658OQ28YvvINHqORc1ivQT qYQTXwfhj0qZ6FnatV9FEhAK/jxlk5zAApwLGQrln5w+9WH0318LRP9XLw/MnIE4nUqf 3G8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:cc:references :openpgp:autocrypt:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=WK0lKMqesdW4pxEf2rIAmFAaCc0uJnbzqMsYYTMVE6o=; b=Q9HQTdfAQIVrSHENUlSG0MPJdrcwbnlUfh96FLWl2LKKHhlN9PSEq9Nr+BCPTsi/HG cX+RdebNQSFuFxSZww2h/RiKC0qgDQYzw1LjqIUrD683lf9KLK1Lk9wvGtmupeJOMgto nqhNBeMq95/EN2tqVElTS9qj2oodvO5oNfoSTqhZzMm87iiZXWiw5grPebaEgB7kNqB9 1NqRIv2+I1c5f+BDAm1ksoMDGQJ7gFoh870+d1edpHabZ1Vk7FCfzrkxFrZp+ZUfpsw2 sehCrfN5TISaP9HW62jDBWbMid6brelWeZgKiU3s4HBHprT0QRuXutaKVb54x2cjeQCG G8UA== X-Gm-Message-State: APjAAAUu/Jc2Rp4cDEWexe20EoaUmDYI3McVZFdd/zd1DxExJZBqbDFx sWHaOzmSEdJg08ledniMnrxZp4/G X-Google-Smtp-Source: APXvYqxhuEbb5cPU+3GaWQNOx7jsFi+MMX9KLsTT7iEQZHSUipT64MywEnpRMEbFXHnAGyWEW5EOZQ== X-Received: by 2002:a1c:4383:: with SMTP id q125mr9190881wma.16.1566899796803; Tue, 27 Aug 2019 02:56:36 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id 91sm48168093wrp.3.2019.08.27.02.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2019 02:56:36 -0700 (PDT) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r351187 - head/sys/arm64/rockchip To: Peter Jeremy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908180919.x7I9JXGj021325@repo.freebsd.org> <20190825072844.GA4799@server.rulingia.com> Openpgp: preference=signencrypt Autocrypt: addr=mmel@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFYuVRkBCADZiwLCCne3wG9b9k+R2Neo5zVo2bLaZRfNNY/v9kg283i0sb1Da4EdEiNT 15El5UyozhphUIbIR/zrVpxF1TvvFdoCyzx6a68bNY2d9dBrDcNDZC+XnyDdHQoobN87DWT1 mRVkmbg9LHZ/SVUOkGYuWyE+8UYeDAcUizuXwSK5zFWmeTyIoWNa68ifrWLfQe0p4x5jC/AI VURCi17p360vU4fhgwoMvEEhrRBWCr4DYHToFjIt2WdBy3GR1qoO0+Xkd6G+OoBULo+XDfgu L2WdPvh0K69F9/LgHkMmG5Il7SCe62QGpG2vaCgRV7BQhLX+kxlvM+WrdRatWRml4Y/3ABEB AAG0IE1pY2hhbCBNZWxvdW4gPG1tZWxAZnJlZWJzZC5vcmc+iQFXBBMBCgBBAhsDBQsJCAcD BRUKCQgLBRYDAgEAAh4BAheAAhkBFiEEAN1KEEuAn+Apg413aR6ya17FqqoFAlw3aO8FCQ9v FVYACgkQaR6ya17FqqrIFwf/V/NRuAutw1cZ/HRCwfp00KY+8g730KwOaAMhPYvq8tqf8krD whFRWt9s4DSVTVJUC2dRZa5g1MS77iQL/WWzBUhJj7rW4uMpcKpi7UXi060sKrnE+1ZBvanG 8YCMTHKxQgQDD0cBqsyOAfrSA+Pyya3/HyAh1vvjQZfu5vWxA1X5NX5l5KtonprJ+ybVacwO W34yfWSX+ncx089JpUknenGdI+gVoKfa6uh/8YiCZTI5poxBttrOB8NGfylTsTTTbw2pkire Vkc87qq++I9bBNtTqWOZjB/3KBUd4q1veEUa4MS63TWtAvcEcsxHiBv4AH6npPO/iPycuGGh qldT1LkBDQRWLlUZAQgAuqBGR9LbUP86pYT2Zd+HZsiOun24LxPQwK6KZuysB0so02isa7ac T6t5uBfyfmdgzfvsc6dqU8bI65e8JtDwwVVF1Y4fF6cmNcmJqU10Gw5/bAu9re9JJWx2g/OJ tYMhwmqEE5DcS6GwgvJZI+9hgoSLL3mZ+GsO25NM4BhVH1o1AE4Q3O0HZMMnIzH+pma0augZ Xc3Qep17/Occ+1A7xEbn8VAYx8cwjkYUy7JyvVx4ecuj+i+uoCXhNhX5QdIcn4UMT1233Bcd yVZtZsLTI26ByFmrquGjkmN+/hra/s+nKfcegOKeHWVY/uFgDRk0TEYd6QuddZWo7+XMZLps wQARAQABiQElBBgBCgAPAhsMBQJZjBHDBQkHICOqAAoJEGkesmtexaqquysH/iDgRIrlMvFT GLyktZws/K/C03gWZ/tWwJV5+SFqRoasM+Z+9+cb44XA3rReqieLsYF5qSXTXHBPhEg1+9V9 KEPLpwektLtAv8zynN+6VVffwyRWQ4PIZmHCMT6PJP+Rk0DU6VrDc3ch58erduuyRDsbh32g 96nYMNvDsLhDvq44GPHLfglUHRY6wHo3IxAH2HosaWNC10R13JSrCdFnPMeIa+nSE+11hAdB mWpuPgVX2VNErtrwSBr7LsyCZ4yLO0bN5fKM0/Tavc9EcI9qDBrnts/EfZoCHhDtTMEFnQZM ybsMso20I/nxYPFuWuuFn7uQeoYrwWxt15SkN0RgtV2JATwEGAEKACYCGwwWIQQA3UoQS4Cf 4CmDjXdpHrJrXsWqqgUCXDdpmwUJD28WAgAKCRBpHrJrXsWqqtOrB/9Okk/dm2/mAs3tbA6l lKOZAwfUwBonwG7YhK9dOb5No/bJoY8G9s2IVXqwWKqCDv1qKC4M8pMXPD9fVsfNPG8GA1GZ rpZoZxHFteXZHoE1grpWypE0T3hp1W0hQNWXKv0MSuEMRVKU1m/iyLa10X7q8BaKtEDs35Xf DCh7eVg1vqiKtWyFn1u+y9Gy1Ztc/SKTs8mQvMYNUdBZuV6vN0VSz3I6wD9HVfo6Eo3M7cVp qqQ+KhrrGiCCYQPfZwpFAJSSgV3bR5O0BlNaGKJOoVTV1yexRbVEStswiFP8JFQp6U+S3nqE FFob7daQBLxi80oUVRn6eEdzR8tBhIy7sbeD Message-ID: <6da78585-2bc7-0228-e443-799643d08783@freebsd.org> Date: Tue, 27 Aug 2019 11:56:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190825072844.GA4799@server.rulingia.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46HkmR4Yqhz3BtS X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=B523OmJL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.95 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (3.09), ipnet: 2a00:1450::/32(-3.00), asn: 15169(-2.33), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.4.3.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]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 09:56:40 -0000 On 25.08.2019 9:28, Peter Jeremy wrote: > On 2019-Aug-18 09:19:33 +0000, Michal Meloun > wrote: >> Improve rk_pinctrl driver: > > Sorry for the late notice but this breaks my Rock64 (RK3328). > Sorry for late response. Seems like this is caused by unnoticed dependency between patches in my worktree, sorry for this. I hope that r351543 solves it. Can you, please, try r351543 on Rock64 because I haven't any rk3328 based board for real test? Thanks Michal > I'm using: U-Boot 2017.09-rockchip-ayufan-1035-gd646df03ac (Oct 26 > 2018 - 08:36:01 +0000) > > At r351452, the kernel boot looks like: ... gic0: Interrupt Controller> mem > 0xff811000-0xff811fff,0xff812000-0xff813fff,0xff814000-0xff815fff,0xff816000-0xff817fff > irq 48 on ofwbus0 gic0: pn 0x2, arch 0x2, rev 0x1, implementer > 0x43b irqs 160 rk_pinctrl0: on > ofwbus0 rk_pinctrl0: Cannot attach GPIO subdevice: gpio0@ff210000 > rk_pinctrl0: Cannot attach GPIO subdevice: gpio1@ff220000 > rk_pinctrl0: Cannot attach GPIO subdevice: gpio2@ff230000 > rk_pinctrl0: Cannot attach GPIO subdevice: gpio3@ff240000 panic: > acquiring blockable sleep lock with spinlock or critical section > held (sleep mutex) pmap @ /usr/src/sys/arm64/arm64/pmap.c:5819 > cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self() at > db_trace_self_wrapper+0x28 pc = 0xffff00000054c9ac lr = > 0xffff0000000e2908 sp = 0xffff000000010100 fp = > 0xffff000000010310 > > db_trace_self_wrapper() at vpanic+0x18c pc = 0xffff0000000e2908 lr > = 0xffff00000027e848 sp = 0xffff000000010320 fp = > 0xffff0000000103c0 > > vpanic() at panic+0x44 pc = 0xffff00000027e848 lr = > 0xffff00000027e5f8 sp = 0xffff0000000103d0 fp = > 0xffff000000010450 > > panic() at witness_checkorder+0xa80 pc = 0xffff00000027e5f8 lr = > 0xffff0000002e5348 sp = 0xffff000000010460 fp = > 0xffff0000000104d0 > > witness_checkorder() at __mtx_lock_flags+0xb0 pc = > 0xffff0000002e5348 lr = 0xffff00000025e574 sp = 0xffff0000000104e0 > fp = 0xffff000000010520 > > __mtx_lock_flags() at pmap_fault+0x1bc pc = 0xffff00000025e574 lr > = 0xffff000000566c00 sp = 0xffff000000010530 fp = > 0xffff000000010550 > > pmap_fault() at data_abort+0xc0 pc = 0xffff000000566c00 lr = > 0xffff000000568a68 sp = 0xffff000000010560 fp = > 0xffff000000010610 > > data_abort() at do_el1h_sync+0x128 pc = 0xffff000000568a68 lr = > 0xffff0000005688a4 sp = 0xffff000000010620 fp = > 0xffff000000010650 > > do_el1h_sync() at handle_el1h_sync+0x74 pc = 0xffff0000005688a4 lr > = 0xffff00000054f074 sp = 0xffff000000010660 fp = > 0xffff000000010770 > > handle_el1h_sync() at simple_mfd_syscon_modify_4+0x60 pc = > 0xffff00000054f074 lr = 0xffff0000000fd334 sp = 0xffff000000010780 > fp = 0xffff000000010830 > > simple_mfd_syscon_modify_4() at rk_pinctrl_configure_pins+0x1b4 pc > = 0xffff0000000fd334 lr = 0xffff0000005795fc sp = > 0xffff000000010840 fp = 0xffff0000000108c0 > > rk_pinctrl_configure_pins() at pinctrl_configure_children+0x120 pc > = 0xffff0000005795fc lr = 0xffff0000000fc4dc sp = > 0xffff0000000108d0 fp = 0xffff000000010950 > > pinctrl_configure_children() at fdt_pinctrl_configure_tree+0x20 pc > = 0xffff0000000fc4dc lr = 0xffff0000000fc3a8 sp = > 0xffff000000010960 fp = 0xffff000000010970 > > fdt_pinctrl_configure_tree() at rk_pinctrl_attach+0x310 pc = > 0xffff0000000fc3a8 lr = 0xffff000000579414 sp = 0xffff000000010980 > fp = 0xffff0000000109e0 > > rk_pinctrl_attach() at device_attach+0x3f4 pc = 0xffff000000579414 > lr = 0xffff0000002b3f18 sp = 0xffff0000000109f0 fp = > 0xffff000000010a40 > > device_attach() at bus_generic_new_pass+0x12c pc = > 0xffff0000002b3f18 lr = 0xffff0000002b5ccc sp = 0xffff000000010a50 > fp = 0xffff000000010a80 > > bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc = > 0xffff0000002b5ccc lr = 0xffff0000002b5c84 sp = 0xffff000000010a90 > fp = 0xffff000000010ac0 > > bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc = > 0xffff0000002b5c84 lr = 0xffff0000002b5c84 sp = 0xffff000000010ad0 > fp = 0xffff000000010b00 > > bus_generic_new_pass() at bus_set_pass+0x8c pc = 0xffff0000002b5c84 > lr = 0xffff0000002b1674 sp = 0xffff000000010b10 fp = > 0xffff000000010b40 > > bus_set_pass() at mi_startup+0x238 pc = 0xffff0000002b1674 lr = > 0xffff000000217b50 sp = 0xffff000000010b50 fp = > 0xffff000000010bb0 > > mi_startup() at virtdone+0x54 pc = 0xffff000000217b50 lr = > 0xffff000000001084 sp = 0xffff000000010bc0 fp = > 0x0000000000000000 ---- > > When I revert r351187, I get: ... gic0: Controller> mem > 0xff811000-0xff811fff,0xff812000-0xff813fff,0xff814000-0xff815fff,0xff816000-0xff817fff > irq 48 on ofwbus0 gic0: pn 0x2, arch 0x2, rev 0x1, implementer > 0x43b irqs 160 rk_pinctrl0: on > ofwbus0 rk_i2c0: mem 0xff160000-0xff160fff irq 16 on > ofwbus0 iicbus0: on rk_i2c0 gpio0: Bank controller> mem 0xff210000-0xff2100ff irq 51 on rk_pinctrl0 > gpiobus0: on gpio0 gpio1: controller> mem 0xff220000-0xff2200ff irq 52 on rk_pinctrl0 > gpiobus1: on gpio1 gpio2: controller> mem 0xff230000-0xff2300ff irq 53 on rk_pinctrl0 > gpiobus2: on gpio2 gpio3: controller> mem 0xff240000-0xff2400ff irq 54 on rk_pinctrl0 > gpiobus3: on gpio3 rk805_pmu0: at > addr 0x30 irq 55 on iicbus0 ... > > I haven't dug into this further yet. > From owner-svn-src-head@freebsd.org Tue Aug 27 11:46:25 2019 Return-Path: Delivered-To: svn-src-head@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 0BB4CD3432; Tue, 27 Aug 2019 11:46:25 +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 46HnC505krz3HLk; Tue, 27 Aug 2019 11:46:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6F31E35E; Tue, 27 Aug 2019 11:46:24 +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 x7RBkO4o079468; Tue, 27 Aug 2019 11:46:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RBkNAu079456; Tue, 27 Aug 2019 11:46:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908271146.x7RBkNAu079456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 27 Aug 2019 11:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351544 - in head: lib/msun/man share/man/man3 sys/sys tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/msun/man share/man/man3 sys/sys tests/sys/sys X-SVN-Commit-Revision: 351544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 11:46:25 -0000 Author: trasz Date: Tue Aug 27 11:46:22 2019 New Revision: 351544 URL: https://svnweb.freebsd.org/changeset/base/351544 Log: Introduce , a fixed-point math library from Netflix.
 This makes it possible to perform mathematical operations
on fractional values without using floating point. It operates on Q numbers, which are integer-sized, opaque structures initialized to hold a chosen number of integer and fractional
bits.
 For a general description of the Q number system, see the "Fixed Point Representation & Fractional Math" whitepaper[1]; for the actual API see the qmath(3) man page. This is one of dependencies for the upcoming stats(3) framework[2] that will be applied to the TCP stack in a later commit. 1. https://www.superkits.net/whitepapers/Fixed%20Point%20Representation%20&%20Fractional%20Math.pdf 2. https://reviews.freebsd.org/D20477 Reviewed by: bcr (man pages, earlier version), sef (earlier version) Discussed with: cem, dteske, imp, lstewart Sponsored By: Klara Inc, Netflix Obtained from: Netflix Differential Revision: https://reviews.freebsd.org/D20116 Added: head/share/man/man3/Q_FRAWMASK.3 (contents, props changed) head/share/man/man3/Q_IFRAWMASK.3 (contents, props changed) head/share/man/man3/Q_INI.3 (contents, props changed) head/share/man/man3/Q_IRAWMASK.3 (contents, props changed) head/share/man/man3/Q_QABS.3 (contents, props changed) head/share/man/man3/Q_QADDI.3 (contents, props changed) head/share/man/man3/Q_QADDQ.3 (contents, props changed) head/share/man/man3/Q_SIGNED.3 (contents, props changed) head/share/man/man3/Q_SIGNSHFT.3 (contents, props changed) head/share/man/man3/qmath.3 (contents, props changed) head/sys/sys/qmath.h (contents, props changed) head/tests/sys/sys/qmath_test.c (contents, props changed) Modified: head/lib/msun/man/math.3 head/share/man/man3/Makefile head/tests/sys/sys/Makefile Modified: head/lib/msun/man/math.3 ============================================================================== --- head/lib/msun/man/math.3 Tue Aug 27 09:20:01 2019 (r351543) +++ head/lib/msun/man/math.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -217,6 +217,7 @@ rarely, and then only in very-close-to-halfway cases. .Xr complex 3 , .Xr fenv 3 , .Xr ieee 3 , +.Xr qmath 3 , .Xr tgmath 3 .Sh HISTORY A math library with many of the present functions appeared in Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Tue Aug 27 09:20:01 2019 (r351543) +++ head/share/man/man3/Makefile Tue Aug 27 11:46:22 2019 (r351544) @@ -13,6 +13,16 @@ MAN= assert.3 \ makedev.3 \ offsetof.3 \ ${PTHREAD_MAN} \ + Q_FRAWMASK.3 \ + Q_IFRAWMASK.3 \ + Q_INI.3 \ + Q_IRAWMASK.3 \ + Q_QABS.3 \ + Q_QADDI.3 \ + Q_QADDQ.3 \ + Q_SIGNED.3 \ + Q_SIGNSHFT.3 \ + qmath.3 \ queue.3 \ sigevent.3 \ siginfo.3 \ @@ -72,6 +82,68 @@ MLINKS+= fpgetround.3 fpgetmask.3 \ MLINKS+= makedev.3 major.3 \ makedev.3 minor.3 MLINKS+= ${PTHREAD_MLINKS} +MLINKS+= Q_FRAWMASK.3 Q_GFRAW.3 \ + Q_FRAWMASK.3 Q_GFABSVAL.3 \ + Q_FRAWMASK.3 Q_GFVAL.3 \ + Q_FRAWMASK.3 Q_SFVAL.3 +MLINKS+= Q_IFRAWMASK.3 Q_IFVALIMASK.3 \ + Q_IFRAWMASK.3 Q_IFVALFMASK.3 \ + Q_IFRAWMASK.3 Q_GIFRAW.3 \ + Q_IFRAWMASK.3 Q_GIFABSVAL.3 \ + Q_IFRAWMASK.3 Q_GIFVAL.3 \ + Q_IFRAWMASK.3 Q_SIFVAL.3 \ + Q_IFRAWMASK.3 Q_SIFVALS.3 +MLINKS+= Q_INI.3 Q_NCBITS.3 \ + Q_INI.3 Q_BT.3 \ + Q_INI.3 Q_TC.3 \ + Q_INI.3 Q_NTBITS.3 \ + Q_INI.3 Q_NFCBITS.3 \ + Q_INI.3 Q_MAXNFBITS.3 \ + Q_INI.3 Q_NFBITS.3 \ + Q_INI.3 Q_NIBITS.3 \ + Q_INI.3 Q_RPSHFT.3 \ + Q_INI.3 Q_ABS.3 \ + Q_INI.3 Q_MAXSTRLEN.3 \ + Q_INI.3 Q_TOSTR.3 \ + Q_INI.3 Q_SHL.3 \ + Q_INI.3 Q_SHR.3 \ + Q_INI.3 Q_DEBUG.3 \ + Q_INI.3 Q_DFV2BFV.3 +MLINKS+= Q_IRAWMASK.3 Q_GIRAW.3 \ + Q_IRAWMASK.3 Q_GIABSVAL.3 \ + Q_IRAWMASK.3 Q_GIVAL.3 \ + Q_IRAWMASK.3 Q_SIVAL.3 +MLINKS+= Q_QABS.3 Q_Q2D.3 \ + Q_QABS.3 Q_Q2F.3 +MLINKS+= Q_QADDI.3 Q_QDIVI.3 \ + Q_QADDI.3 Q_QMULI.3 \ + Q_QADDI.3 Q_QSUBI.3 \ + Q_QADDI.3 Q_QFRACI.3 \ + Q_QADDI.3 Q_QCPYVALI.3 +MLINKS+= Q_QADDQ.3 Q_QDIVQ.3 \ + Q_QADDQ.3 Q_QMULQ.3 \ + Q_QADDQ.3 Q_QSUBQ.3 \ + Q_QADDQ.3 Q_NORMPREC.3 \ + Q_QADDQ.3 Q_QMAXQ.3 \ + Q_QADDQ.3 Q_QMINQ.3 \ + Q_QADDQ.3 Q_QCLONEQ.3 \ + Q_QADDQ.3 Q_QCPYVALQ.3 +MLINKS+= Q_SIGNED.3 Q_LTZ.3 \ + Q_SIGNED.3 Q_PRECEQ.3 \ + Q_SIGNED.3 Q_QLTQ.3 \ + Q_SIGNED.3 Q_QLEQ.3 \ + Q_SIGNED.3 Q_QGTQ.3 \ + Q_SIGNED.3 Q_QGEQ.3 \ + Q_SIGNED.3 Q_QEQ.3 \ + Q_SIGNED.3 Q_QNEQ.3 \ + Q_SIGNED.3 Q_OFLOW.3 \ + Q_SIGNED.3 Q_RELPREC.3 +MLINKS+= Q_SIGNSHFT.3 Q_SSIGN.3 \ + Q_SIGNSHFT.3 Q_CRAWMASK.3 \ + Q_SIGNSHFT.3 Q_SRAWMASK.3 \ + Q_SIGNSHFT.3 Q_GCRAW.3 \ + Q_SIGNSHFT.3 Q_GCVAL.3 \ + Q_SIGNSHFT.3 Q_SCVAL.3 MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \ queue.3 LIST_CLASS_HEAD.3 \ queue.3 LIST_EMPTY.3 \ Added: head/share/man/man3/Q_FRAWMASK.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_FRAWMASK.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,125 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_FRAWMASK 3 +.Os +.Sh NAME +.Nm Q_FRAWMASK , +.Nm Q_GFRAW , +.Nm Q_GFABSVAL , +.Nm Q_GFVAL , +.Nm Q_SFVAL +.Nd fixed-point math functions which manipulate the fractional data bits +.Sh SYNOPSIS +.In sys/qmath.h +.Ft ITYPE +.Fn Q_FRAWMASK "QTYPE q" +.Ft ITYPE +.Fn Q_GFRAW "QTYPE q" +.Ft ITYPE +.Fn Q_GFABSVAL "QTYPE q" +.Ft ITYPE +.Fn Q_GFVAL "QTYPE q" +.Ft QTYPE +.Fn Q_SFVAL "QTYPE q" "ITYPE fv" +.Sh DESCRIPTION +.Fn Q_FRAWMASK +returns a +.Fa q Ns -specific +bit mask for +.Fa q Ap s +fractional data bits. +.Pp +.Fn Q_GFRAW +returns +.Fa q Ap s +raw masked fractional data bits. +.Pp +.Fn Q_GFABSVAL +and +.Fn Q_GFVAL +return the absolute and real values of +.Fa q Ap s +fractional data bits respectively. +.Pp +.Fn Q_SFVAL +sets +.Fa q Ap s +fractional data bits to the value +.Fa fv . +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +The +.Fa ITYPE +refers to the +.Xr stdint 7 +integer types. +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_FRAWMASK , +.Fn Q_GFRAW , +.Fn Q_GFABSVAL +and +.Fn Q_GFVAL +return their respective values as integers of the same underlying ITYPE as +.Fa q . +.Pp +.Fn Q_SFVAL +returns the value of +.Fa q +post set. +.Sh SEE ALSO +.Xr errno 2 , +.Xr qmath 3 , +.Xr stdint 7 +.Sh HISTORY +The +.Xr qmath 3 +functions first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Xr qmath 3 +functions and this manual page were written by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org +and sponsored by Netflix, Inc. Added: head/share/man/man3/Q_IFRAWMASK.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_IFRAWMASK.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,162 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_IFRAWMASK 3 +.Os +.Sh NAME +.Nm Q_IFRAWMASK , +.Nm Q_IFVALIMASK , +.Nm Q_IFVALFMASK , +.Nm Q_GIFRAW , +.Nm Q_GIFABSVAL , +.Nm Q_GIFVAL , +.Nm Q_SIFVAL , +.Nm Q_SIFVALS +.Nd fixed-point math functions which manipulate the combined integer/fractional +data bits +.Sh SYNOPSIS +.In sys/qmath.h +.Ft ITYPE +.Fn Q_IFRAWMASK "QTYPE q" +.Ft ITYPE +.Fn Q_IFVALIMASK "QTYPE q" +.Ft ITYPE +.Fn Q_IFVALFMASK "QTYPE q" +.Ft ITYPE +.Fn Q_GIFRAW "QTYPE q" +.Ft ITYPE +.Fn Q_GIFABSVAL "QTYPE q" +.Ft ITYPE +.Fn Q_GIFVAL "QTYPE q" +.Ft QTYPE +.Fn Q_SIFVAL "QTYPE q" "ITYPE ifv" +.Ft QTYPE +.Fn Q_SIFVALS "QTYPE q" "ITYPE iv" "ITYPE fv" +.Sh DESCRIPTION +.Fn Q_IFRAWMASK +returns a +.Fa q Ns -specific +bit mask for +.Fa q Ap s +combined integer and fractional data bits. +.Pp +.Fn Q_IFVALIMASK +and +.Fn Q_IFVALFMASK +return +.Fa q Ns -specific +bit masks for the integer and fractional bits of +.Fa q Ap s +combined integer and fractional data bits value, i.e., are applicable to the +values returned by +.Fn Q_GIFABSVAL +and +.Fn Q_GIFVAL . +.Pp +.Fn Q_GIFRAW +returns +.Fa q Ap s +raw masked integer/fractional data bits. +.Pp +.Fn Q_GIFABSVAL +and +.Fn Q_GIFVAL +return the absolute and real values of +.Fa q Ap s +integer/fractional data bits respectively. +.Pp +.Fn Q_SIFVAL +sets +.Fa q Ap s +combined integer/fractional data bits to the value +.Fa ifv , +whereas +.Fn Q_SIFVALS +independently sets +.Fa q Ap s +integer and fractional data bits to the separate values +.Fa iv +and +.Fa fv . +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +The +.Fa ITYPE +refers to the +.Xr stdint 7 +integer types. +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_IFRAWMASK , +.Fn Q_IFVALIMASK , +.Fn Q_IFVALFMASK , +.Fn Q_GIFABSVAL , +.Fn Q_GIFVAL , +.Fn Q_GIFRAW , +.Fn Q_GIFABSVAL +and +.Fn Q_GIFVAL +return their respective values as integers of the same underlying ITYPE as +.Fa q . +.Pp +.Fn Q_SIFVAL +and +.Fn Q_SIFVALS +return the value of +.Fa q +post change. +.Sh SEE ALSO +.Xr errno 2 , +.Xr qmath 3 , +.Xr stdint 7 +.Sh HISTORY +The +.Xr qmath 3 +functions first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Xr qmath 3 +functions and this manual page were written by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org +and sponsored by Netflix, Inc. Added: head/share/man/man3/Q_INI.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_INI.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,261 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_INI 3 +.Os +.Sh NAME +.Nm Q_INI , +.Nm Q_NCBITS , +.Nm Q_BT , +.Nm Q_TC , +.Nm Q_NTBITS , +.Nm Q_NFCBITS , +.Nm Q_MAXNFBITS , +.Nm Q_NFBITS , +.Nm Q_NIBITS , +.Nm Q_RPSHFT , +.Nm Q_ABS , +.Nm Q_MAXSTRLEN , +.Nm Q_TOSTR , +.Nm Q_SHL , +.Nm Q_SHR , +.Nm Q_DEBUG +.Nd fixed-point math miscellaneous functions/variables +.Sh SYNOPSIS +.In sys/qmath.h +.Ft QTYPE +.Fn Q_INI "QTYPE *q" "ITYPE iv" "ITYPE dfv" "int rpshft" +.Fd Q_NCBITS +.Ft __typeof(q) +.Fn Q_BT "QTYPE q" +.Ft ITYPE +.Fn Q_TC "QTYPE q" "ITYPE v" +.Ft uint32_t +.Fn Q_NTBITS "QTYPE q" +.Ft uint32_t +.Fn Q_NFCBITS "QTYPE q" +.Ft uint32_t +.Fn Q_MAXNFBITS "QTYPE q" +.Ft uint32_t +.Fn Q_NFBITS "QTYPE q" +.Ft uint32_t +.Fn Q_NIBITS "QTYPE q" +.Ft uint32_t +.Fn Q_RPSHFT "QTYPE q" +.Ft NTYPE +.Fn Q_ABS "NTYPE n" +.Ft uint32_t +.Fn Q_MAXSTRLEN "QTYPE q" "int base" +.Ft char * +.Fn Q_TOSTR "QTYPE q" "int prec" "int base" "char *s" "int slen" +.Ft ITYPE +.Fn Q_SHL "QTYPE q" "ITYPE iv" +.Ft ITYPE +.Fn Q_SHR "QTYPE q" "ITYPE iv" +.Ft char *, ... +.Fn Q_DEBUG "QTYPE q" "char *prefmt" "char *postfmt" "incfmt" +.Ft ITYPE +.Fn Q_DFV2BFV "ITYPE dfv" "int nfbits" +.Sh DESCRIPTION +.Fn Q_INI +initialises a Q number with the supplied integral value +.Fa iv +and decimal fractional value +.Fa dfv , +with appropriate control bits based on the requested radix shift point +.Fa rpshft . +.Fa dfv +must be passed as a preprocessor literal to preserve leading zeroes. +.Pp +The +.Dv Q_NCBITS +defined constant specifies the number of reserved control bits, currently 3. +.Pp +.Fn Q_NTBITS , +.Fn Q_NFCBITS , +.Fn Q_MAXNFBITS , +.Fn Q_NFBITS +and +.Fn Q_NIBITS +return the +.Fa q Ns -specific +count of total, control-encoded fractional, maximum fractional, effective +fractional, and integer bits applicable to +.Fa q +respectively. +.Pp +.Fn Q_BT +returns the C data type of +.Fa q , +while +.Fn Q_TC +returns +.Fa v +type casted to the C data type of +.Fa q . +.Pp +.Fn Q_RPSHFT +returns the bit position of +.Fa q Ap s +binary radix point relative to bit zero. +.Pp +.Fn Q_ABS +returns the absolute value of any standard numeric type +.Pq that uses the MSB as a sign bit, but not Q numbers +passed in as +.Fa n . +The function is signed/unsigned type safe. +.Pp +.Fn Q_SHL +and +.Fn Q_SHR +return the integral value +.Fa v +left or right shifted by the appropriate amount for +.Fa q . +.Pp +.Fn Q_MAXSTRLEN +calculates the maximum number of characters that may be required to render the +C-string representation of +.Fa q +with numeric base +.Fa base . +.Pp +.Fn Q_TOSTR +renders the C-string representation of +.Fa q +with numeric base +.Fa base +and fractional precision +.Fa prec +into +.Fa s +which has an available capacity of +.Fa slen +characters. +.Fa base +must be in range +.Bq 2,16 . +Specifying +.Fa prec +as -1 renders the number's fractional component with maximum precision. +If +.Fa slen +is greater than zero but insufficient to hold the complete C-string, the '\\0' +C-string terminator will be written to +.Fa *s , +thereby returning a zero length C-string. +.Pp +.Fn Q_DEBUG +returns a format string and associated data suitable for printf-like rendering +of debugging information pertaining to +.Fa q . +If either +.Fa prefmt +and/or +.Fa postfmt +are specified, they are prepended and appended to the resulting format string +respectively. +The +.Fa incfmt +boolean specifies whether to include +.Pq Vt true +or exclude +.Pq Vt false +the raw format string itself in the debugging output. +.Pp +.Fn Q_DFV2BFV +converts decimal fractional value +.Fa dfv +to its binary-encoded representation with +.Fa nfbits +of binary precision. +.Fa dfv +must be passed as a preprocessor literal to preserve leading zeroes. +The returned value can be used to set a Q number's fractional bits, for example +using +.Fn Q_SFVAL . +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +The +.Fa ITYPE +refers to the +.Xr stdint 7 +integer types. +.Fa NTYPE +is used to refer to any numeric type and is therefore a superset of +.Fa QTYPE +and +.Fa ITYPE . +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_INI +returns the initialised Q number which can be used to chain initialise +additional Q numbers. +.Pp +.Fn Q_TOSTR +returns a pointer to the '\\0' C-string terminator appended to +.Fa s +after the rendered numeric data, or NULL on buffer overflow. +.Pp +.Fn Q_DFV2BFV +returns the binary-encoded representation of decimal fractional value +.Fa dfv +with +.Fa nfbits +of binary precision. +.Sh SEE ALSO +.Xr errno 2 , +.Xr qmath 3 , +.Xr stdint 7 +.Sh HISTORY +The +.Xr qmath 3 +functions first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Xr qmath 3 +functions and this manual page were written by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org +and sponsored by Netflix, Inc. Added: head/share/man/man3/Q_IRAWMASK.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_IRAWMASK.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,125 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_IRAWMASK 3 +.Os +.Sh NAME +.Nm Q_IRAWMASK , +.Nm Q_GIRAW , +.Nm Q_GIABSVAL , +.Nm Q_GIVAL , +.Nm Q_SIVAL +.Nd fixed-point math functions which manipulate the integer data bits +.Sh SYNOPSIS +.In sys/qmath.h +.Ft ITYPE +.Fn Q_IRAWMASK "QTYPE q" +.Ft ITYPE +.Fn Q_GIRAW "QTYPE q" +.Ft ITYPE +.Fn Q_GIABSVAL "QTYPE q" +.Ft ITYPE +.Fn Q_GIVAL "QTYPE q" +.Ft QTYPE +.Fn Q_SIVAL "QTYPE q" "ITYPE iv" +.Sh DESCRIPTION +.Fn Q_IRAWMASK +returns a +.Fa q Ns -specific +bit mask for +.Fa q Ap s +integer data bits. +.Pp +.Fn Q_GIRAW +returns +.Fa q Ap s +raw masked integer data bits. +.Pp +.Fn Q_GIABSVAL +and +.Fn Q_GIVAL +return the absolute and real values of +.Fa q Ap s +integer data bits respectively. +.Pp +.Fn Q_SIVAL +sets +.Fa q Ap s +integer data bits to the value +.Fa iv . +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +The +.Fa ITYPE +refers to the +.Xr stdint 7 +integer types. +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_IRAWMASK , +.Fn Q_GIRAW , +.Fn Q_GIABSVAL +and +.Fn Q_GIVAL +return their respective values as integers of the same underlying ITYPE as +.Fa q . +.Pp +.Fn Q_SIVAL +returns the value of +.Fa q +post change. +.Sh SEE ALSO +.Xr errno 2 , +.Xr qmath 3 , +.Xr stdint 7 +.Sh HISTORY +The +.Xr qmath 3 +functions first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Xr qmath 3 +functions and this manual page were written by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org +and sponsored by Netflix, Inc. Added: head/share/man/man3/Q_QABS.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_QABS.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,101 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_QABS 3 +.Os +.Sh NAME +.Nm Q_QABS , +.Nm Q_Q2S , +.Nm Q_Q2F +.Nd fixed-point math functions which operate on a single Q number +.Sh SYNOPSIS +.In sys/qmath.h +.Ft QTYPE +.Fn Q_QABS "QTYPE q" +.Ft double +.Fn Q_Q2D "QTYPE q" +.Ft float +.Fn Q_Q2F "QTYPE q" +.Sh DESCRIPTION +The +.Fn Q_QABS +function returns an absolute value representation of +.Fa q . +.Pp +The +.Fn Q_Q2D +and +.Fn Q_Q2F +functions return the double and float representations of +.Fa q +respectively. +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_QABS +function returns a QTYPE that is identical to that of +.Fa q . +.Pp +The +.Fn Q_Q2D +and +.Fn Q_Q2F +functions return the double and float representations of +.Fa q +respectively. +.Sh SEE ALSO +.Xr errno 2 , +.Xr qmath 3 , +.Xr stdint 7 +.Sh HISTORY +The +.Xr qmath 3 +functions first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An -nosplit +The +.Xr qmath 3 +functions and this manual page were written by +.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org +and sponsored by Netflix, Inc. Added: head/share/man/man3/Q_QADDI.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/Q_QADDI.3 Tue Aug 27 11:46:22 2019 (r351544) @@ -0,0 +1,134 @@ +.\" +.\" Copyright (c) 2018 Netflix, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification, immediately at the beginning of the file. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 8, 2018 +.Dt Q_QADDI 3 +.Os +.Sh NAME +.Nm Q_QADDI , +.Nm Q_QDIVI , +.Nm Q_QMULI , +.Nm Q_QSUBI , +.Nm Q_QFRACI , +.Nm Q_QCPYVALI +.Nd fixed-point math functions which apply integers to a Q number +.Sh SYNOPSIS +.In sys/qmath.h +.Ft int +.Fn Q_QADDI "QTYPE *a" "ITYPE b" +.Ft int +.Fn Q_QDIVI "QTYPE *a" "ITYPE b" +.Ft int +.Fn Q_QMULI "QTYPE *a" "ITYPE b" +.Ft int +.Fn Q_QSUBI "QTYPE *a" "ITYPE b" +.Ft int +.Fn Q_QFRACI "QTYPE *q" "ITYPE n" "ITYPE d" +.Ft int +.Fn Q_QCPYVALI "QTYPE *q" "ITYPE i" +.Sh DESCRIPTION +The +.Fn Q_QADDI , +.Fn Q_QDIVI , +.Fn Q_QMULI +and +.Fn Q_QSUBI +functions add, divide, multiply or subtract +.Fa b +to/by/from +.Fa a +respectively, storing the result in +.Fa a . +.Pp +The +.Fn Q_QFRACI +function computes the fraction +.Fa n +divided by +.Fa d +and stores the fixed-point result in +.Fa q . +.Pp +The +.Fn Q_QCPYVALI +function overwrites +.Fa q Ap s +integer and fractional bits with the Q representation of integer value +.Fa i . +.Pp +All of those functions operate on +the following data types: +.Vt s8q_t , +.Vt u8q_t , +.Vt s16q_t , +.Vt u16q_t , +.Vt s32q_t , +.Vt u32q_t , +.Vt s64q_t , +and +.Vt u64q_t , +which are referred to generically as +.Fa QTYPE . +The +.Fa ITYPE +refers to the +.Xr stdint 7 +integer types. +.Pp +For more details, see +.Xr qmath 3 . +.Sh RETURN VALUES +.Fn Q_QADDI , +.Fn Q_QDIVI , +.Fn Q_QMULI , +.Fn Q_QSUBI , +.Fn Q_QFRACI +and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 27 13:04:31 2019 Return-Path: Delivered-To: svn-src-head@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 3FCB0D584D for ; Tue, 27 Aug 2019 13:04:31 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (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 46HpxB2m5Lz3MgL for ; Tue, 27 Aug 2019 13:04:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x742.google.com with SMTP id 201so16858060qkm.9 for ; Tue, 27 Aug 2019 06:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rhSXkYcEGIOYhxZZwncpguLsSegUw0Sf+2LU8IJPBdM=; b=O/P8X7rcGrtLk2N7aybp9RWmOcNdpuscGTxIPZ91oBIiZ0f8KcL3GSw4JdKpSZqubL Jg/oNVuLonvVpvL0aJtWAgyB1ZbP0XO7V3jxYeVpQx514XxB1V9CnDNc4QslkMMl75Gn yroFNg0YAKbtKDZmxxBZz/WR4uKJ8gg8DSpC1YwbaYneJlWSDTW57TKWh6ToHjLCnB3P MouCTA362pMRf1tilFHzBrIwhsSVkDj0b9o+bGe/xcV/rt7lcOh4/FXRE2Pn6Wu889VZ DHwVI6CpDIYZe//J4LwlJz0nGbmyIbAsrLEOO8kVPgmga1mX2Y33CbMFgoOMDICiwhw2 NhsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rhSXkYcEGIOYhxZZwncpguLsSegUw0Sf+2LU8IJPBdM=; b=Z27eigyRiigFX7kdp2j6dBWERKkUtbci503+Fdi3tC/7CP6S4wcGLQOcR+RlfhTkKH 2xUo4HlkHWGJXo1Jktp8TlrW+1T7oBB93ShGwkOPrt7R32Mc2ABUEBzRWmLGn5w5TSq4 Q3ECGso44152K8ZWEUBrPob+AURNJ8wvqBdtor7jPbe7nm9iUKLsJ4iCBGRR0vhyxNgk IpGzLAJH7h9LqLjQPwou0/Gh804loiOP+uvqEZOQcGbzTLqHJgzKHzPI45uCMgXvFCS3 6OHErK04iYlV9Fz2ruxrQ2HdSPsY00DcKxoBtpa10i+gdAaZZzuc0cFXawBUBfjoO8GL 2VaA== X-Gm-Message-State: APjAAAWqjKfVTDWH8ChHKI5UHoQ9K9HZEoW1I2gjaK0IEGjw95OmhJ8Z X5goSTQzgHWuW9++t6zidAhttcKPjBM= X-Google-Smtp-Source: APXvYqyMZqnweXAsRDZ+5i/3AUX44jGaWLE9aFx2IZEzVvi2ep8C4rBmMUYVGuef42owAx50IonLDA== X-Received: by 2002:a37:4986:: with SMTP id w128mr21040709qka.417.1566911069133; Tue, 27 Aug 2019 06:04:29 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id o17sm1318676qkk.36.2019.08.27.06.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 06:04:28 -0700 (PDT) Date: Tue, 27 Aug 2019 09:04:27 -0400 From: Shawn Webb To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... Message-ID: <20190827130427.r27c6jswyxipkln5@mutt-hbsd> References: <201908270001.x7R01vUB052426@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xrquq2h6prvg2w7t" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46HpxB2m5Lz3MgL X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=O/P8X7rc; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::742 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.47 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[2.4.7.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]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.40)[ip: (3.23), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 13:04:31 -0000 --xrquq2h6prvg2w7t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 26, 2019 at 05:14:42PM -0700, John Baldwin wrote: > On 8/26/19 5:01 PM, John Baldwin wrote: > > Author: jhb > > Date: Tue Aug 27 00:01:56 2019 > > New Revision: 351522 > > URL: https://svnweb.freebsd.org/changeset/base/351522 > >=20 > > Log: > > Add kernel-side support for in-kernel TLS. >=20 > The length of the commit message notwithstanding, there is still quite a = bit > more work to do on this front. Making use of KTLS requires an SSL library > that understands the new functionality, and for the full performance gain > you want an application that makes use of SSL_sendfile. Netflix has both > of these in the form of patches to OpenSSL and nginx. I'm currently work= ing > on a patchset suitable for merging into upstream OpenSSL's master (the > Linux KTLS patches are merged into OpenSSL master already, so the FreeBSD > patches are fairly small). Hey John, Thanks a lot for working to get this in! I'm curious if there's any desire to help LibreSSL adopt same/similar patches as OpenSSL. Doing so would help LibreSSL on FreeBSD maintain feature parity with OpenSSL. I respect your opinion and would love to hear your thoughts. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --xrquq2h6prvg2w7t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl1lKlYACgkQ/y5nonf4 4frT9g//VGyS24NrOsVpiCLanwZ2bHFqfLYRVb3Dq/+OnvoFM3CCYipVhw/HDfrh C7gWrAFJ+tWJA+Ctb0WowIuzGkXbDVvJ1m3OtO6Lt1Ad1Y0nWxa367D6Cpj/4EeV YjBFFch80iABSJ44Ld14vai4HL5/dxd5b2AFIO5d6wZQVy8IlJ3aCogAGhum3YpI ZUXYmsVmVHFIqjtXS2Nung+FFDNo4G7g0iD5Wm01yxqC3QJ38ieQhhZ/I1r1btNH t+8MxgxEs7N6I9TSqvrGIGuLy+HAe3Q6t050JBZqaCcYAWEAZLj+YRgAf4/UJqRg yOtwiNTLqvkW7xTXMt3HseFQevXGXSn2wrca6rLhIo1FxeHQDL23NQr6n3RtPVOG VChDc3Dfa5f8Tv2HZzRoECURnlzfLdHWx/+CTEfru0ieiRhokUJPtSNY02jhJCmc VgMTpRsbfQ2RYsnEVi54NjyCiTliX5g6QS2BQk+cSlV/ozaMbSRqzbS/9ikDu6TH RBGpwObkifKZxtupkO742oeUYGBb2JKY63SFzPRcYwmfffbS99sC5BwT4sQff1uh mVdBjS8fwQyIYU8RJ7ddOstxOOceHBGgFMq8EC8yTcY/wfzoOWMbFV0w38uz9r7M x8FayT2v3eNc1aqbGq0bA8DYJsNO47MyrFB7Qp8CDCJWMtxBm0M= =U8yI -----END PGP SIGNATURE----- --xrquq2h6prvg2w7t-- From owner-svn-src-head@freebsd.org Tue Aug 27 13:55:45 2019 Return-Path: Delivered-To: svn-src-head@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 DE7D3D66DE; Tue, 27 Aug 2019 13:55:45 +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 46Hr4K5Xphz3Q61; Tue, 27 Aug 2019 13:55:45 +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 A14B31FB0E; Tue, 27 Aug 2019 13:55:45 +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 x7RDtjE7072138; Tue, 27 Aug 2019 13:55:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RDtj33072137; Tue, 27 Aug 2019 13:55:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908271355.x7RDtj33072137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 27 Aug 2019 13:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351545 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 351545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 13:55:45 -0000 Author: trasz Date: Tue Aug 27 13:55:45 2019 New Revision: 351545 URL: https://svnweb.freebsd.org/changeset/base/351545 Log: Fix build on 32 bit archs. Modified: head/tests/sys/sys/qmath_test.c Modified: head/tests/sys/sys/qmath_test.c ============================================================================== --- head/tests/sys/sys/qmath_test.c Tue Aug 27 11:46:22 2019 (r351544) +++ head/tests/sys/sys/qmath_test.c Tue Aug 27 13:55:45 2019 (r351545) @@ -448,10 +448,10 @@ ATF_TC_BODY(qfraci_s64q, tc) maxe_dbl = fabs(1.0 / Q_NFBITS(a_s64q)); delta_dbl = fabs(r_dbl - Q_Q2D(r_s64q)); ATF_CHECK_MSG(delta_dbl <= maxe_dbl, - "\tQFRACI(%ld / %ld): |%10f - %10f| = %10f " + "\tQFRACI(%jd / %jd): |%10f - %10f| = %10f " "(max err %f)\n", - a_int, b_int, Q_Q2D(r_s64q), r_dbl, delta_dbl, - maxe_dbl); + (intmax_t)a_int, (intmax_t)b_int, Q_Q2D(r_s64q), + r_dbl, delta_dbl, maxe_dbl); } } @@ -495,10 +495,10 @@ ATF_TC_BODY(qmuli_s64q, tc) maxe_dbl = fabs((1.0 / Q_NFBITS(a_s64q)) * (double)b_int); delta_dbl = fabs(r_dbl - Q_Q2D(r_s64q)); ATF_CHECK_MSG(delta_dbl <= maxe_dbl, - "\tQMULI(%ld * %ld): |%10f - %10f| = %10f " + "\tQMULI(%jd * %jd): |%10f - %10f| = %10f " "(max err %f)\n", - a_int, b_int, Q_Q2D(r_s64q), r_dbl, delta_dbl, - maxe_dbl); + (intmax_t)(intmax_t)a_int, b_int, Q_Q2D(r_s64q), + r_dbl, delta_dbl, maxe_dbl); } } @@ -546,10 +546,10 @@ ATF_TC_BODY(qaddi_s64q, tc) #endif delta_dbl = fabs(r_dbl - Q_Q2D(r_s64q)); ATF_CHECK_MSG(delta_dbl <= maxe_dbl, - "\tQADDI(%ld + %ld): |%10f - %10f| = %10f " + "\tQADDI(%jd + %jd): |%10f - %10f| = %10f " "(max err %f)\n", - a_int, b_int, Q_Q2D(r_s64q), r_dbl, delta_dbl, - maxe_dbl); + (intmax_t)a_int, (intmax_t)b_int, Q_Q2D(r_s64q), + r_dbl, delta_dbl, maxe_dbl); } } @@ -594,10 +594,10 @@ ATF_TC_BODY(qsubi_s64q, tc) #endif delta_dbl = fabs(r_dbl - Q_Q2D(r_s64q)); ATF_CHECK_MSG(delta_dbl <= maxe_dbl, - "\tQSUBI(%ld - %ld): |%10f - %10f| = %10f " + "\tQSUBI(%jd - %jd): |%10f - %10f| = %10f " "(max err %f)\n", - a_int, b_int, Q_Q2D(r_s64q), r_dbl, delta_dbl, - maxe_dbl); + (intmax_t)a_int, (intmax_t)b_int, Q_Q2D(r_s64q), + r_dbl, delta_dbl, maxe_dbl); } } From owner-svn-src-head@freebsd.org Tue Aug 27 14:04:32 2019 Return-Path: Delivered-To: svn-src-head@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 C5BEFD6AEB; Tue, 27 Aug 2019 14:04:32 +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 46HrGS4sGZz3Qj4; Tue, 27 Aug 2019 14:04:32 +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 8882F1FCEC; Tue, 27 Aug 2019 14:04:32 +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 x7RE4WIK078960; Tue, 27 Aug 2019 14:04:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RE4W9a078959; Tue, 27 Aug 2019 14:04:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908271404.x7RE4W9a078959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 27 Aug 2019 14:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351546 - 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: 351546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 14:04:32 -0000 Author: jhibbits Date: Tue Aug 27 14:04:32 2019 New Revision: 351546 URL: https://svnweb.freebsd.org/changeset/base/351546 Log: Revert a part of r350883 that should never have gone in The wire_count change is not part of the unification, and doesn't even make sense. Reported by: markj Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 27 13:55:45 2019 (r351545) +++ head/sys/powerpc/booke/pmap.c Tue Aug 27 14:04:32 2019 (r351546) @@ -2807,7 +2807,7 @@ retry: if (vm_page_pa_tryrelock(pmap, PTE_PA(pte), &pa)) goto retry; m = PHYS_TO_VM_PAGE(PTE_PA(pte)); - m->wire_count++; + vm_page_wire(m); } } From owner-svn-src-head@freebsd.org Tue Aug 27 14:06:35 2019 Return-Path: Delivered-To: svn-src-head@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 43601D6B74; Tue, 27 Aug 2019 14:06:35 +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 46HrJq0zW5z3Qrd; Tue, 27 Aug 2019 14:06:35 +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 03CC81FCF3; Tue, 27 Aug 2019 14:06:35 +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 x7RE6YR7079323; Tue, 27 Aug 2019 14:06:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RE6Ynj079322; Tue, 27 Aug 2019 14:06:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908271406.x7RE6Ynj079322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Aug 2019 14:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351547 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 14:06:35 -0000 Author: markj Date: Tue Aug 27 14:06:34 2019 New Revision: 351547 URL: https://svnweb.freebsd.org/changeset/base/351547 Log: Fix several logic issues in domainset_empty_vm(). - Don't add 1 to the result of DOMAINSET_FLS. - Do not modify domainsets containing only empty domains. - Always flatten a _PREFER policy to _ROUNDROBIN if the preferred domain is empty. Previously we were doing this only when ds_cnt > 1. These bugs could cause hangs during boot if a VM domain is empty. Tested by: hselasky Reviewed by: hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21420 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Aug 27 14:04:32 2019 (r351546) +++ head/sys/kern/kern_cpuset.c Tue Aug 27 14:06:34 2019 (r351547) @@ -500,25 +500,31 @@ _domainset_create(struct domainset *domain, struct dom static bool domainset_empty_vm(struct domainset *domain) { - int i, j, max; + domainset_t empty; + int i, j; - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0; i < max; i++) - if (DOMAINSET_ISSET(i, &domain->ds_mask) && VM_DOMAIN_EMPTY(i)) - DOMAINSET_CLR(i, &domain->ds_mask); + DOMAINSET_ZERO(&empty); + for (i = 0; i < vm_ndomains; i++) + if (VM_DOMAIN_EMPTY(i)) + DOMAINSET_SET(i, &empty); + if (DOMAINSET_SUBSET(&empty, &domain->ds_mask)) + return (true); + + /* Remove empty domains from the set and recompute. */ + DOMAINSET_NAND(&domain->ds_mask, &empty); domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = j = 0; i < max; i++) { + for (i = j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++) if (DOMAINSET_ISSET(i, &domain->ds_mask)) domain->ds_order[j++] = i; - else if (domain->ds_policy == DOMAINSET_POLICY_PREFER && - domain->ds_prefer == i && domain->ds_cnt > 1) { - domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; - domain->ds_prefer = -1; - } + + /* Convert a PREFER policy referencing an empty domain to RR. */ + if (domain->ds_policy == DOMAINSET_POLICY_PREFER && + DOMAINSET_ISSET(domain->ds_prefer, &empty)) { + domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + domain->ds_prefer = -1; } - return (DOMAINSET_EMPTY(&domain->ds_mask)); + return (false); } /* From owner-svn-src-head@freebsd.org Tue Aug 27 14:39:57 2019 Return-Path: Delivered-To: svn-src-head@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 450BED776B; Tue, 27 Aug 2019 14:39:57 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Hs3K14kmz3xj6; Tue, 27 Aug 2019 14:39:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay05.pair.com (Postfix) with ESMTP id B423A1A36D3; Tue, 27 Aug 2019 10:39:54 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id x7REdrNZ005158 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 27 Aug 2019 16:39:53 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id x7REdrG5005157; Tue, 27 Aug 2019 16:39:53 +0200 (CEST) (envelope-from pho) Date: Tue, 27 Aug 2019 16:39:53 +0200 From: Peter Holm To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... Message-ID: <20190827143953.GA5092@x8.osted.lan> References: <201908270001.x7R01vUB052426@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908270001.x7R01vUB052426@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 46Hs3K14kmz3xj6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 14:39:57 -0000 On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Aug 27 00:01:56 2019 > New Revision: 351522 > URL: https://svnweb.freebsd.org/changeset/base/351522 > > Log: > Add kernel-side support for in-kernel TLS. > Could this be yours? 20190827 15:55:34 all (496/668): sendfile12.sh Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was killed: out of swap space panic: non-ext_pgs mbuf with TLS session cpuid = 9 time = 1566914176 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0307ef4820 vpanic() at vpanic+0x19d/frame 0xfffffe0307ef4870 panic() at panic+0x43/frame 0xfffffe0307ef48d0 sendfile_iodone() at sendfile_iodone+0x28e/frame 0xfffffe0307ef4920 vnode_pager_generic_getpages_done_async() at vnode_pager_generic_getpages_done_async+0x3a/frame 0xfffffe0307ef4940 bufdone() at bufdone+0x70/frame 0xfffffe0307ef49c0 g_io_deliver() at g_io_deliver+0x298/frame 0xfffffe0307ef4a10 md_kthread() at md_kthread+0x266/frame 0xfffffe0307ef4a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0307ef4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0307ef4ab0 https://people.freebsd.org/~pho/stress/log/mjguzik014.txt - Peter From owner-svn-src-head@freebsd.org Tue Aug 27 15:34:37 2019 Return-Path: Delivered-To: svn-src-head@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 BEE39D88A2; Tue, 27 Aug 2019 15:34:37 +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 46HtGP4dz9z41J3; Tue, 27 Aug 2019 15:34:37 +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 8139B20DA4; Tue, 27 Aug 2019 15:34:37 +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 x7RFYbCk039476; Tue, 27 Aug 2019 15:34:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RFYbxw039475; Tue, 27 Aug 2019 15:34:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908271534.x7RFYbxw039475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 27 Aug 2019 15:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351548 - head/sbin/ping X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ping X-SVN-Commit-Revision: 351548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 15:34:37 -0000 Author: asomers Date: Tue Aug 27 15:34:37 2019 New Revision: 351548 URL: https://svnweb.freebsd.org/changeset/base/351548 Log: ping: raise WARNS level to 6 Submitted by: Ján Sučan MFC after: 2 weeks Sponsored by: Google LLC (Google Summer of Code 2019) Differential Revision: https://reviews.freebsd.org/D21405 Modified: head/sbin/ping/Makefile Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Tue Aug 27 14:06:34 2019 (r351547) +++ head/sbin/ping/Makefile Tue Aug 27 15:34:37 2019 (r351548) @@ -9,7 +9,6 @@ SRCS= ping.c utils.c MAN= ping.8 BINOWN= root BINMODE=4555 -WARNS?= 3 LIBADD= m .if ${MK_DYNAMICROOT} == "no" From owner-svn-src-head@freebsd.org Tue Aug 27 15:42:09 2019 Return-Path: Delivered-To: svn-src-head@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 4C86BD8B07; Tue, 27 Aug 2019 15:42:09 +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 46HtR51JTTz41h6; Tue, 27 Aug 2019 15:42:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E19920E34; Tue, 27 Aug 2019 15:42:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RFg8Lp045410; Tue, 27 Aug 2019 15:42:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RFg8XN045409; Tue, 27 Aug 2019 15:42:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908271542.x7RFg8XN045409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Aug 2019 15:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351549 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 15:42:09 -0000 Author: markj Date: Tue Aug 27 15:42:08 2019 New Revision: 351549 URL: https://svnweb.freebsd.org/changeset/base/351549 Log: Remove an extraneous + 1 in _domainset_create(). DOMAINSET_FLS, like our fls(), is 1-indexed. Reported by: alc MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Aug 27 15:34:37 2019 (r351548) +++ head/sys/kern/kern_cpuset.c Tue Aug 27 15:42:08 2019 (r351549) @@ -457,7 +457,7 @@ static struct domainset * _domainset_create(struct domainset *domain, struct domainlist *freelist) { struct domainset *ndomain; - int i, j, max; + int i, j; KASSERT(domain->ds_cnt <= vm_ndomains, ("invalid domain count in domainset %p", domain)); @@ -476,8 +476,7 @@ _domainset_create(struct domainset *domain, struct dom if (ndomain == NULL) { LIST_INSERT_HEAD(&cpuset_domains, domain, ds_link); domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); - max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0, j = 0; i < max; i++) + for (i = 0, j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++) if (DOMAINSET_ISSET(i, &domain->ds_mask)) domain->ds_order[j++] = i; } From owner-svn-src-head@freebsd.org Tue Aug 27 16:02:33 2019 Return-Path: Delivered-To: svn-src-head@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 76A95D90E7; Tue, 27 Aug 2019 16:02:33 +0000 (UTC) (envelope-from jhb@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 46Httd2YFSz42g4; Tue, 27 Aug 2019 16:02:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 C6D6E6D40; Tue, 27 Aug 2019 16:02:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827143953.GA5092@x8.osted.lan> 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: <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> Date: Tue, 27 Aug 2019 09:02:31 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190827143953.GA5092@x8.osted.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 16:02:33 -0000 On 8/27/19 7:39 AM, Peter Holm wrote: > On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: >> Author: jhb >> Date: Tue Aug 27 00:01:56 2019 >> New Revision: 351522 >> URL: https://svnweb.freebsd.org/changeset/base/351522 >> >> Log: >> Add kernel-side support for in-kernel TLS. >> > > Could this be yours? > > 20190827 15:55:34 all (496/668): sendfile12.sh > Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was killed: out of swap space > panic: non-ext_pgs mbuf with TLS session Possibly, though if sfio was freed and marked with 0xdeadc0de junk, then it would trip over this assertion for any use-after-free. I see in gdb that you couldn't see sfio because of clang's poor debug info. It would be really good to try to find the contents of sfio to debug this further. You should be able to find it via 'bp->b_caller1' in frame 14: 'p *(struct sf_io *)bp->b_caller1' -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 27 16:03:41 2019 Return-Path: Delivered-To: svn-src-head@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 4F363D916B; Tue, 27 Aug 2019 16:03:41 +0000 (UTC) (envelope-from jhb@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 46Htvx1MsWz42p7; Tue, 27 Aug 2019 16:03:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 869F16D41; Tue, 27 Aug 2019 16:03:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827130427.r27c6jswyxipkln5@mutt-hbsd> 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: <79fdf63c-b919-398b-a282-171146994b14@FreeBSD.org> Date: Tue, 27 Aug 2019 09:03:39 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190827130427.r27c6jswyxipkln5@mutt-hbsd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 16:03:41 -0000 On 8/27/19 6:04 AM, Shawn Webb wrote: > On Mon, Aug 26, 2019 at 05:14:42PM -0700, John Baldwin wrote: >> On 8/26/19 5:01 PM, John Baldwin wrote: >>> Author: jhb >>> Date: Tue Aug 27 00:01:56 2019 >>> New Revision: 351522 >>> URL: https://svnweb.freebsd.org/changeset/base/351522 >>> >>> Log: >>> Add kernel-side support for in-kernel TLS. >> >> The length of the commit message notwithstanding, there is still quite a bit >> more work to do on this front. Making use of KTLS requires an SSL library >> that understands the new functionality, and for the full performance gain >> you want an application that makes use of SSL_sendfile. Netflix has both >> of these in the form of patches to OpenSSL and nginx. I'm currently working >> on a patchset suitable for merging into upstream OpenSSL's master (the >> Linux KTLS patches are merged into OpenSSL master already, so the FreeBSD >> patches are fairly small). > > Hey John, > > Thanks a lot for working to get this in! I'm curious if there's any > desire to help LibreSSL adopt same/similar patches as OpenSSL. Doing > so would help LibreSSL on FreeBSD maintain feature parity with > OpenSSL. I do not have any plans to implement the needed changes in other SSL implementations. Others are free to work on it however. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 27 16:41:07 2019 Return-Path: Delivered-To: svn-src-head@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 5A4C9D9D2D; Tue, 27 Aug 2019 16:41:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46Hvl71nzCz44PY; Tue, 27 Aug 2019 16:41:07 +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 1F6BB218B8; Tue, 27 Aug 2019 16:41:07 +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 x7RGf7ct075850; Tue, 27 Aug 2019 16:41:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RGf6LC075849; Tue, 27 Aug 2019 16:41:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908271641.x7RGf6LC075849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Aug 2019 16:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351550 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 351550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 16:41:07 -0000 Author: mav Date: Tue Aug 27 16:41:06 2019 New Revision: 351550 URL: https://svnweb.freebsd.org/changeset/base/351550 Log: Always check cam_periph_error() status for ERESTART. Even if we do not expect retries, we better be sure, since otherwise it may result in use after free kernel panic. I've noticed that it retries SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 15:42:08 2019 (r351549) +++ head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 16:41:06 2019 (r351550) @@ -1684,8 +1684,9 @@ probe_device_check: case PROBE_TUR_FOR_NEGOTIATION: case PROBE_DV_EXIT: if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) { - cam_periph_error(done_ccb, 0, - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | + SF_NO_RECOVERY | SF_NO_RETRY) == ERESTART) + goto outr; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ @@ -1735,8 +1736,9 @@ probe_device_check: struct ccb_scsiio *csio; if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) { - cam_periph_error(done_ccb, 0, - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | + SF_NO_RECOVERY | SF_NO_RETRY) == ERESTART) + goto outr; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ From owner-svn-src-head@freebsd.org Tue Aug 27 17:05:31 2019 Return-Path: Delivered-To: svn-src-head@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 35220DA75F; Tue, 27 Aug 2019 17:05:31 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46HwHH0d76z45nD; Tue, 27 Aug 2019 17:05:30 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay05.pair.com (Postfix) with ESMTP id 753D61A389A; Tue, 27 Aug 2019 13:05:29 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id x7RH5SCv007146 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 27 Aug 2019 19:05:28 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id x7RH5R0P007145; Tue, 27 Aug 2019 19:05:27 +0200 (CEST) (envelope-from pho) Date: Tue, 27 Aug 2019 19:05:27 +0200 From: Peter Holm To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... Message-ID: <20190827170527.GA7111@x8.osted.lan> References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827143953.GA5092@x8.osted.lan> <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 46HwHH0d76z45nD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 17:05:31 -0000 On Tue, Aug 27, 2019 at 09:02:31AM -0700, John Baldwin wrote: > On 8/27/19 7:39 AM, Peter Holm wrote: > > On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: > >> Author: jhb > >> Date: Tue Aug 27 00:01:56 2019 > >> New Revision: 351522 > >> URL: https://svnweb.freebsd.org/changeset/base/351522 > >> > >> Log: > >> Add kernel-side support for in-kernel TLS. > >> > > > > Could this be yours? > > > > 20190827 15:55:34 all (496/668): sendfile12.sh > > Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was killed: out of swap space > > panic: non-ext_pgs mbuf with TLS session > > Possibly, though if sfio was freed and marked with 0xdeadc0de junk, then it > would trip over this assertion for any use-after-free. I see in gdb that you > couldn't see sfio because of clang's poor debug info. It would be really good > to try to find the contents of sfio to debug this further. > > You should be able to find it via 'bp->b_caller1' in frame 14: > > 'p *(struct sf_io *)bp->b_caller1' > Here's a repeat where the involved files are compiled with "-O0": https://people.freebsd.org/~pho/stress/log/jhb009.txt Let me know if you need the kernel + core. - Peter From owner-svn-src-head@freebsd.org Tue Aug 27 17:22:17 2019 Return-Path: Delivered-To: svn-src-head@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 9E0EDDAD2F; Tue, 27 Aug 2019 17:22:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 46Hwfd3k3Qz46tB; Tue, 27 Aug 2019 17:22:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f47.google.com with SMTP id o11so6490740lfb.12; Tue, 27 Aug 2019 10:22:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tqXfSnjGDh5wtO+upAeU+Q7nNIkO+XsB+ek0IuZfdcw=; b=tP579vjHO4LGVoZbP+y4JnBMwYQYCM5+u1CCeNBdv+I8B3/blssRJvCBr8Flf/Ni4f wCdpXMc0cYJOJYycmoyrV9t0cFf7T6D63QmgB1ZDzX3yOfEDkUJP3F0o05kYsfWnG2EP /lnEgV9UgSqAM3fsghreqq5c3zA1iqGN1EA1IDTEEKHFV0eCL3MS/95Xw5dwrqF/Yp3b tQEOrdQ0Ns4Xx/elNWkRdZ4C0mGj76oEvrTe84rDZXmSfJfzp+6fgcpEKnNejbq7/CIt UmxvApow1a0rnzR7sgNAuWxizR2ZumvicUw+CsVLQm0e6hzLetb0uUMythzl72Yyvwdl /8vQ== X-Gm-Message-State: APjAAAUHCHqP2iCVEFHpVaacXD1qPVJHwc9LrAlD4wMKQdJkcsY9oF74 1FBNi8V4AWhgE21er2Odp8fE7rz1qyrxuRaXYnGBeKLFtpU= X-Google-Smtp-Source: APXvYqyQ2R7cQV4lLl3m0L6UrlRrcnB3sH/Vv+fgS0yHS1qXAfjvMxfI8y8TmGIs5jXRd6DN6pLivqJ1SG34GPeLqCg= X-Received: by 2002:ac2:51d0:: with SMTP id u16mr14967589lfm.178.1566926535407; Tue, 27 Aug 2019 10:22:15 -0700 (PDT) MIME-Version: 1.0 References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827143953.GA5092@x8.osted.lan> <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> <20190827170527.GA7111@x8.osted.lan> In-Reply-To: <20190827170527.GA7111@x8.osted.lan> From: Alan Somers Date: Tue, 27 Aug 2019 11:22:03 -0600 Message-ID: Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... To: Peter Holm Cc: John Baldwin , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46Hwfd3k3Qz46tB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 17:22:17 -0000 On Tue, Aug 27, 2019 at 11:05 AM Peter Holm wrote: > On Tue, Aug 27, 2019 at 09:02:31AM -0700, John Baldwin wrote: > > On 8/27/19 7:39 AM, Peter Holm wrote: > > > On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: > > >> Author: jhb > > >> Date: Tue Aug 27 00:01:56 2019 > > >> New Revision: 351522 > > >> URL: https://svnweb.freebsd.org/changeset/base/351522 > > >> > > >> Log: > > >> Add kernel-side support for in-kernel TLS. > > >> > > > > > > Could this be yours? > > > > > > 20190827 15:55:34 all (496/668): sendfile12.sh > > > Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was > killed: out of swap space > > > panic: non-ext_pgs mbuf with TLS session > > > > Possibly, though if sfio was freed and marked with 0xdeadc0de junk, then > it > > would trip over this assertion for any use-after-free. I see in gdb > that you > > couldn't see sfio because of clang's poor debug info. It would be > really good > > to try to find the contents of sfio to debug this further. > > > > You should be able to find it via 'bp->b_caller1' in frame 14: > > > > 'p *(struct sf_io *)bp->b_caller1' > > > > Here's a repeat where the involved files are compiled with "-O0": > https://people.freebsd.org/~pho/stress/log/jhb009.txt > > Let me know if you need the kernel + core. > > - Peter > This panic is easily reproducible by the fusefs test suite. $ cd /usr/tests/sys/fs/fusefs/ $ ./read --gtest_filter=Read.sendfile panic: non-ext_pgs mbuf with TLS session cpuid = 3 time = 1566926504 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0050bdc560 vpanic() at vpanic+0x19d/frame 0xfffffe0050bdc5b0 panic() at panic+0x43/frame 0xfffffe0050bdc610 sendfile_iodone() at sendfile_iodone+0x28e/frame 0xfffffe0050bdc660 vn_sendfile() at vn_sendfile+0x1598/frame 0xfffffe0050bdc8f0 sendfile() at sendfile+0x127/frame 0xfffffe0050bdc980 amd64_syscall() at amd64_syscall+0x2b9/frame 0xfffffe0050bdcab0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0050bdcab0 --- syscall (393, FreeBSD ELF64, sys_sendfile), rip = 0x80052d9ea, rsp = 0x7fffffffe5a8, rbp = 0x7fffffffe790 --- -Alan From owner-svn-src-head@freebsd.org Tue Aug 27 17:59:10 2019 Return-Path: Delivered-To: svn-src-head@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 7F551DB689; Tue, 27 Aug 2019 17:59:10 +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 46HxTB1wx3z48W3; Tue, 27 Aug 2019 17:59:10 +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 1EE98226F7; Tue, 27 Aug 2019 17:59:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RHx9K1021541; Tue, 27 Aug 2019 17:59:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RHx9WL021540; Tue, 27 Aug 2019 17:59:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908271759.x7RHx9WL021540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 27 Aug 2019 17:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351551 - 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: 351551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 17:59:10 -0000 Author: manu Date: Tue Aug 27 17:59:09 2019 New Revision: 351551 URL: https://svnweb.freebsd.org/changeset/base/351551 Log: arm64: rk3328: pinctrl: Add gpio banks and fix iomux Since r351187 the pinctrl driver need to know the gpio bank as it directly attach the gpio driver to handle some setup that might be present in the dts, add the gpio banks table for rk3328. While here fix some IOMUX definition that prevented to boot on RK3328 as pinctrl wasn't configured correctly. Submitted by: mmel (original version) MFC after: 2 weeks MFC With: r351187 Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Tue Aug 27 16:41:06 2019 (r351550) +++ head/sys/arm64/rockchip/rk_pinctrl.c Tue Aug 27 17:59:09 2019 (r351551) @@ -384,6 +384,13 @@ struct rk_pinctrl_conf rk3288_conf = { .get_syscon = rk3288_get_syscon, }; +static struct rk_pinctrl_gpio rk3328_gpio_bank[] = { + RK_GPIO(0, "gpio0"), + RK_GPIO(1, "gpio1"), + RK_GPIO(2, "gpio2"), + RK_GPIO(3, "gpio3"), +}; + static struct rk_pinctrl_bank rk3328_iomux_bank[] = { /* bank sub offs nbits */ RK_IOMUX(0, 0, 0x0000, 2), @@ -394,18 +401,14 @@ static struct rk_pinctrl_bank rk3328_iomux_bank[] = { RK_IOMUX(1, 1, 0x0014, 2), RK_IOMUX(1, 2, 0x0018, 2), RK_IOMUX(1, 3, 0x001C, 2), - RK_IOMUX(2, 0, 0xE000, 2), - RK_IOMUX(2, 1, 0xE004, 2), - RK_IOMUX(2, 2, 0xE008, 2), - RK_IOMUX(2, 3, 0xE00C, 2), - RK_IOMUX(3, 0, 0xE010, 2), - RK_IOMUX(3, 1, 0xE014, 2), - RK_IOMUX(3, 2, 0xE018, 2), - RK_IOMUX(3, 3, 0xE01C, 2), - RK_IOMUX(4, 0, 0xE020, 2), - RK_IOMUX(4, 1, 0xE024, 2), - RK_IOMUX(4, 2, 0xE028, 2), - RK_IOMUX(4, 3, 0xE02C, 2), + RK_IOMUX(2, 0, 0x0020, 2), + RK_IOMUX(2, 1, 0x0024, 3), + RK_IOMUX(2, 2, 0x002c, 3), + RK_IOMUX(2, 3, 0x0034, 2), + RK_IOMUX(3, 0, 0x0038, 3), + RK_IOMUX(3, 1, 0x0040, 3), + RK_IOMUX(3, 2, 0x0048, 2), + RK_IOMUX(3, 3, 0x004c, 2), }; static struct rk_pinctrl_pin_fixup rk3328_pin_fixup[] = { @@ -518,6 +521,8 @@ struct rk_pinctrl_conf rk3328_conf = { .npin_fixup = nitems(rk3328_pin_fixup), .pin_drive = rk3328_pin_drive, .npin_drive = nitems(rk3328_pin_drive), + .gpio_bank = rk3328_gpio_bank, + .ngpio_bank = nitems(rk3328_gpio_bank), .get_pd_offset = rk3328_get_pd_offset, .get_syscon = rk3328_get_syscon, }; From owner-svn-src-head@freebsd.org Tue Aug 27 18:00:01 2019 Return-Path: Delivered-To: svn-src-head@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 E556EDB707; Tue, 27 Aug 2019 18:00:01 +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 46HxV95g1vz48kj; Tue, 27 Aug 2019 18:00:01 +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 A55A322700; Tue, 27 Aug 2019 18:00:01 +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 x7RI01bX021692; Tue, 27 Aug 2019 18:00:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RI01mx021691; Tue, 27 Aug 2019 18:00:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908271800.x7RI01mx021691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 27 Aug 2019 18:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351552 - 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: 351552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 18:00:02 -0000 Author: manu Date: Tue Aug 27 18:00:01 2019 New Revision: 351552 URL: https://svnweb.freebsd.org/changeset/base/351552 Log: arm64: rk3399: pinctrl: Add gpio banks and fix iomux Since r351187 the pinctrl driver need to know the gpio bank as it directly attach the gpio driver to handle some setup that might be present in the dts, add the gpio banks table for rk3399. While here fix some IOMUX definition that prevented to boot on RK3399 as pinctrl wasn't configured correctly. Submitted by: mmel (original version) MFC after: 2 weeks MFC With: r351187 Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Tue Aug 27 17:59:09 2019 (r351551) +++ head/sys/arm64/rockchip/rk_pinctrl.c Tue Aug 27 18:00:01 2019 (r351552) @@ -527,6 +527,14 @@ struct rk_pinctrl_conf rk3328_conf = { .get_syscon = rk3328_get_syscon, }; +static struct rk_pinctrl_gpio rk3399_gpio_bank[] = { + RK_GPIO(0, "gpio0"), + RK_GPIO(1, "gpio1"), + RK_GPIO(2, "gpio2"), + RK_GPIO(3, "gpio3"), + RK_GPIO(4, "gpio4"), +}; + static struct rk_pinctrl_bank rk3399_iomux_bank[] = { /* bank sub offs nbits */ RK_IOMUX(0, 0, 0x0000, 2), @@ -536,7 +544,7 @@ static struct rk_pinctrl_bank rk3399_iomux_bank[] = { RK_IOMUX(1, 0, 0x0010, 2), RK_IOMUX(1, 1, 0x0014, 2), RK_IOMUX(1, 2, 0x0018, 2), - RK_IOMUX(1, 3, 0x000C, 2), + RK_IOMUX(1, 3, 0x001C, 2), RK_IOMUX(2, 0, 0xE000, 2), RK_IOMUX(2, 1, 0xE004, 2), RK_IOMUX(2, 2, 0xE008, 2), @@ -617,6 +625,8 @@ struct rk_pinctrl_conf rk3399_conf = { .npin_fixup = nitems(rk3399_pin_fixup), .pin_drive = rk3399_pin_drive, .npin_drive = nitems(rk3399_pin_drive), + .gpio_bank = rk3399_gpio_bank, + .ngpio_bank = nitems(rk3399_gpio_bank), .get_pd_offset = rk3399_get_pd_offset, .get_syscon = rk3399_get_syscon, }; From owner-svn-src-head@freebsd.org Tue Aug 27 19:16:38 2019 Return-Path: Delivered-To: svn-src-head@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 F0CD8DCCAE; Tue, 27 Aug 2019 19:16:38 +0000 (UTC) (envelope-from jhb@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 46HzBZ65VBz4DMv; Tue, 27 Aug 2019 19:16:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 35BDD83F5; Tue, 27 Aug 2019 19:16:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827143953.GA5092@x8.osted.lan> <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> <20190827170527.GA7111@x8.osted.lan> 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: <1bfccef6-8cc2-328b-f97f-66d8aa5437a3@FreeBSD.org> Date: Tue, 27 Aug 2019 12:16:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190827170527.GA7111@x8.osted.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 19:16:39 -0000 On 8/27/19 10:05 AM, Peter Holm wrote: > On Tue, Aug 27, 2019 at 09:02:31AM -0700, John Baldwin wrote: >> On 8/27/19 7:39 AM, Peter Holm wrote: >>> On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: >>>> Author: jhb >>>> Date: Tue Aug 27 00:01:56 2019 >>>> New Revision: 351522 >>>> URL: https://svnweb.freebsd.org/changeset/base/351522 >>>> >>>> Log: >>>> Add kernel-side support for in-kernel TLS. >>>> >>> >>> Could this be yours? >>> >>> 20190827 15:55:34 all (496/668): sendfile12.sh >>> Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was killed: out of swap space >>> panic: non-ext_pgs mbuf with TLS session >> >> Possibly, though if sfio was freed and marked with 0xdeadc0de junk, then it >> would trip over this assertion for any use-after-free. I see in gdb that you >> couldn't see sfio because of clang's poor debug info. It would be really good >> to try to find the contents of sfio to debug this further. >> >> You should be able to find it via 'bp->b_caller1' in frame 14: >> >> 'p *(struct sf_io *)bp->b_caller1' >> > > Here's a repeat where the involved files are compiled with "-O0": > https://people.freebsd.org/~pho/stress/log/jhb009.txt Ok, it looks like sfio->tls is just not being initialized to NULL in the !KERN_TLS case and the malloc junk is leaking through (my fault): (kgdb) p *(struct sf_io *)bp->b_caller1 $5 = {nios = 0x0, error = 0x0, npages = 0x1, so = 0xfffff808898d0000, m = 0xfffff808a3512200, tls = 0xdeadc0dedeadc0de, pa = 0xfffff804e6cdfc68} Initially I thought about using M_ZERO, but we can just axe the 'tls' member of 'sfio' entirely in the !KERN_TLS case since it's a private structure. Try this (untested) change): Index: kern_sendfile.c =================================================================== --- kern_sendfile.c (revision 351522) +++ kern_sendfile.c (working copy) @@ -88,7 +88,9 @@ struct sf_io { int npages; struct socket *so; struct mbuf *m; +#ifdef KERN_TLS struct ktls_session *tls; +#endif vm_page_t pa[]; }; @@ -266,7 +268,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int coun if (!refcount_release(&sfio->nios)) return; -#ifdef INVARIANTS +#if defined(KERN_TLS) && defined(INVARIANTS) if ((sfio->m->m_flags & M_EXT) != 0 && sfio->m->m_ext.ext_type == EXT_PGS) KASSERT(sfio->tls == sfio->m->m_ext.ext_pgs->tls, -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 27 20:11:46 2019 Return-Path: Delivered-To: svn-src-head@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 13596DE666; Tue, 27 Aug 2019 20:11:46 +0000 (UTC) (envelope-from hrs@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 46J0Q96ndbz4HYQ; Tue, 27 Aug 2019 20:11:45 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAEF823F61; Tue, 27 Aug 2019 20:11:45 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RKBjbZ003184; Tue, 27 Aug 2019 20:11:45 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RKBjpu003182; Tue, 27 Aug 2019 20:11:45 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201908272011.x7RKBjpu003182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Tue, 27 Aug 2019 20:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351554 - head/contrib/sendmail/src X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/contrib/sendmail/src X-SVN-Commit-Revision: 351554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:11:46 -0000 Author: hrs Date: Tue Aug 27 20:11:45 2019 New Revision: 351554 URL: https://svnweb.freebsd.org/changeset/base/351554 Log: MFV r351553: Fix a problem which prevented -OServerSSLOptions or -OClientSSLOptions specified in the command-line option from working. This patch has been accepted by the upstream. Reviewed by and discussed with: gshapiro Modified: head/contrib/sendmail/src/conf.c head/contrib/sendmail/src/readcf.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/src/conf.c ============================================================================== --- head/contrib/sendmail/src/conf.c Tue Aug 27 19:37:19 2019 (r351553) +++ head/contrib/sendmail/src/conf.c Tue Aug 27 20:11:45 2019 (r351554) @@ -365,6 +365,20 @@ setdefaults(e) TLS_Srv_Opts = TLS_I_SRV; if (NULL == EVP_digest) EVP_digest = EVP_md5(); + Srv_SSL_Options = SSL_OP_ALL; + Clt_SSL_Options = SSL_OP_ALL +# ifdef SSL_OP_NO_SSLv2 + | SSL_OP_NO_SSLv2 +# endif +# ifdef SSL_OP_NO_TICKET + | SSL_OP_NO_TICKET +# endif + ; +# ifdef SSL_OP_TLSEXT_PADDING + /* SSL_OP_TLSEXT_PADDING breaks compatibility with some sites */ + Srv_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; + Clt_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; +# endif /* SSL_OP_TLSEXT_PADDING */ #endif /* STARTTLS */ #ifdef HESIOD_INIT HesiodContext = NULL; Modified: head/contrib/sendmail/src/readcf.c ============================================================================== --- head/contrib/sendmail/src/readcf.c Tue Aug 27 19:37:19 2019 (r351553) +++ head/contrib/sendmail/src/readcf.c Tue Aug 27 20:11:45 2019 (r351554) @@ -159,22 +159,6 @@ readcf(cfname, safe, e) FileName = cfname; LineNumber = 0; -#if STARTTLS - Srv_SSL_Options = SSL_OP_ALL; - Clt_SSL_Options = SSL_OP_ALL -# ifdef SSL_OP_NO_SSLv2 - | SSL_OP_NO_SSLv2 -# endif -# ifdef SSL_OP_NO_TICKET - | SSL_OP_NO_TICKET -# endif - ; -# ifdef SSL_OP_TLSEXT_PADDING - /* SSL_OP_TLSEXT_PADDING breaks compatibility with some sites */ - Srv_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; - Clt_SSL_Options &= ~SSL_OP_TLSEXT_PADDING; -# endif /* SSL_OP_TLSEXT_PADDING */ -#endif /* STARTTLS */ if (DontLockReadFiles) sff |= SFF_NOLOCK; cf = safefopen(cfname, O_RDONLY, 0444, sff); From owner-svn-src-head@freebsd.org Tue Aug 27 20:23:57 2019 Return-Path: Delivered-To: svn-src-head@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 204EFDEB92; Tue, 27 Aug 2019 20:23:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46J0hF02fnz4JDB; Tue, 27 Aug 2019 20:23:56 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 28302220B8; Tue, 27 Aug 2019 16:23:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 27 Aug 2019 16:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=x WwYn6YEZZ6gaNQ2dwJ23nHquINdR+zRTYu71NGz7Bw=; b=RSmd299KLBS4YaTSi 7AoPb9k1emk8F8FTXSgW/ZksjeXG1SpiggC/jtwPLdm9BecK0eLg+rh6XAGTtXd5 dXQvAzK8TOr709sguXr0z2FsJ51B7Yg76yMvUhL469MBGNNg6F2y/FQZl3qGdMvT AxCkR5hAj539/QbYUi1pcbgVuXozHYnf/TzpVIiWGKuRwGdWMxZiXR9jgN6J1RbA BDZCHviBeo82bgodmC+AQrlzq+vJN87qBDBG22Zvb9nDaUsJ97MV3Jh35DuD68rJ qNLGRbLmwntS4NZOyhbtHwRyAsqGP0WjNbLNuGQpKkaH7m09loRJskSuMNIKVNmD SRWQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm3; bh=xWwYn6YEZZ6gaNQ2dwJ23nHquINdR+zRTYu71NGz7 Bw=; b=GgYmu65bG2/RUT+STIfrm5uv/7oIf6sh87+ofvU42762qFdWe+tLf5R90 j4zSgV9bL6WNJj4evv1HlCZkrxB9eJlNN3u6ujIOsfCv7fu3Wg/BwwouMCoBazqV 7Z5f9eJO2CBwVG4WGTQ2rMbMxljNqPc4OMM/WzFaZ9c/jT6P3PNUs2uuIccAYoPl YCgtqwBUgIOwOiqPr1QtAg938ZQbLwQPcW5pjVKhgRkTlPW2zdoF1SxszEj8l1hF wSFrHfnFnZNJo+vI3yvJduBXfye6E20A8v04xp4n3HNlJxkvDofEUfMjJqgWj7Cy i0CESdW6iYk38crCE/qsorZushttw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudehkedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtggfuhfgjfffgkfhfvffosehtqh hmtdhhtdejnecuhfhrohhmpefutghothhtucfnohhnghcuoehstghothhtlhesshgrmhhs tghordhorhhgqeenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucfkphepkedrge eirdekledrvddufeenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehsrghm shgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 42706D60057; Tue, 27 Aug 2019 16:23:55 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r351550 - head/sys/cam/scsi From: Scott Long In-Reply-To: <201908271641.x7RGf6LC075849@repo.freebsd.org> Date: Tue, 27 Aug 2019 14:23:54 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <99271565-F168-48C8-90E0-749417C7C974@samsco.org> References: <201908271641.x7RGf6LC075849@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46J0hF02fnz4JDB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.948,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:23:57 -0000 This is very concerning, and I wonder if it=E2=80=99s the cause of the = mystery use-after-free / double-complete that I=E2=80=99ve seen for = years and have never been able to catch. Can you say more about how you = found it? Scott > On Aug 27, 2019, at 10:41 AM, Alexander Motin wrote: >=20 > Author: mav > Date: Tue Aug 27 16:41:06 2019 > New Revision: 351550 > URL: https://svnweb.freebsd.org/changeset/base/351550 >=20 > Log: > Always check cam_periph_error() status for ERESTART. >=20 > Even if we do not expect retries, we better be sure, since otherwise = it > may result in use after free kernel panic. I've noticed that it = retries > SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY. >=20 > MFC after: 1 week > Sponsored by: iXsystems, Inc. >=20 > Modified: > head/sys/cam/scsi/scsi_xpt.c >=20 > Modified: head/sys/cam/scsi/scsi_xpt.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 15:42:08 2019 = (r351549) > +++ head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 16:41:06 2019 = (r351550) > @@ -1684,8 +1684,9 @@ probe_device_check: > case PROBE_TUR_FOR_NEGOTIATION: > case PROBE_DV_EXIT: > if (cam_ccb_status(done_ccb) !=3D CAM_REQ_CMP) { > - cam_periph_error(done_ccb, 0, > - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); > + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | > + SF_NO_RECOVERY | SF_NO_RETRY) =3D=3D = ERESTART) > + goto outr; > } > if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) !=3D 0) { > /* Don't wedge the queue */ > @@ -1735,8 +1736,9 @@ probe_device_check: > struct ccb_scsiio *csio; >=20 > if (cam_ccb_status(done_ccb) !=3D CAM_REQ_CMP) { > - cam_periph_error(done_ccb, 0, > - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); > + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | > + SF_NO_RECOVERY | SF_NO_RETRY) =3D=3D = ERESTART) > + goto outr; > } > if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) !=3D 0) { > /* Don't wedge the queue */ >=20 From owner-svn-src-head@freebsd.org Tue Aug 27 20:30:57 2019 Return-Path: Delivered-To: svn-src-head@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 9FFA1DED89; Tue, 27 Aug 2019 20:30:57 +0000 (UTC) (envelope-from mjg@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 46J0rK3lhHz4JQ5; Tue, 27 Aug 2019 20:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63B94242B9; Tue, 27 Aug 2019 20:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RKUvvn010750; Tue, 27 Aug 2019 20:30:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RKUvuU010749; Tue, 27 Aug 2019 20:30:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908272030.x7RKUvuU010749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 27 Aug 2019 20:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351555 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:30:57 -0000 Author: mjg Date: Tue Aug 27 20:30:56 2019 New Revision: 351555 URL: https://svnweb.freebsd.org/changeset/base/351555 Log: vfs: stop passing LK_INTERLOCK to VOP_UNLOCK The plan is to drop the flags argument. There is also a temporary bug now that nullfs ignores the flag. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21252 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 27 20:11:45 2019 (r351554) +++ head/sys/kern/vfs_subr.c Tue Aug 27 20:30:56 2019 (r351555) @@ -1034,8 +1034,8 @@ vlrureclaim(struct mount *mp, bool reclaim_nc_src, int (vp->v_iflag & VI_FREE) != 0 || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { - VOP_UNLOCK(vp, LK_INTERLOCK); - vdrop(vp); + VOP_UNLOCK(vp, 0); + vdropl(vp); goto next_iter_mntunlocked; } KASSERT((vp->v_iflag & VI_DOOMED) == 0, @@ -1398,7 +1398,8 @@ vtryrecycle(struct vnode *vp) */ VI_LOCK(vp); if (vp->v_usecount) { - VOP_UNLOCK(vp, LK_INTERLOCK); + VOP_UNLOCK(vp, 0); + VI_UNLOCK(vp); vn_finished_write(vnmp); CTR2(KTR_VFS, "%s: impossible to recycle, %p is already referenced", @@ -1409,7 +1410,8 @@ vtryrecycle(struct vnode *vp) counter_u64_add(recycles_count, 1); vgonel(vp); } - VOP_UNLOCK(vp, LK_INTERLOCK); + VOP_UNLOCK(vp, 0); + VI_UNLOCK(vp); vn_finished_write(vnmp); return (0); } From owner-svn-src-head@freebsd.org Tue Aug 27 20:51:18 2019 Return-Path: Delivered-To: svn-src-head@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 24F8BDF441; Tue, 27 Aug 2019 20:51:18 +0000 (UTC) (envelope-from mjg@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 46J1Hp089zz4KQq; Tue, 27 Aug 2019 20:51:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAE89247A7; Tue, 27 Aug 2019 20:51:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RKpHIH026461; Tue, 27 Aug 2019 20:51:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RKpHMf026460; Tue, 27 Aug 2019 20:51:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908272051.x7RKpHMf026460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 27 Aug 2019 20:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351556 - head/sys/fs/unionfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/unionfs X-SVN-Commit-Revision: 351556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:51:18 -0000 Author: mjg Date: Tue Aug 27 20:51:17 2019 New Revision: 351556 URL: https://svnweb.freebsd.org/changeset/base/351556 Log: unionfs: stop passing LK_INTERLOCK to VOP_UNLOCK This is part of the preparation to remove flags argument from VOP_UNLOCK. Also has a side effect of fixing stacking on top of nullfs broken by r351472. Reported by: cy Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/unionfs/union_vnops.c Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Tue Aug 27 20:30:56 2019 (r351555) +++ head/sys/fs/unionfs/union_vnops.c Tue Aug 27 20:51:17 2019 (r351556) @@ -1882,12 +1882,9 @@ unionfs_lock(struct vop_lock1_args *ap) if (lvp != NULLVP) { if (uvp != NULLVP && flags & LK_UPGRADE) { /* Share Lock is once released and a deadlock is avoided. */ - VI_LOCK_FLAGS(uvp, MTX_DUPOK); - vholdl(uvp); + vholdnz(uvp); uhold = 1; - VI_UNLOCK(vp); - VOP_UNLOCK(uvp, LK_RELEASE | LK_INTERLOCK); - VI_LOCK(vp); + VOP_UNLOCK(uvp, LK_RELEASE); unp = VTOUNIONFS(vp); if (unp == NULL) { /* vnode is released. */ @@ -1978,7 +1975,6 @@ unionfs_unlock(struct vop_unlock_args *ap) { int error; int flags; - int mtxlkflag; int uhold; struct vnode *vp; struct vnode *lvp; @@ -1988,18 +1984,10 @@ unionfs_unlock(struct vop_unlock_args *ap) KASSERT_UNIONFS_VNODE(ap->a_vp); error = 0; - mtxlkflag = 0; uhold = 0; flags = ap->a_flags | LK_RELEASE; vp = ap->a_vp; - if ((flags & LK_INTERLOCK) != 0) - mtxlkflag = 1; - else if (mtx_owned(VI_MTX(vp)) == 0) { - VI_LOCK(vp); - mtxlkflag = 2; - } - unp = VTOUNIONFS(vp); if (unp == NULL) goto unionfs_unlock_null_vnode; @@ -2007,45 +1995,24 @@ unionfs_unlock(struct vop_unlock_args *ap) uvp = unp->un_uppervp; if (lvp != NULLVP) { - VI_LOCK_FLAGS(lvp, MTX_DUPOK); - flags |= LK_INTERLOCK; - vholdl(lvp); - - VI_UNLOCK(vp); - ap->a_flags &= ~LK_INTERLOCK; - + vholdnz(lvp); error = VOP_UNLOCK(lvp, flags); - - VI_LOCK(vp); } if (error == 0 && uvp != NULLVP) { - VI_LOCK_FLAGS(uvp, MTX_DUPOK); - flags |= LK_INTERLOCK; - vholdl(uvp); + vholdnz(uvp); uhold = 1; - - VI_UNLOCK(vp); - ap->a_flags &= ~LK_INTERLOCK; - error = VOP_UNLOCK(uvp, flags); - - VI_LOCK(vp); } - VI_UNLOCK(vp); if (lvp != NULLVP) vdrop(lvp); if (uhold != 0) vdrop(uvp); - if (mtxlkflag == 0) - VI_LOCK(vp); return error; unionfs_unlock_null_vnode: - if (mtxlkflag == 2) - VI_UNLOCK(vp); return (vop_stdunlock(ap)); } From owner-svn-src-head@freebsd.org Tue Aug 27 20:52:26 2019 Return-Path: Delivered-To: svn-src-head@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 D102BDF4D9; Tue, 27 Aug 2019 20:52:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) (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 46J1K60Gptz4KlS; Tue, 27 Aug 2019 20:52:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x244.google.com with SMTP id n1so368409oic.3; Tue, 27 Aug 2019 13:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=QF4+lV8v3y4nxPFIiwTZhp88PFS8EiaULbV0A6vPNpY=; b=Km2ov92QD3o3kal4GhR5Mxa3gvoHldCLsm+yBC0urDWDYnbMmUNrHU8fLvOrspaneI /ezSOuet+1EkYbNf4wkAR/n3EpzXNC3lPtD5l/0SkEjeR8GiT6OjU8otma+GCzkUdgVD 1WT4ksWgPKTEK+DoEmOhDW4DE0gZE3vLYE3bsBq+8AII660nBs+rLPEBwjLvNLtdXh/C D+EeFLyQ1UgEoln/cXqSG2VwVTBJHxC15bSHmWLRf0fzMueMcOcqvddFUqg6dF1T8tUO Mydwciie/fbay3lmbfRuq/bAnLHxIzIuJ3NIsWZJQ8GVz/tfWfmwx/n6Cous8B5zWG2R xYJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=QF4+lV8v3y4nxPFIiwTZhp88PFS8EiaULbV0A6vPNpY=; b=LC40ryVTDh/lqzMCmWkgch6Pv5nQ1HfMnTdeCF8zj8Hy7SOIA3Z2XXcmabR/+Ezehg 43Jmo7QobUh6QT9+tlQOF+BAYhaKBV4/jJ0ecqk4cH6b/ZKwwT1tYEeglrP2BD6gMmx2 +bOd0k9IWviY4MIRfoGZaIydXA1eFuU1I9avVc5UTbhEY9Rk5cIC0Hp8wSMAT0XgMgv8 dJjEeWNuqkKUmwY/hD5eUDs6GN4Mgs7Ss1/tnU3IJPwiPJj/7IZFyWab4xBapfQygctJ TcPYWcHzfr8NeKadQpuIAxVx98BWITAngDEYgqhe8SWlQcqHKsW7ET9y5jhtNwn6bTr8 8KKg== X-Gm-Message-State: APjAAAW4t7CNjo+0OmGmgD7a3tFyvdtS/3YERIWagg8CtCAA2OZwjQ2v 2Lk0Ctv/pXVPNG8WVwHJDaVyA489fJDlF7N7jXwu6w== X-Google-Smtp-Source: APXvYqwoPcPQIZ4JpvywE/FVBKqRFwofGx15biQjdZVVCqBMjaaVcwTpn6v6QuOor1Fp5gVyP747JQWcKRzDlNja+KQ= X-Received: by 2002:aca:4b86:: with SMTP id y128mr453056oia.163.1566939144092; Tue, 27 Aug 2019 13:52:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Tue, 27 Aug 2019 13:52:23 -0700 (PDT) In-Reply-To: <201908272030.x7RKUvuU010749@repo.freebsd.org> References: <201908272030.x7RKUvuU010749@repo.freebsd.org> From: Mateusz Guzik Date: Tue, 27 Aug 2019 22:52:23 +0200 Message-ID: Subject: Re: svn commit: r351555 - head/sys/kern To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46J1K60Gptz4KlS X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Km2ov92Q; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::244 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(0.00)[ip: (2.32), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.2.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]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:52:26 -0000 On 8/27/19, Mateusz Guzik wrote: > Author: mjg > Date: Tue Aug 27 20:30:56 2019 > New Revision: 351555 > URL: https://svnweb.freebsd.org/changeset/base/351555 > > Log: > vfs: stop passing LK_INTERLOCK to VOP_UNLOCK > > The plan is to drop the flags argument. There is also a temporary bug > now that nullfs ignores the flag. > > Reviewed by: kib > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D21252 > Ops. That's of course https://reviews.freebsd.org/D21426 > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Tue Aug 27 20:11:45 2019 (r351554) > +++ head/sys/kern/vfs_subr.c Tue Aug 27 20:30:56 2019 (r351555) > @@ -1034,8 +1034,8 @@ vlrureclaim(struct mount *mp, bool reclaim_nc_src, > int > (vp->v_iflag & VI_FREE) != 0 || > (vp->v_object != NULL && > vp->v_object->resident_page_count > trigger)) { > - VOP_UNLOCK(vp, LK_INTERLOCK); > - vdrop(vp); > + VOP_UNLOCK(vp, 0); > + vdropl(vp); > goto next_iter_mntunlocked; > } > KASSERT((vp->v_iflag & VI_DOOMED) == 0, > @@ -1398,7 +1398,8 @@ vtryrecycle(struct vnode *vp) > */ > VI_LOCK(vp); > if (vp->v_usecount) { > - VOP_UNLOCK(vp, LK_INTERLOCK); > + VOP_UNLOCK(vp, 0); > + VI_UNLOCK(vp); > vn_finished_write(vnmp); > CTR2(KTR_VFS, > "%s: impossible to recycle, %p is already referenced", > @@ -1409,7 +1410,8 @@ vtryrecycle(struct vnode *vp) > counter_u64_add(recycles_count, 1); > vgonel(vp); > } > - VOP_UNLOCK(vp, LK_INTERLOCK); > + VOP_UNLOCK(vp, 0); > + VI_UNLOCK(vp); > vn_finished_write(vnmp); > return (0); > } > _______________________________________________ > 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" > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Aug 27 20:57:57 2019 Return-Path: Delivered-To: svn-src-head@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 43758DF73C; Tue, 27 Aug 2019 20:57:57 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) (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 46J1RS1kRwz4L2N; Tue, 27 Aug 2019 20:57:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb29.google.com with SMTP id o82so42920ybg.10; Tue, 27 Aug 2019 13:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qh9Ia3lhy4FNxr2uqNDgPQoDs2Vy+2zJVJUCTvN+gu0=; b=d1kTYW8Gvd5fEJkF8HKnWmFaVfR++WwZRYUtdBzXewnHih+Us31e5stwreWHQ2kkF0 l6VQL3BKgdUDc3bWOHMMVmkWBiGX5OV+QYjg/ozVGuDSdRCxO1FmJRxV9PcshR+SfWIG irYaH8DVyJ/NJvudTZUQPDEoLohnXFH8VgJ9TjT53WM697klEPK/dXSCvawCbRtLxEU2 cWla63jLrhqVAQqoao8CwpHXD+peT5cEzfcBkzG5JUiTaOmwH4AjXdFh7axYDXlaTx21 L+M925+cR6fznhAuW2Yei+ut/piZsKKOY0OigB607iJxAEGRn9a6DppEEduNZKu2Q4tK NZGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=qh9Ia3lhy4FNxr2uqNDgPQoDs2Vy+2zJVJUCTvN+gu0=; b=gdu3pdRVHx2hGB0TAAOEQWcM9ZY8mstC7ahYrmG6crUeLcGMvlTY61FYI4u6Xn/dgy 0f6SWoww895peR2nFb///gie61z+eXgWqUyvcXxKs+YyqrW1WE0UA7upCfetUcox3Jry CqRTEr+syG3nVECdVXCZknGk3ZU3GDOxpfMTTUs3/lOh1l+RdWQ/FGDVf1ss+GiQsfLS bHakYyNrvfhKWOodcPA7WF+XHs30I3UcifF4qApi64kSNjajpbP74I676HvqxorD+hQl jxY8shAQyUD8d4yHRjo03+cOEQ4ne50n9YjWrOV5ihwkwyiaWUYl8Q0PicF55nuF9Ev6 a9eQ== X-Gm-Message-State: APjAAAVwTSOTO6sq8isuy8of6SVpm/pIU5ru8eQweqA/N/9YCBVryr9u NOM6lnD183ajCkR5TjsU00yg78ERxw8= X-Google-Smtp-Source: APXvYqxtbTY22dgDumRU9LEophnn9TIO2b9Wntgf3NoYLbZxMj7kwUTdUcnXUCG0jBbgm99K0pbUhg== X-Received: by 2002:a5b:b4d:: with SMTP id b13mr590679ybr.308.1566939474661; Tue, 27 Aug 2019 13:57:54 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id 199sm135160ywo.95.2019.08.27.13.57.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Aug 2019 13:57:54 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r351550 - head/sys/cam/scsi To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908271641.x7RGf6LC075849@repo.freebsd.org> <99271565-F168-48C8-90E0-749417C7C974@samsco.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <3c2aa0be-3d42-881e-87e1-675499a7bc5f@FreeBSD.org> Date: Tue, 27 Aug 2019 16:57:52 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <99271565-F168-48C8-90E0-749417C7C974@samsco.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46J1RS1kRwz4L2N X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=d1kTYW8G; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::b29 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-6.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; RCVD_IN_DNSWL_NONE(0.00)[9.2.b.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]; IP_SCORE(-2.92)[ip: (-9.34), ipnet: 2607:f8b0::/32(-2.86), asn: 15169(-2.33), country: US(-0.05)]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 20:57:57 -0000 Some FreeNAS user reported panic after updating to newer version. On the screenshot provided were several BUSY statuses for SATA disk on mps(4), followed by panic "Attempt to remove out-of-bounds index -1 from queue ...". In his case I blame ancient LSI firmware or some broken hardware, but I was able to reproduce the panic on FreeBSD head debug kernel by hacking mps(4) driver to always report BUSY (appeared except IDENTIFY and REPORT LUNS). To diagnose it I inserted assertion into xpt_free_ccb(), checking ccb->ccb_h.pinfo.index for values used for requests still in send queue. Not sure it is to be persistent, but in this case it lead me directly to this place. On 27.08.2019 16:23, Scott Long wrote: > This is very concerning, and I wonder if it’s the cause of the mystery use-after-free / double-complete that I’ve seen for years and have never been able to catch. Can you say more about how you found it? > > Scott > > >> On Aug 27, 2019, at 10:41 AM, Alexander Motin wrote: >> >> Author: mav >> Date: Tue Aug 27 16:41:06 2019 >> New Revision: 351550 >> URL: https://svnweb.freebsd.org/changeset/base/351550 >> >> Log: >> Always check cam_periph_error() status for ERESTART. >> >> Even if we do not expect retries, we better be sure, since otherwise it >> may result in use after free kernel panic. I've noticed that it retries >> SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY. >> >> MFC after: 1 week >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/cam/scsi/scsi_xpt.c >> >> Modified: head/sys/cam/scsi/scsi_xpt.c >> ============================================================================== >> --- head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 15:42:08 2019 (r351549) >> +++ head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 16:41:06 2019 (r351550) >> @@ -1684,8 +1684,9 @@ probe_device_check: >> case PROBE_TUR_FOR_NEGOTIATION: >> case PROBE_DV_EXIT: >> if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) { >> - cam_periph_error(done_ccb, 0, >> - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); >> + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | >> + SF_NO_RECOVERY | SF_NO_RETRY) == ERESTART) >> + goto outr; >> } >> if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { >> /* Don't wedge the queue */ >> @@ -1735,8 +1736,9 @@ probe_device_check: >> struct ccb_scsiio *csio; >> >> if (cam_ccb_status(done_ccb) != CAM_REQ_CMP) { >> - cam_periph_error(done_ccb, 0, >> - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); >> + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | >> + SF_NO_RECOVERY | SF_NO_RETRY) == ERESTART) >> + goto outr; >> } >> if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { >> /* Don't wedge the queue */ >> > -- Alexander Motin From owner-svn-src-head@freebsd.org Tue Aug 27 21:10:40 2019 Return-Path: Delivered-To: svn-src-head@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 25260DFBF8; Tue, 27 Aug 2019 21:10:40 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46J1k62W0cz4Ldr; Tue, 27 Aug 2019 21:10:37 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x7RLARX8019384 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Aug 2019 07:10:33 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x7RLAMju051644 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Aug 2019 07:10:22 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x7RLAMgu051643; Wed, 28 Aug 2019 07:10:22 +1000 (AEST) (envelope-from peter) Date: Wed, 28 Aug 2019 07:10:21 +1000 From: Peter Jeremy To: mmel@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351187 - head/sys/arm64/rockchip Message-ID: <20190827211021.GA51500@server.rulingia.com> References: <201908180919.x7I9JXGj021325@repo.freebsd.org> <20190825072844.GA4799@server.rulingia.com> <6da78585-2bc7-0228-e443-799643d08783@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <6da78585-2bc7-0228-e443-799643d08783@freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46J1k62W0cz4Ldr X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-6.44 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[rulingia.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.11)[ipnet: 2001:19f0:5800::/38(-4.94), asn: 20473(-0.53), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 21:10:40 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Aug-27 11:56:38 +0200, Michal Meloun wrot= e: > > >On 25.08.2019 9:28, Peter Jeremy wrote: >> On 2019-Aug-18 09:19:33 +0000, Michal Meloun >> wrote: >>> Improve rk_pinctrl driver: >>=20 >> Sorry for the late notice but this breaks my Rock64 (RK3328). >>=20 >Sorry for late response. >Seems like this is caused by unnoticed dependency between patches in >my worktree, sorry for this. I hope that r351543 solves it. >Can you, please, try r351543 on Rock64 because I haven't any rk3328 >based board for real test? r351543 + r351551 fixes it for me. Thanks for that. --=20 Peter Jeremy --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl1lnDhfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzSiug/+JxERaNmaki8T7RvJfAUWq3kjGldZhi43+4cpOj/K3tp6ZJzHu5idw+YC HalXa3HqrVBfPDFyFMG2MDGdxAPMDcunHGX3OHHef8ycEzDholi7W8aSyKO9P4uP ycvhc3GAZNo+1WDPa+z8oQ6gEIHeqegj/uwHrgL1xqHiZKFALsSG8osVaXWSCc+O bfXkFYKqhz4xLe29a/QNxNY525dCQjWNIKrZ5YRoMaqKC9mvuFCZwkV8o1tk0e+t OW08oOvzCtZw6VzsdGtMGcrjAw9WVse/tDFjVm6xaybxW7kYzd/Iqzb/04GHG75Q d79G2RFOlNubTuP5oDpOEzfAmuHU2g48thwft+BKea30XT+d35oxYq37fmnFBe3h KuzM4EpV5X1TJULF1XIZMGx4vVwnMdJ5B/x3IVy/LCdGNlV0tQpwoqjB93aHnuqS bfWx2ojTt/kqx7tDR9F5kdqw7VRgkFrDgzXRJQuSY+jDViUqJ9L8TB2V5pGQyBId SoCO/zLetmJKLTo98sZPUPT+na9et6qlpv2uEj2mzf7uVKPhjtOOX61cwfJLUXy1 MIBeT4xQCHcQLIAl9r1zJzHHBBn0U4UZT0XrQoqRPkhZaNOEcTcQl5sewF7vQDJw SW3oy5B4jwpZ5U0NsSKHjp4pAufg/NfsOU4g8JL6L0qA4OXM0kU= =1QbA -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S-- From owner-svn-src-head@freebsd.org Tue Aug 27 21:27:18 2019 Return-Path: Delivered-To: svn-src-head@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 93F8FC835F; Tue, 27 Aug 2019 21:27:18 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46J25L3BW6z4MdP; Tue, 27 Aug 2019 21:27:17 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 56D82220A7; Tue, 27 Aug 2019 17:27:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 27 Aug 2019 17:27:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=U XcEkHr1ApfNEEzlOWdbaPubBAY0CQVg6uoL2durN6w=; b=KbkNkQ1fTk6hdw4qO ICmk4VPbXQB4SJilMEmiBIx91UcfvQPL6DfHZ/7LPu4k16zUqL8SF4UXOy+k2Hkr jKuZ357em8LwAyZZOTdUiAo6r0MAnR2f45C7I3Ewuv4OrzrXXkusqeU4tIv7eYlO l6LbuYyH32SaMX9UpcOWCpiSDkJRF0K4DUoBjIpZW9UBuWctplslb5pi+Kug2iHY e/xwxwhD/+SUf+TeqlNATLlsZAMsUcdfxuvrhoOgGMJGrEf3IEtfT9zjVfXA/o52 hauyY92J6a+enxlczdC5eEx0caJPRkkhf9UV4nrMplK6m8tg0bv3kvfd9FKTGgiD iQHJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm3; bh=UXcEkHr1ApfNEEzlOWdbaPubBAY0CQVg6uoL2durN 6w=; b=ZX8GmmZ7aOLOdgVEN6heVWBXKW8GEk3LZEEkkH+NnrFlwJXmtLej5C2Sq glDAe7AZYajG7tr9BztlTfN/FTXbgLPoV+X4s/I5mpXC+rTcodjQIBBtP+s93b4O p/6WehUIELnbQIhsNFP4nJZBPO06cGEEx2aFdKco4Lc2ZdldcgZFE/0D3OlDnW9Q 0LOKPV9V9aXZ8y4T0C60CF3SDn/BPQgXMcbGKjcl0Um+LAjmuE3J+VQCEJVri5Pr XR82XRBbpwjECDSDpUhAQ1IvUqukJp7hoYkihXSSkB15EqkBnq1m1eGgjQwuA2lv f5emxRXcaBLbDLG4w8NdEpcvaQDkQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudehkedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppeekrd egiedrkeelrddvudefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehstghothhtlhesshgr mhhstghordhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D5F980059; Tue, 27 Aug 2019 17:27:16 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r351550 - head/sys/cam/scsi From: Scott Long In-Reply-To: <3c2aa0be-3d42-881e-87e1-675499a7bc5f@FreeBSD.org> Date: Tue, 27 Aug 2019 15:27:15 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201908271641.x7RGf6LC075849@repo.freebsd.org> <99271565-F168-48C8-90E0-749417C7C974@samsco.org> <3c2aa0be-3d42-881e-87e1-675499a7bc5f@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46J25L3BW6z4MdP X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.948,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 21:27:18 -0000 Excellent work, thank you! Scott > On Aug 27, 2019, at 2:57 PM, Alexander Motin wrote: >=20 > Some FreeNAS user reported panic after updating to newer version. On > the screenshot provided were several BUSY statuses for SATA disk on > mps(4), followed by panic "Attempt to remove out-of-bounds index -1 = from > queue ...". In his case I blame ancient LSI firmware or some broken > hardware, but I was able to reproduce the panic on FreeBSD head debug > kernel by hacking mps(4) driver to always report BUSY (appeared except > IDENTIFY and REPORT LUNS). To diagnose it I inserted assertion into > xpt_free_ccb(), checking ccb->ccb_h.pinfo.index for values used for > requests still in send queue. Not sure it is to be persistent, but in > this case it lead me directly to this place. >=20 > On 27.08.2019 16:23, Scott Long wrote: >> This is very concerning, and I wonder if it=E2=80=99s the cause of = the mystery use-after-free / double-complete that I=E2=80=99ve seen for = years and have never been able to catch. Can you say more about how you = found it? >>=20 >> Scott >>=20 >>=20 >>> On Aug 27, 2019, at 10:41 AM, Alexander Motin = wrote: >>>=20 >>> Author: mav >>> Date: Tue Aug 27 16:41:06 2019 >>> New Revision: 351550 >>> URL: https://svnweb.freebsd.org/changeset/base/351550 >>>=20 >>> Log: >>> Always check cam_periph_error() status for ERESTART. >>>=20 >>> Even if we do not expect retries, we better be sure, since otherwise = it >>> may result in use after free kernel panic. I've noticed that it = retries >>> SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY. >>>=20 >>> MFC after: 1 week >>> Sponsored by: iXsystems, Inc. >>>=20 >>> Modified: >>> head/sys/cam/scsi/scsi_xpt.c >>>=20 >>> Modified: head/sys/cam/scsi/scsi_xpt.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 15:42:08 2019 = (r351549) >>> +++ head/sys/cam/scsi/scsi_xpt.c Tue Aug 27 16:41:06 2019 = (r351550) >>> @@ -1684,8 +1684,9 @@ probe_device_check: >>> case PROBE_TUR_FOR_NEGOTIATION: >>> case PROBE_DV_EXIT: >>> if (cam_ccb_status(done_ccb) !=3D CAM_REQ_CMP) { >>> - cam_periph_error(done_ccb, 0, >>> - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); >>> + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | >>> + SF_NO_RECOVERY | SF_NO_RETRY) =3D=3D = ERESTART) >>> + goto outr; >>> } >>> if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) !=3D 0) { >>> /* Don't wedge the queue */ >>> @@ -1735,8 +1736,9 @@ probe_device_check: >>> struct ccb_scsiio *csio; >>>=20 >>> if (cam_ccb_status(done_ccb) !=3D CAM_REQ_CMP) { >>> - cam_periph_error(done_ccb, 0, >>> - SF_NO_PRINT | SF_NO_RECOVERY | SF_NO_RETRY); >>> + if (cam_periph_error(done_ccb, 0, SF_NO_PRINT | >>> + SF_NO_RECOVERY | SF_NO_RETRY) =3D=3D = ERESTART) >>> + goto outr; >>> } >>> if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) !=3D 0) { >>> /* Don't wedge the queue */ >>>=20 >>=20 >=20 > --=20 > Alexander Motin >=20 From owner-svn-src-head@freebsd.org Tue Aug 27 21:29:38 2019 Return-Path: Delivered-To: svn-src-head@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 64C74C8434; Tue, 27 Aug 2019 21:29:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46J28223cjz4Mnm; Tue, 27 Aug 2019 21:29:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2863524DEC; Tue, 27 Aug 2019 21:29:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RLTcuI045350; Tue, 27 Aug 2019 21:29:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RLTcT6045349; Tue, 27 Aug 2019 21:29:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908272129.x7RLTcT6045349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Aug 2019 21:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351557 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 351557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 21:29:38 -0000 Author: jhb Date: Tue Aug 27 21:29:37 2019 New Revision: 351557 URL: https://svnweb.freebsd.org/changeset/base/351557 Log: Adjust the deprecated warnings for /dev/crypto to be less noisy. Warn when actual operations are performed instead of when sessions are created. The /dev/crypto engine in OpenSSL 1.0.x tries to create sessions for all possible algorithms each time it is initialized resulting in spurious warnings. Reported by: Mike Tancsa MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Aug 27 20:51:17 2019 (r351556) +++ head/sys/opencrypto/cryptodev.c Tue Aug 27 21:29:37 2019 (r351557) @@ -391,8 +391,6 @@ cryptof_ioctl( struct crypt_op copc; struct crypt_kop kopc; #endif - static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; - static struct timeval skipwarn, tdeswarn; switch (cmd) { case CIOCGSESSION: @@ -413,28 +411,18 @@ cryptof_ioctl( case 0: break; case CRYPTO_DES_CBC: - if (ratecheck(&deswarn, &warninterval)) - gone_in(13, "DES cipher via /dev/crypto"); txform = &enc_xform_des; break; case CRYPTO_3DES_CBC: - if (ratecheck(&tdeswarn, &warninterval)) - gone_in(13, "3DES cipher via /dev/crypto"); txform = &enc_xform_3des; break; case CRYPTO_BLF_CBC: - if (ratecheck(&blfwarn, &warninterval)) - gone_in(13, "Blowfish cipher via /dev/crypto"); txform = &enc_xform_blf; break; case CRYPTO_CAST_CBC: - if (ratecheck(&castwarn, &warninterval)) - gone_in(13, "CAST128 cipher via /dev/crypto"); txform = &enc_xform_cast5; break; case CRYPTO_SKIPJACK_CBC: - if (ratecheck(&skipwarn, &warninterval)) - gone_in(13, "Skipjack cipher via /dev/crypto"); txform = &enc_xform_skipjack; break; case CRYPTO_AES_CBC: @@ -447,8 +435,6 @@ cryptof_ioctl( txform = &enc_xform_null; break; case CRYPTO_ARC4: - if (ratecheck(&arc4warn, &warninterval)) - gone_in(13, "ARC4 cipher via /dev/crypto"); txform = &enc_xform_arc4; break; case CRYPTO_CAMELLIA_CBC: @@ -477,9 +463,6 @@ cryptof_ioctl( case 0: break; case CRYPTO_MD5_HMAC: - if (ratecheck(&md5warn, &warninterval)) - gone_in(13, - "MD5-HMAC authenticator via /dev/crypto"); thash = &auth_hash_hmac_md5; break; case CRYPTO_POLY1305: @@ -815,6 +798,47 @@ cod_free(struct cryptop_data *cod) free(cod, M_XDATA); } +static void +cryptodev_warn(struct csession *cse) +{ + static struct timeval arc4warn, blfwarn, castwarn, deswarn, md5warn; + static struct timeval skipwarn, tdeswarn; + + switch (cse->cipher) { + case CRYPTO_DES_CBC: + if (ratecheck(&deswarn, &warninterval)) + gone_in(13, "DES cipher via /dev/crypto"); + break; + case CRYPTO_3DES_CBC: + if (ratecheck(&tdeswarn, &warninterval)) + gone_in(13, "3DES cipher via /dev/crypto"); + break; + case CRYPTO_BLF_CBC: + if (ratecheck(&blfwarn, &warninterval)) + gone_in(13, "Blowfish cipher via /dev/crypto"); + break; + case CRYPTO_CAST_CBC: + if (ratecheck(&castwarn, &warninterval)) + gone_in(13, "CAST128 cipher via /dev/crypto"); + break; + case CRYPTO_SKIPJACK_CBC: + if (ratecheck(&skipwarn, &warninterval)) + gone_in(13, "Skipjack cipher via /dev/crypto"); + break; + case CRYPTO_ARC4: + if (ratecheck(&arc4warn, &warninterval)) + gone_in(13, "ARC4 cipher via /dev/crypto"); + break; + } + + switch (cse->mac) { + case CRYPTO_MD5_HMAC: + if (ratecheck(&md5warn, &warninterval)) + gone_in(13, "MD5-HMAC authenticator via /dev/crypto"); + break; + } +} + static int cryptodev_op( struct csession *cse, @@ -937,6 +961,7 @@ cryptodev_op( error = EINVAL; goto bail; } + cryptodev_warn(cse); again: /* @@ -1106,6 +1131,7 @@ cryptodev_aead( SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } + cryptodev_warn(cse); again: /* * Let the dispatch run unlocked, then, interlock against the From owner-svn-src-head@freebsd.org Tue Aug 27 22:21:19 2019 Return-Path: Delivered-To: svn-src-head@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 AFA6AC9B38; Tue, 27 Aug 2019 22:21:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46J3Hg47gkz4Qf0; Tue, 27 Aug 2019 22:21:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7064E25846; Tue, 27 Aug 2019 22:21:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7RMLJoY078993; Tue, 27 Aug 2019 22:21:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7RMLJi0078992; Tue, 27 Aug 2019 22:21:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908272221.x7RMLJi0078992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Aug 2019 22:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351558 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 22:21:19 -0000 Author: jhb Date: Tue Aug 27 22:21:18 2019 New Revision: 351558 URL: https://svnweb.freebsd.org/changeset/base/351558 Log: Only define the 'tls' member of sfio in KERN_TLS is defined. This field was not initialized in the !KERN_TLS case triggering an assertion failure when using sendfile(2). Reported by: pho, asomers Sponsored by: Netflix Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Aug 27 21:29:37 2019 (r351557) +++ head/sys/kern/kern_sendfile.c Tue Aug 27 22:21:18 2019 (r351558) @@ -88,7 +88,9 @@ struct sf_io { int npages; struct socket *so; struct mbuf *m; +#ifdef KERN_TLS struct ktls_session *tls; +#endif vm_page_t pa[]; }; @@ -266,7 +268,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i if (!refcount_release(&sfio->nios)) return; -#ifdef INVARIANTS +#if defined(KERN_TLS) && defined(INVARIANTS) if ((sfio->m->m_flags & M_EXT) != 0 && sfio->m->m_ext.ext_type == EXT_PGS) KASSERT(sfio->tls == sfio->m->m_ext.ext_pgs->tls, From owner-svn-src-head@freebsd.org Tue Aug 27 22:21:46 2019 Return-Path: Delivered-To: svn-src-head@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 3EE28C9BA7; Tue, 27 Aug 2019 22:21:46 +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 46J3JB0zvtz4Qnd; Tue, 27 Aug 2019 22:21:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.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 8642D9952; Tue, 27 Aug 2019 22:21:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r351522 - in head: sbin/ifconfig share/man/man4 sys/conf sys/kern sys/modules sys/modules/ktls_ocf sys/net sys/netinet sys/netinet/tcp_stacks sys/netinet6 sys/opencrypto sys/sys tools/t... From: John Baldwin To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908270001.x7R01vUB052426@repo.freebsd.org> <20190827143953.GA5092@x8.osted.lan> <6f06637f-6486-bd2c-eebe-f14924e11e38@FreeBSD.org> <20190827170527.GA7111@x8.osted.lan> <1bfccef6-8cc2-328b-f97f-66d8aa5437a3@FreeBSD.org> 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: <90c539c5-ef5b-581c-ce2e-039657769e51@FreeBSD.org> Date: Tue, 27 Aug 2019 15:21:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1bfccef6-8cc2-328b-f97f-66d8aa5437a3@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2019 22:21:46 -0000 On 8/27/19 12:16 PM, John Baldwin wrote: > On 8/27/19 10:05 AM, Peter Holm wrote: >> On Tue, Aug 27, 2019 at 09:02:31AM -0700, John Baldwin wrote: >>> On 8/27/19 7:39 AM, Peter Holm wrote: >>>> On Tue, Aug 27, 2019 at 12:01:57AM +0000, John Baldwin wrote: >>>>> Author: jhb >>>>> Date: Tue Aug 27 00:01:56 2019 >>>>> New Revision: 351522 >>>>> URL: https://svnweb.freebsd.org/changeset/base/351522 >>>>> >>>>> Log: >>>>> Add kernel-side support for in-kernel TLS. >>>>> >>>> >>>> Could this be yours? >>>> >>>> 20190827 15:55:34 all (496/668): sendfile12.sh >>>> Aug 27 15:56:16 mercat1 kernel: pid 50036 (swap), jid 0, uid 0, was killed: out of swap space >>>> panic: non-ext_pgs mbuf with TLS session >>> >>> Possibly, though if sfio was freed and marked with 0xdeadc0de junk, then it >>> would trip over this assertion for any use-after-free. I see in gdb that you >>> couldn't see sfio because of clang's poor debug info. It would be really good >>> to try to find the contents of sfio to debug this further. >>> >>> You should be able to find it via 'bp->b_caller1' in frame 14: >>> >>> 'p *(struct sf_io *)bp->b_caller1' >>> >> >> Here's a repeat where the involved files are compiled with "-O0": >> https://people.freebsd.org/~pho/stress/log/jhb009.txt > > Ok, it looks like sfio->tls is just not being initialized to NULL in the > !KERN_TLS case and the malloc junk is leaking through (my fault): > > (kgdb) p *(struct sf_io *)bp->b_caller1 > $5 = {nios = 0x0, error = 0x0, npages = 0x1, so = 0xfffff808898d0000, m = 0xfffff808a3512200, tls = 0xdeadc0dedeadc0de, pa = 0xfffff804e6cdfc68} > > Initially I thought about using M_ZERO, but we can just axe the 'tls' > member of 'sfio' entirely in the !KERN_TLS case since it's a private > structure. > > Try this (untested) change): I was able to verify this via Alan's test and have committed it. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Aug 28 01:22:22 2019 Return-Path: Delivered-To: svn-src-head@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 03472CCD15; Wed, 28 Aug 2019 01:22:22 +0000 (UTC) (envelope-from mjg@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 46J7JY6FpQz4Ylj; Wed, 28 Aug 2019 01:22:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B862427923; Wed, 28 Aug 2019 01:22:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7S1MLeH089013; Wed, 28 Aug 2019 01:22:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7S1MLjT089011; Wed, 28 Aug 2019 01:22:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908280122.x7S1MLjT089011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 01:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351559 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 351559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 01:22:22 -0000 Author: mjg Date: Wed Aug 28 01:22:21 2019 New Revision: 351559 URL: https://svnweb.freebsd.org/changeset/base/351559 Log: proc: remove zpfind It is not used by anything. If someone wants it back it should be reimplemented to use the proc hash. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Aug 27 22:21:18 2019 (r351558) +++ head/sys/kern/kern_proc.c Wed Aug 28 01:22:21 2019 (r351559) @@ -1294,25 +1294,6 @@ pstats_free(struct pstats *ps) free(ps, M_SUBPROC); } -/* - * Locate a zombie process by number - */ -struct proc * -zpfind(pid_t pid) -{ - struct proc *p; - - sx_slock(&zombproc_lock); - LIST_FOREACH(p, &zombproc, p_list) { - if (p->p_pid == pid) { - PROC_LOCK(p); - break; - } - } - sx_sunlock(&zombproc_lock); - return (p); -} - #ifdef COMPAT_FREEBSD32 /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Aug 27 22:21:18 2019 (r351558) +++ head/sys/sys/proc.h Wed Aug 28 01:22:21 2019 (r351559) @@ -994,7 +994,6 @@ struct proc *pfind(pid_t); /* Find process by id. */ struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ struct proc *pfind_any_locked(pid_t pid); /* Find process by id, locked. */ struct pgrp *pgfind(pid_t); /* Find process group by id. */ -struct proc *zpfind(pid_t); /* Find zombie process by id. */ void pidhash_slockall(void); /* Shared lock all pid hash lists. */ void pidhash_sunlockall(void); /* Shared unlock all pid hash lists. */ From owner-svn-src-head@freebsd.org Wed Aug 28 04:19:38 2019 Return-Path: Delivered-To: svn-src-head@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 23C1BD0919; Wed, 28 Aug 2019 04:19:38 +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 46JCF574gyz3DG2; Wed, 28 Aug 2019 04:19:37 +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 BD0E418DF; Wed, 28 Aug 2019 04:19:37 +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 x7S4JbNG095817; Wed, 28 Aug 2019 04:19:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7S4JbW5095814; Wed, 28 Aug 2019 04:19:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908280419.x7S4JbW5095814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 28 Aug 2019 04:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351560 - in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 351560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 04:19:38 -0000 Author: asomers Date: Wed Aug 28 04:19:37 2019 New Revision: 351560 URL: https://svnweb.freebsd.org/changeset/base/351560 Log: fusefs: Fix some bugs regarding the size of the LISTXATTR list * A small error in r338152 let to the returned size always being exactly eight bytes too large. * The FUSE_LISTXATTR operation works like Linux's listxattr(2): if the caller does not provide enough space, then the server should return ERANGE rather than return a truncated list. That's true even though in FUSE's case the kernel doesn't provide space to the client at all; it simply requests a maximum size for the list. We previously weren't handling the case where the server returns ERANGE even though the kernel requested as much size as the server had told us it needs; that can happen due to a race. * We also need to ensure that a pathological server that always returns ERANGE no matter what size we request in FUSE_LISTXATTR won't cause an infinite loop in the kernel. As of this commit, it will instead cause an infinite loop that exits and enters the kernel on each iteration, allowing signals to be processed. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21287 Modified: head/sys/fs/fuse/fuse_vnops.c head/tests/sys/fs/fusefs/mockfs.cc head/tests/sys/fs/fusefs/xattr.cc Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Aug 28 01:22:21 2019 (r351559) +++ head/sys/fs/fuse/fuse_vnops.c Wed Aug 28 04:19:37 2019 (r351560) @@ -2225,6 +2225,20 @@ fuse_xattrlist_convert(char *prefix, const char *list, } /* + * List extended attributes + * + * The FUSE_LISTXATTR operation is based on Linux's listxattr(2) syscall, which + * has a number of differences compared to its FreeBSD equivalent, + * extattr_list_file: + * + * - FUSE_LISTXATTR returns all extended attributes across all namespaces, + * whereas listxattr(2) only returns attributes for a single namespace + * - FUSE_LISTXATTR prepends each attribute name with "namespace." + * - If the provided buffer is not large enough to hold the result, + * FUSE_LISTXATTR should return ERANGE, whereas listxattr is expected to + * return as many results as will fit. + */ +/* struct vop_listextattr_args { struct vop_generic_args a_gen; struct vnode *a_vp; @@ -2303,14 +2317,31 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap) */ fdisp_refresh_vp(&fdi, FUSE_LISTXATTR, vp, td, cred); list_xattr_in = fdi.indata; - list_xattr_in->size = linux_list_len + sizeof(*list_xattr_out); + list_xattr_in->size = linux_list_len; err = fdisp_wait_answ(&fdi); - if (err != 0) + if (err == ERANGE) { + /* + * Race detected. The attribute list must've grown since the + * first FUSE_LISTXATTR call. Start over. Go all the way back + * to userland so we can process signals, if necessary, before + * restarting. + */ + err = ERESTART; goto out; + } else if (err != 0) + goto out; linux_list = fdi.answ; - linux_list_len = fdi.iosize; + /* FUSE doesn't allow the server to return more data than requested */ + if (fdi.iosize > linux_list_len) { + printf("WARNING: FUSE protocol violation. Server returned " + "more extended attribute data than requested; " + "should've returned ERANGE instead"); + } else { + /* But returning less data is fine */ + linux_list_len = fdi.iosize; + } /* * Retrieve the BSD compatible list values. Modified: head/tests/sys/fs/fusefs/mockfs.cc ============================================================================== --- head/tests/sys/fs/fusefs/mockfs.cc Wed Aug 28 01:22:21 2019 (r351559) +++ head/tests/sys/fs/fusefs/mockfs.cc Wed Aug 28 04:19:37 2019 (r351560) @@ -204,6 +204,9 @@ void MockFS::debug_request(const mockfs_buf_in &in) case FUSE_LINK: printf(" oldnodeid=%" PRIu64, in.body.link.oldnodeid); break; + case FUSE_LISTXATTR: + printf(" size=%" PRIu32, in.body.listxattr.size); + break; case FUSE_LOOKUP: printf(" %s", in.body.lookup); break; Modified: head/tests/sys/fs/fusefs/xattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/xattr.cc Wed Aug 28 01:22:21 2019 (r351559) +++ head/tests/sys/fs/fusefs/xattr.cc Wed Aug 28 04:19:37 2019 (r351560) @@ -35,6 +35,9 @@ extern "C" { #include #include +#include +#include +#include #include } @@ -45,7 +48,18 @@ using namespace testing; const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; +static sem_t killer_semaphore; +void* killer(void* target) { + pid_t pid = *(pid_t*)target; + sem_wait(&killer_semaphore); + if (verbosity > 1) + printf("Killing! pid %d\n", pid); + kill(pid, SIGINT); + + return(NULL); +} + class Xattr: public FuseTest { public: void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) @@ -62,17 +76,31 @@ void expect_getxattr(uint64_t ino, const char *attr, P ).WillOnce(Invoke(r)); } -void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r) +void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, + Sequence *seq = NULL) { - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_LISTXATTR && - in.header.nodeid == ino && - in.body.listxattr.size == size); - }, Eq(true)), - _) - ).WillOnce(Invoke(r)) - .RetiresOnSaturation(); + if (seq == NULL) { + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LISTXATTR && + in.header.nodeid == ino && + in.body.listxattr.size == size); + }, Eq(true)), + _) + ).WillOnce(Invoke(r)) + .RetiresOnSaturation(); + } else { + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LISTXATTR && + in.header.nodeid == ino && + in.body.listxattr.size == size); + }, Eq(true)), + _) + ).InSequence(*seq) + .WillOnce(Invoke(r)) + .RetiresOnSaturation(); + } } void expect_removexattr(uint64_t ino, const char *attr, int error) @@ -108,7 +136,37 @@ void expect_setxattr(uint64_t ino, const char *attr, c }; class Getxattr: public Xattr {}; + class Listxattr: public Xattr {}; + +/* Listxattr tests that need to use a signal */ +class ListxattrSig: public Listxattr { +public: +pthread_t m_killer_th; +pid_t m_child; + +void SetUp() { + /* + * Mount with -o nointr so the mount can't get interrupted while + * waiting for a response from the server + */ + m_nointr = true; + FuseTest::SetUp(); + + ASSERT_EQ(0, sem_init(&killer_semaphore, 0, 0)) << strerror(errno); +} + +void TearDown() { + if (m_killer_th != NULL) { + pthread_join(m_killer_th, NULL); + } + + sem_destroy(&killer_semaphore); + + FuseTest::TearDown(); +} +}; + class Removexattr: public Xattr {}; class Setxattr: public Xattr {}; class RofsXattr: public Xattr { @@ -175,6 +233,7 @@ TEST_F(Getxattr, enosys) * behavior. * * This test case covers a filesystem that uses the Linux behavior + * TODO: require FreeBSD Behavior. */ TEST_F(Getxattr, erange) { @@ -300,29 +359,111 @@ TEST_F(Listxattr, enotsup) } /* - * On FreeBSD, if the user passes an insufficiently large buffer then the - * filesystem is supposed to copy as much of the attribute's value as will fit. + * On FreeBSD, if the user passes an insufficiently large buffer to + * extattr_list_file(2) or VOP_LISTEXTATTR(9), then the file system is supposed + * to copy as much of the attribute's value as will fit. * - * On Linux, however, the filesystem is supposed to return ERANGE. + * On Linux, however, the file system is supposed to return ERANGE if an + * insufficiently large buffer is passed to listxattr(2). * - * libfuse specifies the Linux behavior. However, that's probably an error. - * It would probably be correct for the filesystem to use platform-dependent - * behavior. - * - * This test case covers a filesystem that uses the Linux behavior + * fusefs(5) must guarantee the usual FreeBSD behavior. */ TEST_F(Listxattr, erange) { uint64_t ino = 42; int ns = EXTATTR_NAMESPACE_USER; + char attrs[9] = "user.foo"; + char expected[3] = {3, 'f', 'o'}; + char buf[3]; expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - expect_listxattr(ino, 0, ReturnErrno(ERANGE)); + expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) + { + out.body.listxattr.size = sizeof(attrs); + SET_OUT_HEADER_LEN(out, listxattr); + })); + expect_listxattr(ino, sizeof(attrs), + ReturnImmediate([&](auto in __unused, auto& out) { + memcpy((void*)out.body.bytes, attrs, sizeof(attrs)); + out.header.len = sizeof(fuse_out_header) + sizeof(attrs); + })); - ASSERT_EQ(-1, extattr_list_file(FULLPATH, ns, NULL, 0)); - ASSERT_EQ(ERANGE, errno); + + ASSERT_EQ(static_cast(sizeof(buf)), + extattr_list_file(FULLPATH, ns, buf, sizeof(buf))); + ASSERT_EQ(0, memcmp(expected, buf, sizeof(buf))); } +/* + * A buggy or malicious file system always returns ERANGE, even if we pass an + * appropriately sized buffer. That will send the kernel into an infinite + * loop. This test will ensure that the loop is interruptible by killing the + * blocked process with SIGINT. + */ +TEST_F(ListxattrSig, erange_forever) +{ + uint64_t ino = 42; + uint32_t lie_size = 10; + int status; + + fork(false, &status, [&] { + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillRepeatedly(Invoke( + ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = S_IFREG | 0644; + out.body.entry.nodeid = ino; + out.body.entry.attr.nlink = 1; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = UINT64_MAX; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LISTXATTR && + in.header.nodeid == ino && + in.body.listxattr.size == 0); + }, Eq(true)), + _) + ).WillRepeatedly(ReturnImmediate([=](auto i __unused, auto& out) + { + /* The file system requests 10 bytes, but it's a lie */ + out.body.listxattr.size = lie_size; + SET_OUT_HEADER_LEN(out, listxattr); + /* + * We can send the signal any time after fusefs enters + * VOP_LISTEXTATTR + */ + sem_post(&killer_semaphore); + })); + /* + * Even though the kernel faithfully respects our size request, + * we'll return ERANGE anyway. + */ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LISTXATTR && + in.header.nodeid == ino && + in.body.listxattr.size == lie_size); + }, Eq(true)), + _) + ).WillRepeatedly(ReturnErrno(ERANGE)); + + ASSERT_EQ(0, pthread_create(&m_killer_th, NULL, killer, + &m_mock->m_child_pid)) + << strerror(errno); + + }, [] { + /* Child process will block until it gets signaled */ + int ns = EXTATTR_NAMESPACE_USER; + char buf[3]; + extattr_list_file(FULLPATH, ns, buf, sizeof(buf)); + return 0; + } + ); + + ASSERT_TRUE(WIFSIGNALED(status)); +} + /* * Get the size of the list that it would take to list no extended attributes */ @@ -351,21 +492,20 @@ TEST_F(Listxattr, size_only_nonempty) { uint64_t ino = 42; int ns = EXTATTR_NAMESPACE_USER; + char attrs[9] = "user.foo"; expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) { - out.body.listxattr.size = 45; + expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) + { + out.body.listxattr.size = sizeof(attrs); SET_OUT_HEADER_LEN(out, listxattr); })); - // TODO: fix the expected size after fixing the size calculation bug in - // fuse_vnop_listextattr. It should be exactly 45. - expect_listxattr(ino, 53, - ReturnImmediate([](auto in __unused, auto& out) { - const char l[] = "user.foo"; - strlcpy((char*)out.body.bytes, l, - sizeof(out.body.bytes)); - out.header.len = sizeof(fuse_out_header) + sizeof(l); + expect_listxattr(ino, sizeof(attrs), + ReturnImmediate([=](auto in __unused, auto& out) { + size_t l = sizeof(attrs); + strlcpy((char*)out.body.bytes, attrs, l); + out.header.len = sizeof(fuse_out_header) + l; }) ); @@ -373,6 +513,88 @@ TEST_F(Listxattr, size_only_nonempty) << strerror(errno); } +/* + * The list of extended attributes grows in between the server's two calls to + * FUSE_LISTXATTR. + */ +TEST_F(Listxattr, size_only_race_bigger) +{ + uint64_t ino = 42; + int ns = EXTATTR_NAMESPACE_USER; + char attrs0[9] = "user.foo"; + char attrs1[18] = "user.foo\0user.bar"; + Sequence seq; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillRepeatedly(Invoke( + ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = S_IFREG | 0644; + out.body.entry.nodeid = ino; + out.body.entry.attr.nlink = 1; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = UINT64_MAX; + }))); + expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) + { + out.body.listxattr.size = sizeof(attrs0); + SET_OUT_HEADER_LEN(out, listxattr); + }), &seq); + + /* + * After the first FUSE_LISTXATTR the list grew, so the second + * operation returns ERANGE. + */ + expect_listxattr(ino, sizeof(attrs0), ReturnErrno(ERANGE), &seq); + + /* And now the kernel retries */ + expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) + { + out.body.listxattr.size = sizeof(attrs1); + SET_OUT_HEADER_LEN(out, listxattr); + }), &seq); + expect_listxattr(ino, sizeof(attrs1), + ReturnImmediate([&](auto in __unused, auto& out) { + memcpy((char*)out.body.bytes, attrs1, sizeof(attrs1)); + out.header.len = sizeof(fuse_out_header) + + sizeof(attrs1); + }), &seq + ); + + /* Userspace should never know about the retry */ + ASSERT_EQ(8, extattr_list_file(FULLPATH, ns, NULL, 0)) + << strerror(errno); +} + +/* + * The list of extended attributes shrinks in between the server's two calls to + * FUSE_LISTXATTR + */ +TEST_F(Listxattr, size_only_race_smaller) +{ + uint64_t ino = 42; + int ns = EXTATTR_NAMESPACE_USER; + char attrs0[18] = "user.foo\0user.bar"; + char attrs1[9] = "user.foo"; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); + expect_listxattr(ino, 0, ReturnImmediate([](auto i __unused, auto& out) + { + out.body.listxattr.size = sizeof(attrs0); + SET_OUT_HEADER_LEN(out, listxattr); + })); + expect_listxattr(ino, sizeof(attrs0), + ReturnImmediate([&](auto in __unused, auto& out) { + strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1)); + out.header.len = sizeof(fuse_out_header) + + sizeof(attrs1); + }) + ); + + ASSERT_EQ(4, extattr_list_file(FULLPATH, ns, NULL, 0)) + << strerror(errno); +} + TEST_F(Listxattr, size_only_really_big) { uint64_t ino = 42; @@ -384,9 +606,7 @@ TEST_F(Listxattr, size_only_really_big) SET_OUT_HEADER_LEN(out, listxattr); })); - // TODO: fix the expected size after fixing the size calculation bug in - // fuse_vnop_listextattr. It should be exactly 16000. - expect_listxattr(ino, 16008, + expect_listxattr(ino, 16000, ReturnImmediate([](auto in __unused, auto& out) { const char l[16] = "user.foobarbang"; for (int i=0; i < 1000; i++) { @@ -420,9 +640,7 @@ TEST_F(Listxattr, user) }) ); - // TODO: fix the expected size after fixing the size calculation bug in - // fuse_vnop_listextattr. - expect_listxattr(ino, sizeof(attrs) + 8, + expect_listxattr(ino, sizeof(attrs), ReturnImmediate([&](auto in __unused, auto& out) { memcpy((void*)out.body.bytes, attrs, sizeof(attrs)); out.header.len = sizeof(fuse_out_header) + sizeof(attrs); @@ -454,9 +672,7 @@ TEST_F(Listxattr, system) }) ); - // TODO: fix the expected size after fixing the size calculation bug in - // fuse_vnop_listextattr. - expect_listxattr(ino, sizeof(attrs) + 8, + expect_listxattr(ino, sizeof(attrs), ReturnImmediate([&](auto in __unused, auto& out) { memcpy((void*)out.body.bytes, attrs, sizeof(attrs)); out.header.len = sizeof(fuse_out_header) + sizeof(attrs); From owner-svn-src-head@freebsd.org Wed Aug 28 04:54:26 2019 Return-Path: Delivered-To: svn-src-head@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 D5F92D14A5; Wed, 28 Aug 2019 04:54:26 +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 46JD1G51LDz3Fkg; Wed, 28 Aug 2019 04:54:26 +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 887CA2000; Wed, 28 Aug 2019 04:54:26 +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 x7S4sQ2n019049; Wed, 28 Aug 2019 04:54:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7S4sQn2019048; Wed, 28 Aug 2019 04:54:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908280454.x7S4sQn2019048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 28 Aug 2019 04:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351561 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 351561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 04:54:26 -0000 Author: cy Date: Wed Aug 28 04:54:26 2019 New Revision: 351561 URL: https://svnweb.freebsd.org/changeset/base/351561 Log: Fixup typo in comment. Obtained from: NetBSD ip_nat.c r1.7 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:19:37 2019 (r351560) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:54:26 2019 (r351561) @@ -3073,7 +3073,7 @@ ipf_nat_newrdr(fin, nat, ni) /* Attempts to create a new NAT entry. Does not actually change the packet */ /* in any way. */ /* */ -/* This fucntion is in three main parts: (1) deal with creating a new NAT */ +/* This function is in three main parts: (1) deal with creating a new NAT */ /* structure for a "MAP" rule (outgoing NAT translation); (2) deal with */ /* creating a new NAT structure for a "RDR" rule (incoming NAT translation) */ /* and (3) building that structure and putting it into the NAT table(s). */ From owner-svn-src-head@freebsd.org Wed Aug 28 04:55:04 2019 Return-Path: Delivered-To: svn-src-head@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 78D86D151C; Wed, 28 Aug 2019 04:55:04 +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 46JD202ZgNz3Fsd; Wed, 28 Aug 2019 04:55:04 +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 3A4CB2001; Wed, 28 Aug 2019 04:55:04 +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 x7S4t4xK019153; Wed, 28 Aug 2019 04:55:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7S4t4JC019152; Wed, 28 Aug 2019 04:55:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908280455.x7S4t4JC019152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 28 Aug 2019 04:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351562 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 351562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 04:55:04 -0000 Author: cy Date: Wed Aug 28 04:55:03 2019 New Revision: 351562 URL: https://svnweb.freebsd.org/changeset/base/351562 Log: Destroy the mutex in case of error. Obtained from: NetBSD ip_nat.c r1.7 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:54:26 2019 (r351561) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:55:03 2019 (r351562) @@ -3078,7 +3078,7 @@ ipf_nat_newrdr(fin, nat, ni) /* creating a new NAT structure for a "RDR" rule (incoming NAT translation) */ /* and (3) building that structure and putting it into the NAT table(s). */ /* */ -/* NOTE: natsave should NOT be used top point back to an ipstate_t struct */ +/* NOTE: natsave should NOT be used to point back to an ipstate_t struct */ /* as it can result in memory being corrupted. */ /* ------------------------------------------------------------------------ */ nat_t * @@ -3406,6 +3406,7 @@ ipf_nat_insert(softc, softn, nat) u_int hv0, hv1; u_int sp, dp; ipnat_t *in; + int ret; /* * Try and return an error as early as possible, so calculate the hash @@ -3488,7 +3489,10 @@ ipf_nat_insert(softc, softn, nat) nat->nat_mtu[1] = GETIFMTU_4(nat->nat_ifps[1]); } - return ipf_nat_hashtab_add(softc, softn, nat); + ret = ipf_nat_hashtab_add(softc, softn, nat); + if (ret == -1) + MUTEX_DESTROY(&nat->nat_lock); + return ret; } From owner-svn-src-head@freebsd.org Wed Aug 28 04:55:18 2019 Return-Path: Delivered-To: svn-src-head@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 7B9E8D1580; Wed, 28 Aug 2019 04:55:18 +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 46JD2G2hwBz3G1B; Wed, 28 Aug 2019 04:55:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F9382002; Wed, 28 Aug 2019 04:55:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7S4tIa8019207; Wed, 28 Aug 2019 04:55:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7S4tIYk019206; Wed, 28 Aug 2019 04:55:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908280455.x7S4tIYk019206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 28 Aug 2019 04:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351563 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 351563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 04:55:18 -0000 Author: cy Date: Wed Aug 28 04:55:17 2019 New Revision: 351563 URL: https://svnweb.freebsd.org/changeset/base/351563 Log: Document ipf_nat_hashtab_add() return codes. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:55:03 2019 (r351562) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Wed Aug 28 04:55:17 2019 (r351563) @@ -3498,6 +3498,7 @@ ipf_nat_insert(softc, softn, nat) /* ------------------------------------------------------------------------ */ /* Function: ipf_nat_hashtab_add */ +/* Returns: int - 0 == sucess, -1 == failure */ /* Parameters: softc(I) - pointer to soft context main structure */ /* softn(I) - pointer to NAT context structure */ /* nat(I) - pointer to NAT structure */ From owner-svn-src-head@freebsd.org Wed Aug 28 16:08:07 2019 Return-Path: Delivered-To: svn-src-head@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 9A9A3E04C8; Wed, 28 Aug 2019 16:08:07 +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 46JVyb3Wg0z4NDs; Wed, 28 Aug 2019 16:08:07 +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 6F8619C64; Wed, 28 Aug 2019 16:08:07 +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 x7SG87WH014600; Wed, 28 Aug 2019 16:08:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SG86Q3014596; Wed, 28 Aug 2019 16:08:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908281608.x7SG86Q3014596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Aug 2019 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351569 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 351569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 16:08:07 -0000 Author: markj Date: Wed Aug 28 16:08:06 2019 New Revision: 351569 URL: https://svnweb.freebsd.org/changeset/base/351569 Log: Wire pages in vm_page_grab() when appropriate. uiomove_object_page() and exec_map_first_page() would previously wire a page after having grabbed it. Ask vm_page_grab() to perform the wiring instead: this removes some redundant code, and is cheaper in the case where the requested page is not resident since the page allocator can be asked to initialize the page as wired, whereas a separate vm_page_wire() call requires the page lock. In vm_imgact_hold_page(), use vm_page_unwire_noq() instead of vm_page_unwire(PQ_NONE). The latter ensures that the page is dequeued before returning, but this is unnecessary since vm_page_free() will trigger a batched dequeue of the page. Reviewed by: alc, kib Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21440 Modified: head/sys/kern/kern_exec.c head/sys/kern/uipc_shm.c head/sys/vm/vm_glue.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Aug 28 08:09:10 2019 (r351568) +++ head/sys/kern/kern_exec.c Wed Aug 28 16:08:06 2019 (r351569) @@ -972,11 +972,13 @@ exec_map_first_page(struct image_params *imgp) #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif - ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); + ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED); if (ma[0]->valid != VM_PAGE_BITS_ALL) { vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { vm_page_lock(ma[0]); + vm_page_unwire_noq(ma[0]); vm_page_free(ma[0]); vm_page_unlock(ma[0]); VM_OBJECT_WUNLOCK(object); @@ -1004,6 +1006,8 @@ exec_map_first_page(struct image_params *imgp) if (rv != VM_PAGER_OK) { for (i = 0; i < initial_pagein; i++) { vm_page_lock(ma[i]); + if (i == 0) + vm_page_unwire_noq(ma[i]); vm_page_free(ma[i]); vm_page_unlock(ma[i]); } @@ -1014,9 +1018,6 @@ exec_map_first_page(struct image_params *imgp) for (i = 1; i < initial_pagein; i++) vm_page_readahead_finish(ma[i]); } - vm_page_lock(ma[0]); - vm_page_wire(ma[0]); - vm_page_unlock(ma[0]); VM_OBJECT_WUNLOCK(object); imgp->firstpage = sf_buf_alloc(ma[0], 0); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 28 08:09:10 2019 (r351568) +++ head/sys/kern/uipc_shm.c Wed Aug 28 16:08:06 2019 (r351569) @@ -188,7 +188,8 @@ uiomove_object_page(vm_object_t obj, size_t len, struc * lock to page out tobj's pages because tobj is a OBJT_SWAP * type object. */ - m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); + m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED); if (m->valid != VM_PAGE_BITS_ALL) { vm_page_xbusy(m); if (vm_pager_has_page(obj, idx, NULL, NULL)) { @@ -198,6 +199,7 @@ uiomove_object_page(vm_object_t obj, size_t len, struc "uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n", obj, idx, m->valid, rv); vm_page_lock(m); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); @@ -207,9 +209,6 @@ uiomove_object_page(vm_object_t obj, size_t len, struc vm_page_zero_invalid(m, TRUE); vm_page_xunbusy(m); } - vm_page_lock(m); - vm_page_wire(m); - vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); if (uio->uio_rw == UIO_WRITE && error == 0) { Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Aug 28 08:09:10 2019 (r351568) +++ head/sys/vm/vm_glue.c Wed Aug 28 16:08:06 2019 (r351569) @@ -230,7 +230,7 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t o rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(m); - vm_page_unwire(m, PQ_NONE); + vm_page_unwire_noq(m); vm_page_free(m); vm_page_unlock(m); m = NULL; From owner-svn-src-head@freebsd.org Wed Aug 28 16:18:25 2019 Return-Path: Delivered-To: svn-src-head@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 27043E08AB; Wed, 28 Aug 2019 16:18:25 +0000 (UTC) (envelope-from mjg@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 46JWBT09vWz4P25; Wed, 28 Aug 2019 16:18:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC8FD9E51; Wed, 28 Aug 2019 16:18:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SGIO27020778; Wed, 28 Aug 2019 16:18:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SGINF8020773; Wed, 28 Aug 2019 16:18:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908281618.x7SGINF8020773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 16:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351572 - in head/sys: ddb kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: ddb kern sys X-SVN-Commit-Revision: 351572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 16:18:25 -0000 Author: mjg Date: Wed Aug 28 16:18:23 2019 New Revision: 351572 URL: https://svnweb.freebsd.org/changeset/base/351572 Log: proc: eliminate the zombproc list It is not needed by anything in the kernel and it slightly drives up contention on both proctree and allproc locks. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21447 Modified: head/sys/ddb/db_ps.c head/sys/ddb/db_thread.c head/sys/kern/kern_exit.c head/sys/kern/kern_proc.c head/sys/kern/kern_racct.c head/sys/sys/proc.h Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/ddb/db_ps.c Wed Aug 28 16:18:23 2019 (r351572) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); static void dumpthread(volatile struct proc *p, volatile struct thread *td, int all); +static void db_ps_proc(struct proc *p); static int ps_mode; /* @@ -105,146 +106,157 @@ dump_args(volatile struct proc *p) void db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif) { - volatile struct proc *p, *pp; - volatile struct thread *td; - struct ucred *cred; - struct pgrp *pgrp; - char state[9]; - int np, rflag, sflag, dflag, lflag, wflag; + struct proc *p; + int i, j; ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; - np = nprocs; - if (!LIST_EMPTY(&allproc)) - p = LIST_FIRST(&allproc); - else - p = &proc0; - #ifdef __LP64__ db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #else db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #endif - while (--np >= 0 && !db_pager_quit) { - if (p == NULL) { - db_printf("oops, ran out of processes early!\n"); - break; + + if (!LIST_EMPTY(&allproc)) + p = LIST_FIRST(&allproc); + else + p = &proc0; + for (; p != NULL && !db_pager_quit; p = LIST_NEXT(p, p_list)) + db_ps_proc(p); + + /* + * Do zombies. + */ + for (i = 0; i < pidhashlock + 1 && !db_pager_quit; i++) { + for (j = i; j <= pidhash && !db_pager_quit; j += pidhashlock + 1) { + LIST_FOREACH(p, &pidhashtbl[j], p_hash) { + if (p->p_state == PRS_ZOMBIE) + db_ps_proc(p); + } } - pp = p->p_pptr; - if (pp == NULL) - pp = p; + } +} - cred = p->p_ucred; - pgrp = p->p_pgrp; - db_printf("%5d %5d %5d %5d ", p->p_pid, pp->p_pid, - pgrp != NULL ? pgrp->pg_id : 0, - cred != NULL ? cred->cr_ruid : 0); +static void +db_ps_proc(struct proc *p) +{ + volatile struct proc *pp; + volatile struct thread *td; + struct ucred *cred; + struct pgrp *pgrp; + char state[9]; + int rflag, sflag, dflag, lflag, wflag; - /* Determine our primary process state. */ - switch (p->p_state) { - case PRS_NORMAL: - if (P_SHOULDSTOP(p)) - state[0] = 'T'; - else { - /* - * One of D, L, R, S, W. For a - * multithreaded process we will use - * the state of the thread with the - * highest precedence. The - * precendence order from high to low - * is R, L, D, S, W. If no thread is - * in a sane state we use '?' for our - * primary state. - */ - rflag = sflag = dflag = lflag = wflag = 0; - FOREACH_THREAD_IN_PROC(p, td) { - if (td->td_state == TDS_RUNNING || - td->td_state == TDS_RUNQ || - td->td_state == TDS_CAN_RUN) - rflag++; - if (TD_ON_LOCK(td)) - lflag++; - if (TD_IS_SLEEPING(td)) { - if (!(td->td_flags & TDF_SINTR)) - dflag++; - else - sflag++; - } - if (TD_AWAITING_INTR(td)) - wflag++; + pp = p->p_pptr; + if (pp == NULL) + pp = p; + + cred = p->p_ucred; + pgrp = p->p_pgrp; + db_printf("%5d %5d %5d %5d ", p->p_pid, pp->p_pid, + pgrp != NULL ? pgrp->pg_id : 0, + cred != NULL ? cred->cr_ruid : 0); + + /* Determine our primary process state. */ + switch (p->p_state) { + case PRS_NORMAL: + if (P_SHOULDSTOP(p)) + state[0] = 'T'; + else { + /* + * One of D, L, R, S, W. For a + * multithreaded process we will use + * the state of the thread with the + * highest precedence. The + * precendence order from high to low + * is R, L, D, S, W. If no thread is + * in a sane state we use '?' for our + * primary state. + */ + rflag = sflag = dflag = lflag = wflag = 0; + FOREACH_THREAD_IN_PROC(p, td) { + if (td->td_state == TDS_RUNNING || + td->td_state == TDS_RUNQ || + td->td_state == TDS_CAN_RUN) + rflag++; + if (TD_ON_LOCK(td)) + lflag++; + if (TD_IS_SLEEPING(td)) { + if (!(td->td_flags & TDF_SINTR)) + dflag++; + else + sflag++; } - if (rflag) - state[0] = 'R'; - else if (lflag) - state[0] = 'L'; - else if (dflag) - state[0] = 'D'; - else if (sflag) - state[0] = 'S'; - else if (wflag) - state[0] = 'W'; - else - state[0] = '?'; + if (TD_AWAITING_INTR(td)) + wflag++; } - break; - case PRS_NEW: - state[0] = 'N'; - break; - case PRS_ZOMBIE: - state[0] = 'Z'; - break; - default: - state[0] = 'U'; - break; + if (rflag) + state[0] = 'R'; + else if (lflag) + state[0] = 'L'; + else if (dflag) + state[0] = 'D'; + else if (sflag) + state[0] = 'S'; + else if (wflag) + state[0] = 'W'; + else + state[0] = '?'; } - state[1] = '\0'; + break; + case PRS_NEW: + state[0] = 'N'; + break; + case PRS_ZOMBIE: + state[0] = 'Z'; + break; + default: + state[0] = 'U'; + break; + } + state[1] = '\0'; - /* Additional process state flags. */ - if (!(p->p_flag & P_INMEM)) - strlcat(state, "W", sizeof(state)); - if (p->p_flag & P_TRACED) - strlcat(state, "X", sizeof(state)); - if (p->p_flag & P_WEXIT && p->p_state != PRS_ZOMBIE) - strlcat(state, "E", sizeof(state)); - if (p->p_flag & P_PPWAIT) - strlcat(state, "V", sizeof(state)); - if (p->p_flag & P_SYSTEM || p->p_lock > 0) - strlcat(state, "L", sizeof(state)); - if (p->p_pgrp != NULL && p->p_session != NULL && - SESS_LEADER(p)) - strlcat(state, "s", sizeof(state)); - /* Cheated here and didn't compare pgid's. */ - if (p->p_flag & P_CONTROLT) - strlcat(state, "+", sizeof(state)); - if (cred != NULL && jailed(cred)) - strlcat(state, "J", sizeof(state)); - db_printf(" %-6.6s ", state); - if (p->p_flag & P_HADTHREADS) { + /* Additional process state flags. */ + if (!(p->p_flag & P_INMEM)) + strlcat(state, "W", sizeof(state)); + if (p->p_flag & P_TRACED) + strlcat(state, "X", sizeof(state)); + if (p->p_flag & P_WEXIT && p->p_state != PRS_ZOMBIE) + strlcat(state, "E", sizeof(state)); + if (p->p_flag & P_PPWAIT) + strlcat(state, "V", sizeof(state)); + if (p->p_flag & P_SYSTEM || p->p_lock > 0) + strlcat(state, "L", sizeof(state)); + if (p->p_pgrp != NULL && p->p_session != NULL && + SESS_LEADER(p)) + strlcat(state, "s", sizeof(state)); + /* Cheated here and didn't compare pgid's. */ + if (p->p_flag & P_CONTROLT) + strlcat(state, "+", sizeof(state)); + if (cred != NULL && jailed(cred)) + strlcat(state, "J", sizeof(state)); + db_printf(" %-6.6s ", state); + if (p->p_flag & P_HADTHREADS) { #ifdef __LP64__ - db_printf(" (threaded) "); + db_printf(" (threaded) "); #else - db_printf(" (threaded) "); + db_printf(" (threaded) "); #endif - if (p->p_flag & P_SYSTEM) - db_printf("["); - db_printf("%s", p->p_comm); - if (p->p_flag & P_SYSTEM) - db_printf("]"); - if (ps_mode == PRINT_ARGS) { - db_printf(" "); - dump_args(p); - } - db_printf("\n"); + if (p->p_flag & P_SYSTEM) + db_printf("["); + db_printf("%s", p->p_comm); + if (p->p_flag & P_SYSTEM) + db_printf("]"); + if (ps_mode == PRINT_ARGS) { + db_printf(" "); + dump_args(p); } - FOREACH_THREAD_IN_PROC(p, td) { - dumpthread(p, td, p->p_flag & P_HADTHREADS); - if (db_pager_quit) - break; - } - - p = LIST_NEXT(p, p_list); - if (p == NULL && np > 0) - p = LIST_FIRST(&zombproc); + db_printf("\n"); + } + FOREACH_THREAD_IN_PROC(p, td) { + dumpthread(p, td, p->p_flag & P_HADTHREADS); + if (db_pager_quit) + break; } } Modified: head/sys/ddb/db_thread.c ============================================================================== --- head/sys/ddb/db_thread.c Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/ddb/db_thread.c Wed Aug 28 16:18:23 2019 (r351572) @@ -125,14 +125,10 @@ db_lookup_thread(db_expr_t addr, bool check_pid) if (td != NULL) return (td); if (check_pid) { - FOREACH_PROC_IN_SYSTEM(p) { + LIST_FOREACH(p, PIDHASH(decaddr), p_hash) { if (p->p_pid == decaddr) return (FIRST_THREAD_IN_PROC(p)); } - LIST_FOREACH(p, &zombproc, p_list) { - if (p->p_pid == decaddr) - return (FIRST_THREAD_IN_PROC(p)); - } } return ((struct thread *)addr); } @@ -151,11 +147,7 @@ db_lookup_proc(db_expr_t addr) decaddr = db_hex2dec(addr); if (decaddr != -1) { - FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_pid == decaddr) - return (p); - } - LIST_FOREACH(p, &zombproc, p_list) { + LIST_FOREACH(p, PIDHASH(decaddr), p_hash) { if (p->p_pid == decaddr) return (p); } Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/kern/kern_exit.c Wed Aug 28 16:18:23 2019 (r351572) @@ -447,13 +447,10 @@ exit1(struct thread *td, int rval, int signo) WITNESS_WARN(WARN_PANIC, NULL, "process (pid %d) exiting", p->p_pid); /* - * Move proc from allproc queue to zombproc. + * Remove from allproc. It still sits in the hash. */ sx_xlock(&allproc_lock); - sx_xlock(&zombproc_lock); LIST_REMOVE(p, p_list); - LIST_INSERT_HEAD(&zombproc, p, p_list); - sx_xunlock(&zombproc_lock); sx_xunlock(&allproc_lock); sx_xlock(&proctree_lock); @@ -903,9 +900,6 @@ proc_reap(struct thread *td, struct proc *p, int *stat * Remove other references to this process to ensure we have an * exclusive reference. */ - sx_xlock(&zombproc_lock); - LIST_REMOVE(p, p_list); /* off zombproc */ - sx_xunlock(&zombproc_lock); sx_xlock(PIDHASHLOCK(p->p_pid)); LIST_REMOVE(p, p_hash); sx_xunlock(PIDHASHLOCK(p->p_pid)); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/kern/kern_proc.c Wed Aug 28 16:18:23 2019 (r351572) @@ -124,9 +124,7 @@ u_long pidhashlock; struct pgrphashhead *pgrphashtbl; u_long pgrphash; struct proclist allproc; -struct proclist zombproc; struct sx __exclusive_cache_line allproc_lock; -struct sx __exclusive_cache_line zombproc_lock; struct sx __exclusive_cache_line proctree_lock; struct mtx __exclusive_cache_line ppeers_lock; struct mtx __exclusive_cache_line procid_lock; @@ -177,12 +175,10 @@ procinit(void) u_long i; sx_init(&allproc_lock, "allproc"); - sx_init(&zombproc_lock, "zombproc"); sx_init(&proctree_lock, "proctree"); mtx_init(&ppeers_lock, "p_peers", NULL, MTX_DEF); mtx_init(&procid_lock, "procid", NULL, MTX_DEF); LIST_INIT(&allproc); - LIST_INIT(&zombproc); pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash); pidhashlock = (pidhash + 1) / 64; if (pidhashlock > 0) Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/kern/kern_racct.c Wed Aug 28 16:18:23 2019 (r351572) @@ -1256,17 +1256,11 @@ racctd(void) sx_slock(&allproc_lock); - sx_slock(&zombproc_lock); - LIST_FOREACH(p, &zombproc, p_list) { - PROC_LOCK(p); - racct_set(p, RACCT_PCTCPU, 0); - PROC_UNLOCK(p); - } - sx_sunlock(&zombproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state != PRS_NORMAL) { + if (p->p_state == PRS_ZOMBIE) + racct_set(p, RACCT_PCTCPU, 0); PROC_UNLOCK(p); continue; } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Aug 28 16:16:35 2019 (r351571) +++ head/sys/sys/proc.h Wed Aug 28 16:18:23 2019 (r351572) @@ -967,7 +967,6 @@ extern u_long pgrphash; extern struct sx allproc_lock; extern int allproc_gen; -extern struct sx zombproc_lock; extern struct sx proctree_lock; extern struct mtx ppeers_lock; extern struct mtx procid_lock; @@ -985,7 +984,6 @@ LIST_HEAD(proclist, proc); TAILQ_HEAD(procqueue, proc); TAILQ_HEAD(threadqueue, thread); extern struct proclist allproc; /* List of all processes. */ -extern struct proclist zombproc; /* List of zombie processes. */ extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ extern struct uma_zone *proc_zone; From owner-svn-src-head@freebsd.org Wed Aug 28 17:01:29 2019 Return-Path: Delivered-To: svn-src-head@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 97FAAE1916; Wed, 28 Aug 2019 17:01:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46JX893ZBZz4RPC; Wed, 28 Aug 2019 17:01:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C86EA6F9; Wed, 28 Aug 2019 17:01:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SH1T5s050529; Wed, 28 Aug 2019 17:01:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SH1SPn050508; Wed, 28 Aug 2019 17:01:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908281701.x7SH1SPn050508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Aug 2019 17:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351573 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 351573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 17:01:29 -0000 Author: markj Date: Wed Aug 28 17:01:28 2019 New Revision: 351573 URL: https://svnweb.freebsd.org/changeset/base/351573 Log: Document fetchReqHTTP(). Submitted by: Farhan Khan Reviewed by: 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18788 Modified: head/lib/libfetch/Makefile head/lib/libfetch/fetch.3 head/lib/libfetch/http.c Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Wed Aug 28 16:18:23 2019 (r351572) +++ head/lib/libfetch/Makefile Wed Aug 28 17:01:28 2019 (r351573) @@ -68,6 +68,7 @@ MLINKS+= fetch.3 fetchPutFTP.3 MLINKS+= fetch.3 fetchPutFile.3 MLINKS+= fetch.3 fetchPutHTTP.3 MLINKS+= fetch.3 fetchPutURL.3 +MLINKS+= fetch.3 fetchReqHTTP.3 MLINKS+= fetch.3 fetchStat.3 MLINKS+= fetch.3 fetchStatFTP.3 MLINKS+= fetch.3 fetchStatFile.3 Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Wed Aug 28 16:18:23 2019 (r351572) +++ head/lib/libfetch/fetch.3 Wed Aug 28 17:01:28 2019 (r351573) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2016 +.Dd August 28, 2019 .Dt FETCH 3 .Os .Sh NAME @@ -53,6 +53,7 @@ .Nm fetchPutHTTP , .Nm fetchStatHTTP , .Nm fetchListHTTP , +.Nm fetchReqHTTP , .Nm fetchXGetFTP , .Nm fetchGetFTP , .Nm fetchPutFTP , @@ -112,6 +113,8 @@ .Ft struct url_ent * .Fn fetchListHTTP "struct url *u" "const char *flags" .Ft FILE * +.Fn fetchReqHTTP "struct url *u" "const char *method" "const char *flags" "const char *content_type" "const char *body" +.Ft FILE * .Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags" .Ft FILE * .Fn fetchGetFTP "struct url *u" "const char *flags" @@ -355,9 +358,10 @@ and password "anonymous@". .Sh HTTP SCHEME The .Fn fetchXGetHTTP , -.Fn fetchGetHTTP -and +.Fn fetchGetHTTP , .Fn fetchPutHTTP +and +.Fn fetchReqHTTP functions implement the HTTP/1.1 protocol. With a little luck, there is even a chance that they comply with RFC2616 and RFC2617. @@ -386,6 +390,18 @@ will send a conditional .Li If-Modified-Since HTTP header to only fetch the content if it is newer than .Va ims_time . +.Pp +The function +.Fn fetchReqHTTP +can be used to make requests with an arbitrary HTTP verb, +including POST, DELETE, CONNECT, OPTIONS, TRACE or PATCH. +This can be done by setting the argument +.Fa method +to the intended verb, such as +.Ql POST , +and +.Fa body +to the content. .Pp Since there seems to be no good way of implementing the HTTP PUT method in a manner consistent with the rest of the Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Wed Aug 28 16:18:23 2019 (r351572) +++ head/lib/libfetch/http.c Wed Aug 28 17:01:28 2019 (r351573) @@ -2093,6 +2093,9 @@ fetchListHTTP(struct url *url __unused, const char *fl return (NULL); } +/* + * Arbitrary HTTP verb and content requests + */ FILE * fetchReqHTTP(struct url *URL, const char *method, const char *flags, const char *content_type, const char *body) From owner-svn-src-head@freebsd.org Wed Aug 28 17:39:47 2019 Return-Path: Delivered-To: svn-src-head@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 36537E2848; Wed, 28 Aug 2019 17:39:47 +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 46JY0M0g1zz4Tnl; Wed, 28 Aug 2019 17:39:47 +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 E83B7AD32; Wed, 28 Aug 2019 17:39:46 +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 x7SHdk1P069268; Wed, 28 Aug 2019 17:39:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SHdk4r069267; Wed, 28 Aug 2019 17:39:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908281739.x7SHdk4r069267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Aug 2019 17:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351574 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 351574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 17:39:47 -0000 Author: mav Date: Wed Aug 28 17:39:46 2019 New Revision: 351574 URL: https://svnweb.freebsd.org/changeset/base/351574 Log: MFV/ZoL: Fix wrong assertion in libzfs diff error handling In compare(), all error cases set the error code to EPIPE, so when an error is set, the correct assertion to make is that the error is EPIPE, not EINVAL. Reviewed-by: Richard Elling Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #8743 zfsonlinux/zfs@9dc41a769df164875d974c2431b2453e70e16c41 Submitted by: Ryan Moeller MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20118 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Wed Aug 28 17:01:28 2019 (r351573) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Wed Aug 28 17:39:46 2019 (r351574) @@ -472,7 +472,7 @@ differ(void *arg) if (err) return ((void *)-1); if (di->zerr) { - ASSERT(di->zerr == EINVAL); + ASSERT(di->zerr == EPIPE); (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Internal error: bad data from diff IOCTL")); From owner-svn-src-head@freebsd.org Wed Aug 28 18:01:55 2019 Return-Path: Delivered-To: svn-src-head@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 03203E2F80; Wed, 28 Aug 2019 18:01: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 46JYTt65JDz4VwC; Wed, 28 Aug 2019 18:01:54 +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 B2BB1B169; Wed, 28 Aug 2019 18:01:54 +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 x7SI1ss9086406; Wed, 28 Aug 2019 18:01:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SI1srq086405; Wed, 28 Aug 2019 18:01:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908281801.x7SI1srq086405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Aug 2019 18:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351575 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern X-SVN-Commit-Revision: 351575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 18:01:55 -0000 Author: markj Date: Wed Aug 28 18:01:54 2019 New Revision: 351575 URL: https://svnweb.freebsd.org/changeset/base/351575 Log: Avoid direct accesses of the vm_page wire_count field. No functional change intended. Sponsored by: Netflix Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/kern/vfs_bio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 28 17:39:46 2019 (r351574) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 28 18:01:54 2019 (r351575) @@ -593,7 +593,7 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio) vm_page_sunbusy(pp); vm_page_lock(pp); if (error) { - if (pp->wire_count == 0 && pp->valid == 0 && + if (!vm_page_wired(pp) && pp->valid == 0 && !vm_page_busied(pp)) vm_page_free(pp); } else { Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Aug 28 17:39:46 2019 (r351574) +++ head/sys/kern/vfs_bio.c Wed Aug 28 18:01:54 2019 (r351575) @@ -4881,10 +4881,9 @@ vm_hold_free_pages(struct buf *bp, int newbsize) for (index = newnpages; index < bp->b_npages; index++) { p = bp->b_pages[index]; bp->b_pages[index] = NULL; - p->wire_count--; + vm_page_unwire_noq(p); vm_page_free(p); } - vm_wire_sub(bp->b_npages - newnpages); bp->b_npages = newnpages; } From owner-svn-src-head@freebsd.org Wed Aug 28 19:28:28 2019 Return-Path: Delivered-To: svn-src-head@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 85DA9E45EC; Wed, 28 Aug 2019 19:28:28 +0000 (UTC) (envelope-from mjg@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 46JbPm2zGTz4b9B; Wed, 28 Aug 2019 19:28:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4796EC359; Wed, 28 Aug 2019 19:28:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SJSSLP034796; Wed, 28 Aug 2019 19:28:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SJSSpg034795; Wed, 28 Aug 2019 19:28:28 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908281928.x7SJSSpg034795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 19:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351576 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 351576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 19:28:28 -0000 Author: mjg Date: Wed Aug 28 19:28:27 2019 New Revision: 351576 URL: https://svnweb.freebsd.org/changeset/base/351576 Log: vm: only lock tmpfs vnode shared in vm_object_deallocate Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21455 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Aug 28 18:01:54 2019 (r351575) +++ head/sys/vm/vm_object.c Wed Aug 28 19:28:27 2019 (r351576) @@ -536,7 +536,7 @@ vm_object_deallocate(vm_object_t object) vp = object->un_pager.swp.swp_tmpfs; vhold(vp); VM_OBJECT_WUNLOCK(object); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); VM_OBJECT_WLOCK(object); if (object->type == OBJT_DEAD || object->ref_count != 1) { From owner-svn-src-head@freebsd.org Wed Aug 28 19:40:57 2019 Return-Path: Delivered-To: svn-src-head@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 B8A31E49F5; Wed, 28 Aug 2019 19:40:57 +0000 (UTC) (envelope-from mjg@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 46Jbh94T9Lz4bqK; Wed, 28 Aug 2019 19:40:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B4F4C559; Wed, 28 Aug 2019 19:40:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SJevXp041849; Wed, 28 Aug 2019 19:40:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SJevd4041816; Wed, 28 Aug 2019 19:40:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908281940.x7SJevd4041816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 19:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351577 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 351577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 19:40:57 -0000 Author: mjg Date: Wed Aug 28 19:40:57 2019 New Revision: 351577 URL: https://svnweb.freebsd.org/changeset/base/351577 Log: amd64: clean up cpu_switch.S - LK macro (conditional on SMP for the lock prefix) is unused - SETLK unnecessarily performs xchg. obtained value is never used and the implicit lock prefix adds avoidable cost. Barrier provided by it does not appear to be of any use. - the lock waited for is almost never blocked, yet the loop starts with a pause. Move it out of the common case. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19563 Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed Aug 28 19:28:27 2019 (r351576) +++ head/sys/amd64/amd64/cpu_switch.S Wed Aug 28 19:40:57 2019 (r351577) @@ -45,18 +45,6 @@ .text -#ifdef SMP -#define LK lock ; -#else -#define LK -#endif - -#if defined(SCHED_ULE) && defined(SMP) -#define SETLK xchgq -#else -#define SETLK movq -#endif - /* * cpu_throw() * @@ -150,17 +138,15 @@ ctx_switch_xsave: movq %rdx,%r15 movq %rsi,%rdi callq pmap_activate_sw - SETLK %r15,TD_LOCK(%r13) /* Release the old thread */ + movq %r15,TD_LOCK(%r13) /* Release the old thread */ sw1: movq TD_PCB(%r12),%r8 #if defined(SCHED_ULE) && defined(SMP) - /* Wait for the new thread to become unblocked */ movq $blocked_lock, %rdx -1: movq TD_LOCK(%r12),%rcx cmpq %rcx, %rdx - pause - je 1b + je sw1wait +sw1cont: #endif /* * At this point, we've switched address spaces and are ready @@ -496,3 +482,14 @@ ENTRY(resumectx) xorl %eax,%eax ret END(resumectx) + +/* Wait for the new thread to become unblocked */ +#if defined(SCHED_ULE) && defined(SMP) +sw1wait: +1: + pause + movq TD_LOCK(%r12),%rcx + cmpq %rcx, %rdx + je 1b + jmp sw1cont +#endif From owner-svn-src-head@freebsd.org Wed Aug 28 20:34:26 2019 Return-Path: Delivered-To: svn-src-head@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 837C9E5C8D; Wed, 28 Aug 2019 20:34:26 +0000 (UTC) (envelope-from mjg@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 46Jcst2mvSz3Blh; Wed, 28 Aug 2019 20:34:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CD31D0EA; Wed, 28 Aug 2019 20:34:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SKYQl2076968; Wed, 28 Aug 2019 20:34:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SKYPZQ076957; Wed, 28 Aug 2019 20:34:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908282034.x7SKYPZQ076957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 20:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351584 - in head/sys: fs/nullfs fs/unionfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/nullfs fs/unionfs kern sys X-SVN-Commit-Revision: 351584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 20:34:26 -0000 Author: mjg Date: Wed Aug 28 20:34:24 2019 New Revision: 351584 URL: https://svnweb.freebsd.org/changeset/base/351584 Log: vfs: add VOP_NEED_INACTIVE vnode usecount drops to 0 all the time (e.g. for directories during path lookup). When that happens the kernel would always lock the exclusive lock for the vnode in order to call vinactive(). This blocks other threads who want to use the vnode for looukp. vinactive is very rarely needed and can be tested for without the vnode lock held. This patch gives filesytems an opportunity to do it, sample total wait time for tmpfs over 500 minutes of poudriere -j 104: before: 557563641706 (lockmgr:tmpfs) after: 46309603301 (lockmgr:tmpfs) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21371 Modified: head/sys/fs/nullfs/null_vnops.c head/sys/fs/unionfs/union_vnops.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/fs/nullfs/null_vnops.c Wed Aug 28 20:34:24 2019 (r351584) @@ -907,6 +907,7 @@ struct vop_vector null_vnodeops = { .vop_getattr = null_getattr, .vop_getwritemount = null_getwritemount, .vop_inactive = null_inactive, + .vop_need_inactive = vop_stdneed_inactive, .vop_islocked = vop_stdislocked, .vop_lock1 = null_lock, .vop_lookup = null_lookup, Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/fs/unionfs/union_vnops.c Wed Aug 28 20:34:24 2019 (r351584) @@ -2523,6 +2523,7 @@ struct vop_vector unionfs_vnodeops = { .vop_getextattr = unionfs_getextattr, .vop_getwritemount = unionfs_getwritemount, .vop_inactive = unionfs_inactive, + .vop_need_inactive = vop_stdneed_inactive, .vop_islocked = unionfs_islocked, .vop_ioctl = unionfs_ioctl, .vop_link = unionfs_link, Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/kern/vfs_default.c Wed Aug 28 20:34:24 2019 (r351584) @@ -120,6 +120,7 @@ struct vop_vector default_vnodeops = { .vop_getpages_async = vop_stdgetpages_async, .vop_getwritemount = vop_stdgetwritemount, .vop_inactive = VOP_NULL, + .vop_need_inactive = vop_stdneed_inactive, .vop_ioctl = vop_stdioctl, .vop_kqfilter = vop_stdkqfilter, .vop_islocked = vop_stdislocked, @@ -1155,6 +1156,13 @@ vop_stdadd_writecount(struct vop_add_writecount_args * } VI_UNLOCK(vp); return (error); +} + +int +vop_stdneed_inactive(struct vop_need_inactive_args *ap) +{ + + return (1); } static int Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/kern/vfs_subr.c Wed Aug 28 20:34:24 2019 (r351584) @@ -2891,6 +2891,21 @@ vputx(struct vnode *vp, int func) CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); /* + * Check if the fs wants to perform inactive processing. Note we + * may be only holding the interlock, in which case it is possible + * someone else called vgone on the vnode and ->v_data is now NULL. + * Since vgone performs inactive on its own there is nothing to do + * here but to drop our hold count. + */ + if (__predict_false(vp->v_iflag & VI_DOOMED) || + VOP_NEED_INACTIVE(vp) == 0) { + if (func == VPUTX_VPUT) + VOP_UNLOCK(vp, 0); + vdropl(vp); + return; + } + + /* * We must call VOP_INACTIVE with the node locked. Mark * as VI_DOINGINACT to avoid recursion. */ @@ -4353,6 +4368,7 @@ static struct vop_vector sync_vnodeops = { .vop_close = sync_close, /* close */ .vop_fsync = sync_fsync, /* fsync */ .vop_inactive = sync_inactive, /* inactive */ + .vop_need_inactive = vop_stdneed_inactive, /* need_inactive */ .vop_reclaim = sync_reclaim, /* reclaim */ .vop_lock1 = vop_stdlock, /* lock */ .vop_unlock = vop_stdunlock, /* unlock */ @@ -4514,6 +4530,20 @@ sync_reclaim(struct vop_reclaim_args *ap) return (0); } +int +vn_need_pageq_flush(struct vnode *vp) +{ + struct vm_object *obj; + int need; + + 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) + need = 1; + return (need); +} + /* * Check if vnode represents a disk device */ @@ -4893,6 +4923,22 @@ vop_unlock_post(void *ap, int rc) if (a->a_flags & LK_INTERLOCK) ASSERT_VI_UNLOCKED(a->a_vp, "VOP_UNLOCK"); +} + +void +vop_need_inactive_pre(void *ap) +{ + struct vop_need_inactive_args *a = ap; + + ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE"); +} + +void +vop_need_inactive_post(void *ap, int rc) +{ + struct vop_need_inactive_args *a = ap; + + ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE"); } #endif Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/kern/vnode_if.src Wed Aug 28 20:34:24 2019 (r351584) @@ -358,6 +358,12 @@ vop_inactive { IN struct thread *td; }; +%! need_inactive pre vop_need_inactive_pre +%! need_inactive post vop_need_inactive_post + +vop_need_inactive { + IN struct vnode *vp; +}; %% reclaim vp E E E %! reclaim post vop_reclaim_post Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Aug 28 20:23:49 2019 (r351583) +++ head/sys/sys/vnode.h Wed Aug 28 20:34:24 2019 (r351584) @@ -682,6 +682,7 @@ int vn_generic_copy_file_range(struct vnode *invp, off struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td); +int vn_need_pageq_flush(struct vnode *vp); int vn_isdisk(struct vnode *vp, int *errp); int _vn_lock(struct vnode *vp, int flags, char *file, int line); #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) @@ -753,6 +754,7 @@ int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); int vop_stdgetpages(struct vop_getpages_args *); int vop_stdinactive(struct vop_inactive_args *); +int vop_stdneed_inactive(struct vop_need_inactive_args *); int vop_stdislocked(struct vop_islocked_args *); int vop_stdkqfilter(struct vop_kqfilter_args *); int vop_stdlock(struct vop_lock1_args *); @@ -813,12 +815,16 @@ void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); void vop_unlock_pre(void *a); void vop_unlock_post(void *a, int rc); +void vop_need_inactive_pre(void *a); +void vop_need_inactive_post(void *a, int rc); #else #define vop_strategy_pre(x) do { } while (0) #define vop_lock_pre(x) do { } while (0) #define vop_lock_post(x, y) do { } while (0) #define vop_unlock_pre(x) do { } while (0) #define vop_unlock_post(x, y) do { } while (0) +#define vop_need_inactive_pre(x) do { } while (0) +#define vop_need_inactive_post(x, y) do { } while (0) #endif void vop_rename_fail(struct vop_rename_args *ap); From owner-svn-src-head@freebsd.org Wed Aug 28 20:35:24 2019 Return-Path: Delivered-To: svn-src-head@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 23CC3E5D13; Wed, 28 Aug 2019 20:35:24 +0000 (UTC) (envelope-from mjg@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 46Jctz6Y76z3Bv1; Wed, 28 Aug 2019 20:35:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C16C1D0EE; Wed, 28 Aug 2019 20:35:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SKZNj2077188; Wed, 28 Aug 2019 20:35:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SKZN5A077187; Wed, 28 Aug 2019 20:35:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908282035.x7SKZN5A077187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 28 Aug 2019 20:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351585 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 351585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 20:35:24 -0000 Author: mjg Date: Wed Aug 28 20:35:23 2019 New Revision: 351585 URL: https://svnweb.freebsd.org/changeset/base/351585 Log: tmpfs: use VOP_NEED_INACTIVE Reviewed by: kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21371 Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 28 20:34:24 2019 (r351584) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 28 20:35:23 2019 (r351585) @@ -1283,6 +1283,27 @@ tmpfs_inactive(struct vop_inactive_args *v) return (0); } +static int +tmpfs_need_inactive(struct vop_need_inactive_args *ap) +{ + struct vnode *vp; + struct tmpfs_node *node; + struct vm_object *obj; + + vp = ap->a_vp; + node = VP_TO_TMPFS_NODE(vp); + if (node->tn_links == 0) + goto need; + if (vp->v_type == VREG) { + obj = vp->v_object; + if ((obj->flags & OBJ_TMPFS_DIRTY) != 0) + goto need; + } + return (0); +need: + return (1); +} + int tmpfs_reclaim(struct vop_reclaim_args *v) { @@ -1584,6 +1605,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_readdir = tmpfs_readdir, .vop_readlink = tmpfs_readlink, .vop_inactive = tmpfs_inactive, + .vop_need_inactive = tmpfs_need_inactive, .vop_reclaim = tmpfs_reclaim, .vop_print = tmpfs_print, .vop_pathconf = tmpfs_pathconf, From owner-svn-src-head@freebsd.org Wed Aug 28 20:35:59 2019 Return-Path: Delivered-To: svn-src-head@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 A844CE5DC5; Wed, 28 Aug 2019 20:35:59 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) (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 46Jcvf2S4Gz3C4S; Wed, 28 Aug 2019 20:35:57 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x243.google.com with SMTP id p127so771719oic.8; Wed, 28 Aug 2019 13:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=sljmqSZ98jq12DH/9Ke3gQrg25EBkYnpzZsTztDpSGE=; b=fwvojlwhy/NGmrpAdEIv9/JEHuDn4wjZUfJEWxR1PeIbjazNA1p8C+vtBK13veTp1L y1jG+QCsyKv6JtVxO9SU2DambU6GemrjQNRnGReXA6fODCCKLb2V4FtmkdByEgQxgNKU Qv1owmHDS+2twGDmTnpHbfL5hnuLNVkCcY2ZkN7SzF8HIvU/glWvdenn+3ZpbO34IKzk A9OYD68lk0MuHmhedxxCxv0ZL9B2pz10ZVEdSuoKmbM36yDl9m9F8WLsfqYf8JevyuVh lQfamPlTtFlZr6IExXKOxYi56OuZA4Snn+d+J5HlvYc6vGXnkzFhg7/OVtrOmNyKE7+R BfwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=sljmqSZ98jq12DH/9Ke3gQrg25EBkYnpzZsTztDpSGE=; b=PTgPeIvwHIodgqLJfndZdh38pVyc7Wx3oll34264m+dL/kQC08yzCvC9c0J5Eexf04 Vx3LlCfq020O3BelJqqf6oa9MAn35QKQ6cac6Oq3FbXiEtE5heEVRTBhLo1sP3w8KOcQ 56/vW3oPHDbtw9sapsuzXDiykJk1hPb6z7hcjxkO+g2M5ml7eOnc+YaC9c9JAdzhH/0G dBlcNzuTzRY2qiPIMv3zyZZhtPVvytqzE5iCQPpJq3LAuTlPyOVxVXH1eaRdQORTTaWW 4LUzBbr/WSsMdB66tJS93RiBIl5X/WoWvOfIuPGFFrBV1+xQAWjO6Ha8iSjWgtLvyl4D mFZw== X-Gm-Message-State: APjAAAWXiobnhdyf/2TZ8jrqsiTRm61KjZNMgRPUTIJLdmFyUsMUyXdw XREzKrWNt8Y7Gj3ndgAV7q5xf6cwMDVrDXneXX1XhA== X-Google-Smtp-Source: APXvYqwn10n+LC2apQWGj9MGLQ5Fqow0o/QXRKdqdN9wYo8eMnd1TmiQX9TU/APDUeHBDmnoTFT25eTZ9RLbC2aJKUU= X-Received: by 2002:aca:1313:: with SMTP id e19mr4056922oii.5.1567024555982; Wed, 28 Aug 2019 13:35:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:2516:0:0:0:0:0 with HTTP; Wed, 28 Aug 2019 13:35:55 -0700 (PDT) In-Reply-To: <201908282034.x7SKYPZQ076957@repo.freebsd.org> References: <201908282034.x7SKYPZQ076957@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 28 Aug 2019 22:35:55 +0200 Message-ID: Subject: Re: svn commit: r351584 - in head/sys: fs/nullfs fs/unionfs kern sys To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46Jcvf2S4Gz3C4S X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fwvojlwh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::243 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(0.00)[ip: (2.28), ipnet: 2607:f8b0::/32(-2.85), asn: 15169(-2.32), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.2.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]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 20:35:59 -0000 On 8/28/19, Mateusz Guzik wrote: > Author: mjg > Date: Wed Aug 28 20:34:24 2019 > New Revision: 351584 > URL: https://svnweb.freebsd.org/changeset/base/351584 > > Log: > vfs: add VOP_NEED_INACTIVE > > vnode usecount drops to 0 all the time (e.g. for directories during path > lookup). > When that happens the kernel would always lock the exclusive lock for the > vnode > in order to call vinactive(). This blocks other threads who want to use > the vnode > for looukp. > > vinactive is very rarely needed and can be tested for without the vnode > lock held. > > This patch gives filesytems an opportunity to do it, sample total wait > time for > tmpfs over 500 minutes of poudriere -j 104: > > before: 557563641706 (lockmgr:tmpfs) > after: 46309603301 (lockmgr:tmpfs) > > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D21371 > Reviewed by: kib Tested by: pho > Modified: > head/sys/fs/nullfs/null_vnops.c > head/sys/fs/unionfs/union_vnops.c > head/sys/kern/vfs_default.c > head/sys/kern/vfs_subr.c > head/sys/kern/vnode_if.src > head/sys/sys/vnode.h > > Modified: head/sys/fs/nullfs/null_vnops.c > ============================================================================== > --- head/sys/fs/nullfs/null_vnops.c Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/fs/nullfs/null_vnops.c Wed Aug 28 20:34:24 2019 (r351584) > @@ -907,6 +907,7 @@ struct vop_vector null_vnodeops = { > .vop_getattr = null_getattr, > .vop_getwritemount = null_getwritemount, > .vop_inactive = null_inactive, > + .vop_need_inactive = vop_stdneed_inactive, > .vop_islocked = vop_stdislocked, > .vop_lock1 = null_lock, > .vop_lookup = null_lookup, > > Modified: head/sys/fs/unionfs/union_vnops.c > ============================================================================== > --- head/sys/fs/unionfs/union_vnops.c Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/fs/unionfs/union_vnops.c Wed Aug 28 20:34:24 2019 (r351584) > @@ -2523,6 +2523,7 @@ struct vop_vector unionfs_vnodeops = { > .vop_getextattr = unionfs_getextattr, > .vop_getwritemount = unionfs_getwritemount, > .vop_inactive = unionfs_inactive, > + .vop_need_inactive = vop_stdneed_inactive, > .vop_islocked = unionfs_islocked, > .vop_ioctl = unionfs_ioctl, > .vop_link = unionfs_link, > > Modified: head/sys/kern/vfs_default.c > ============================================================================== > --- head/sys/kern/vfs_default.c Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/kern/vfs_default.c Wed Aug 28 20:34:24 2019 (r351584) > @@ -120,6 +120,7 @@ struct vop_vector default_vnodeops = { > .vop_getpages_async = vop_stdgetpages_async, > .vop_getwritemount = vop_stdgetwritemount, > .vop_inactive = VOP_NULL, > + .vop_need_inactive = vop_stdneed_inactive, > .vop_ioctl = vop_stdioctl, > .vop_kqfilter = vop_stdkqfilter, > .vop_islocked = vop_stdislocked, > @@ -1155,6 +1156,13 @@ vop_stdadd_writecount(struct vop_add_writecount_args > * > } > VI_UNLOCK(vp); > return (error); > +} > + > +int > +vop_stdneed_inactive(struct vop_need_inactive_args *ap) > +{ > + > + return (1); > } > > static int > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/kern/vfs_subr.c Wed Aug 28 20:34:24 2019 (r351584) > @@ -2891,6 +2891,21 @@ vputx(struct vnode *vp, int func) > CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); > > /* > + * Check if the fs wants to perform inactive processing. Note we > + * may be only holding the interlock, in which case it is possible > + * someone else called vgone on the vnode and ->v_data is now NULL. > + * Since vgone performs inactive on its own there is nothing to do > + * here but to drop our hold count. > + */ > + if (__predict_false(vp->v_iflag & VI_DOOMED) || > + VOP_NEED_INACTIVE(vp) == 0) { > + if (func == VPUTX_VPUT) > + VOP_UNLOCK(vp, 0); > + vdropl(vp); > + return; > + } > + > + /* > * We must call VOP_INACTIVE with the node locked. Mark > * as VI_DOINGINACT to avoid recursion. > */ > @@ -4353,6 +4368,7 @@ static struct vop_vector sync_vnodeops = { > .vop_close = sync_close, /* close */ > .vop_fsync = sync_fsync, /* fsync */ > .vop_inactive = sync_inactive, /* inactive */ > + .vop_need_inactive = vop_stdneed_inactive, /* need_inactive */ > .vop_reclaim = sync_reclaim, /* reclaim */ > .vop_lock1 = vop_stdlock, /* lock */ > .vop_unlock = vop_stdunlock, /* unlock */ > @@ -4514,6 +4530,20 @@ sync_reclaim(struct vop_reclaim_args *ap) > return (0); > } > > +int > +vn_need_pageq_flush(struct vnode *vp) > +{ > + struct vm_object *obj; > + int need; > + > + 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) > + need = 1; > + return (need); > +} > + > /* > * Check if vnode represents a disk device > */ > @@ -4893,6 +4923,22 @@ vop_unlock_post(void *ap, int rc) > > if (a->a_flags & LK_INTERLOCK) > ASSERT_VI_UNLOCKED(a->a_vp, "VOP_UNLOCK"); > +} > + > +void > +vop_need_inactive_pre(void *ap) > +{ > + struct vop_need_inactive_args *a = ap; > + > + ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE"); > +} > + > +void > +vop_need_inactive_post(void *ap, int rc) > +{ > + struct vop_need_inactive_args *a = ap; > + > + ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE"); > } > #endif > > > Modified: head/sys/kern/vnode_if.src > ============================================================================== > --- head/sys/kern/vnode_if.src Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/kern/vnode_if.src Wed Aug 28 20:34:24 2019 (r351584) > @@ -358,6 +358,12 @@ vop_inactive { > IN struct thread *td; > }; > > +%! need_inactive pre vop_need_inactive_pre > +%! need_inactive post vop_need_inactive_post > + > +vop_need_inactive { > + IN struct vnode *vp; > +}; > > %% reclaim vp E E E > %! reclaim post vop_reclaim_post > > Modified: head/sys/sys/vnode.h > ============================================================================== > --- head/sys/sys/vnode.h Wed Aug 28 20:23:49 2019 (r351583) > +++ head/sys/sys/vnode.h Wed Aug 28 20:34:24 2019 (r351584) > @@ -682,6 +682,7 @@ int vn_generic_copy_file_range(struct vnode *invp, off > struct vnode *outvp, off_t *outoffp, size_t *lenp, > unsigned int flags, struct ucred *incred, struct ucred *outcred, > struct thread *fsize_td); > +int vn_need_pageq_flush(struct vnode *vp); > int vn_isdisk(struct vnode *vp, int *errp); > int _vn_lock(struct vnode *vp, int flags, char *file, int line); > #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) > @@ -753,6 +754,7 @@ int vop_stdfsync(struct vop_fsync_args *); > int vop_stdgetwritemount(struct vop_getwritemount_args *); > int vop_stdgetpages(struct vop_getpages_args *); > int vop_stdinactive(struct vop_inactive_args *); > +int vop_stdneed_inactive(struct vop_need_inactive_args *); > int vop_stdislocked(struct vop_islocked_args *); > int vop_stdkqfilter(struct vop_kqfilter_args *); > int vop_stdlock(struct vop_lock1_args *); > @@ -813,12 +815,16 @@ void vop_lock_pre(void *a); > void vop_lock_post(void *a, int rc); > void vop_unlock_pre(void *a); > void vop_unlock_post(void *a, int rc); > +void vop_need_inactive_pre(void *a); > +void vop_need_inactive_post(void *a, int rc); > #else > #define vop_strategy_pre(x) do { } while (0) > #define vop_lock_pre(x) do { } while (0) > #define vop_lock_post(x, y) do { } while (0) > #define vop_unlock_pre(x) do { } while (0) > #define vop_unlock_post(x, y) do { } while (0) > +#define vop_need_inactive_pre(x) do { } while (0) > +#define vop_need_inactive_post(x, y) do { } while (0) > #endif > > void vop_rename_fail(struct vop_rename_args *ap); > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Aug 28 20:54:26 2019 Return-Path: Delivered-To: svn-src-head@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 E7E1BE639D; Wed, 28 Aug 2019 20:54:26 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (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 46JdJx6Stpz3D9R; Wed, 28 Aug 2019 20:54:25 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ed1-f67.google.com with SMTP id m44so1490740edd.9; Wed, 28 Aug 2019 13:54:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RG+DqBVHDUZHUTin03wT60qGHtW2g/WK3fG5arRiLZI=; b=K0rn0/EKc0eWVbNWYorfbbxMTFFRs4M4jr7hzI8nq50jWrIkrGbvuWRB3pN/CwFpac 7hgmIzYkV7yLA2dXw1CzHeF+7gDcJwcYSdsZrBv8weo53NRd1sGxcMbbdaMARyzjs1WN QXrhJfiA3vZQ4KlgRPPFxkRPrAYkxgac4h8+o/KUuXbkTyRdAXSIhvS+09EbJI2pT7YF q931qqf7zX85/eJ2X8HbJqIiFjeCcUSGM4XlHVKtHVEgItZZqoEKEQ994gsJ7yfJ/hNa ILGhnp1DhwisHI9EaCjCOxVuqU0cW11qj9Zx7oFqeEiU88sbANsN9NKwPBET1cjh8Xus Ag8g== X-Gm-Message-State: APjAAAUZp8/h6NuKgOPVTETIWXfo+Yv0vzPAN/ZtO1WormlwGe37NZg1 P9oQ/zMmjcud1P0yo5bJhZRsHSjhE6F9atOfBrnB+g== X-Google-Smtp-Source: APXvYqzk4iaY03TbmwxrVAFsrAmC3newvK0PQhZe7wlK1GBH0nI06xXYPtcIylyjSZs0LS944UIZYyeVwTh2N0ftqXw= X-Received: by 2002:a17:906:d9d1:: with SMTP id qk17mr5115449ejb.20.1567025664148; Wed, 28 Aug 2019 13:54:24 -0700 (PDT) MIME-Version: 1.0 References: <201908022209.x72M9vlg070949@repo.freebsd.org> In-Reply-To: <201908022209.x72M9vlg070949@repo.freebsd.org> From: Antoine Brodin Date: Wed, 28 Aug 2019 22:54:13 +0200 Message-ID: Subject: Re: svn commit: r350544 - head/usr.bin/bzip2recover To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46JdJx6Stpz3D9R X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of antoinebrodinfreebsd@gmail.com designates 209.85.208.67 as permitted sender) smtp.mailfrom=antoinebrodinfreebsd@gmail.com X-Spamd-Result: default: False [-5.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.16)[ip: (-5.07), ipnet: 209.85.128.0/17(-3.34), asn: 15169(-2.32), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; RCVD_IN_DNSWL_NONE(0.00)[67.208.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[67.208.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 20:54:27 -0000 On Sat, Aug 3, 2019 at 12:10 AM Mark Johnston wrote: > > Author: markj > Date: Fri Aug 2 22:09:56 2019 > New Revision: 350544 > URL: https://svnweb.freebsd.org/changeset/base/350544 > > Log: > Add bzip2recover.1. > > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > > Modified: > head/usr.bin/bzip2recover/Makefile Hi, It seems that this breaks parrallel installworld. Cheers, Antoine From owner-svn-src-head@freebsd.org Wed Aug 28 21:01:52 2019 Return-Path: Delivered-To: svn-src-head@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 69C30E64CE; Wed, 28 Aug 2019 21:01:52 +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 46JdTX26Ggz3DgQ; Wed, 28 Aug 2019 21:01:52 +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 433A9D609; Wed, 28 Aug 2019 21:01:52 +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 x7SL1q3E094398; Wed, 28 Aug 2019 21:01:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SL1pYs094396; Wed, 28 Aug 2019 21:01:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908282101.x7SL1pYs094396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 28 Aug 2019 21:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351587 - in head/usr.bin: bzip2 bzip2recover X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/usr.bin: bzip2 bzip2recover X-SVN-Commit-Revision: 351587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 21:01:52 -0000 Author: markj Date: Wed Aug 28 21:01:51 2019 New Revision: 351587 URL: https://svnweb.freebsd.org/changeset/base/351587 Log: Install all bzip2.1 MLINKs from the same place. Reported by: antoine MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/bzip2/Makefile head/usr.bin/bzip2recover/Makefile Modified: head/usr.bin/bzip2/Makefile ============================================================================== --- head/usr.bin/bzip2/Makefile Wed Aug 28 20:58:24 2019 (r351586) +++ head/usr.bin/bzip2/Makefile Wed Aug 28 21:01:51 2019 (r351587) @@ -12,7 +12,9 @@ LIBADD= bz2 LINKS= ${BINDIR}/bzip2 ${BINDIR}/bunzip2 LINKS+= ${BINDIR}/bzip2 ${BINDIR}/bzcat -MLINKS= bzip2.1 bunzip2.1 bzip2.1 bzcat.1 +MLINKS= bzip2.1 bunzip2.1 \ + bzip2.1 bzcat.1 \ + bzip2.1 bzip2recover.1 REFFILES= sample1.ref sample2.ref sample3.ref DREFFILES= sample1.bz2 sample2.bz2 sample3.bz2 Modified: head/usr.bin/bzip2recover/Makefile ============================================================================== --- head/usr.bin/bzip2recover/Makefile Wed Aug 28 20:58:24 2019 (r351586) +++ head/usr.bin/bzip2recover/Makefile Wed Aug 28 21:01:51 2019 (r351587) @@ -6,8 +6,6 @@ BZ2DIR= ${SRCTOP}/contrib/bzip2 PROG= bzip2recover MAN= -MLINKS+=bzip2.1 bzip2recover.1 - NO_WMISSING_VARIABLE_DECLARATIONS= .include From owner-svn-src-head@freebsd.org Wed Aug 28 21:03:59 2019 Return-Path: Delivered-To: svn-src-head@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 A5A42E6683; Wed, 28 Aug 2019 21:03:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 46JdWz3vB3z3DrJ; Wed, 28 Aug 2019 21:03:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2b.google.com with SMTP id b10so2488403ioj.2; Wed, 28 Aug 2019 14:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H02gTWHnIIOKA/nBQaeBhib3HKkb17tFmXSjXBFMa3I=; b=D6mlNXia0qs7W7MSQnxs9l8+CJ5JF8TO6N2plmkCWKSa1T2QOWY1eAot5Qjdu449AM W0HO7ZK2rhDHV6ZwmLYFFHaZSmt/w5n8zMY/dh17DGXJREuStLxO+ASV46gQg/VbX3A9 uqHUt8Y2eh1SSh9vER7YJ1dcNv4EKeo2BxqqUc7P0UqWMxDKlJAU0vbAoiHlykcgQiel ZdtKQog/koyLdq6hz2WaDykSpzWqYu+BJIAyXbJRVQFDtojPrYgrt70mkF8RADg8Wpli 0tsuMl6UBQCk2x4CW8Vi6lY1kU9Vm25/Lpgq7663aX2ZCwm15rRqq+BLcsIgp/DsqZIR F7bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=H02gTWHnIIOKA/nBQaeBhib3HKkb17tFmXSjXBFMa3I=; b=sfsJO0fASGnIEs2qOcrE6qSUR7z5thYRXFBaXZJj5wx7vGevZHezif67XjvNqWtEki kNnG1y1Vi5MsPQwJYZoIS3Hhmn9i/n38QM854dKSRAaB2Fb4Ejd0Tq7sj/mGBI3UqXF6 toW1Zi/910VNQtOEVuLXUSAttIkTkQrchGviWAJUGjzUCIL+7YabplTB3AYIkXBc6pdE 3phDYWznYkhxT0lqppxk7uI1aBO9gK8Fp9QjsNTuof3Vy2zUigbZeRu0FDIn8mduk7WZ pB+YXbkY6rBeXWIImJ5k/JgwMEplt4n7V89WVkgBeC8WJpwWDb7dl2A8s4m1QXmj9wfD +lcg== X-Gm-Message-State: APjAAAVJWOjfUE2lGXfQTZAm2tcA/Xf56WpaI0cEACQSu/vz5anaakCB rVa+lcnl0tvSF1RUGqNKYD67nz2r X-Google-Smtp-Source: APXvYqzInbp6ZDhmM2p4tVrmz7chEaaobiDF6M/9S7h8Fg/nnPB1E//QED2JevB4TR9/NjaB5YoGUg== X-Received: by 2002:a02:a518:: with SMTP id e24mr6683797jam.44.1567026237701; Wed, 28 Aug 2019 14:03:57 -0700 (PDT) Received: from raichu (toroon0560w-lp140-03-184-148-66-213.dsl.bell.ca. [184.148.66.213]) by smtp.gmail.com with ESMTPSA id w17sm222358ior.23.2019.08.28.14.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2019 14:03:56 -0700 (PDT) Sender: Mark Johnston Date: Wed, 28 Aug 2019 17:03:52 -0400 From: Mark Johnston To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350544 - head/usr.bin/bzip2recover Message-ID: <20190828210352.GA19405@raichu> References: <201908022209.x72M9vlg070949@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46JdWz3vB3z3DrJ X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 21:03:59 -0000 On Wed, Aug 28, 2019 at 10:54:13PM +0200, Antoine Brodin wrote: > On Sat, Aug 3, 2019 at 12:10 AM Mark Johnston wrote: > > > > Author: markj > > Date: Fri Aug 2 22:09:56 2019 > > New Revision: 350544 > > URL: https://svnweb.freebsd.org/changeset/base/350544 > > > > Log: > > Add bzip2recover.1. > > > > MFC after: 3 days > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/usr.bin/bzip2recover/Makefile > > Hi, > > It seems that this breaks parrallel installworld. > > Cheers, > > Antoine This should be fixed by r351587, thanks. From owner-svn-src-head@freebsd.org Wed Aug 28 22:04:05 2019 Return-Path: Delivered-To: svn-src-head@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 4DA4BE7A68; Wed, 28 Aug 2019 22:04:05 +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 46JfsK16NCz3Hxn; Wed, 28 Aug 2019 22:04:05 +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 07C0BE105; Wed, 28 Aug 2019 22:04:05 +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 x7SM44PG029926; Wed, 28 Aug 2019 22:04:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SM44j5029924; Wed, 28 Aug 2019 22:04:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908282204.x7SM44j5029924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Aug 2019 22:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351589 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 351589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 22:04:05 -0000 Author: mav Date: Wed Aug 28 22:04:04 2019 New Revision: 351589 URL: https://svnweb.freebsd.org/changeset/base/351589 Log: Fix AHCI Enclosure Management, broken by r351356. ivars value of -1 was used to distinguish EM device, and r351356 left some wrong checks for it. Give EM device separate flag there instead. Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Aug 28 21:13:28 2019 (r351588) +++ head/sys/dev/ahci/ahci.c Wed Aug 28 22:04:04 2019 (r351589) @@ -362,7 +362,7 @@ ahci_attach(device_t dev) if (child == NULL) device_printf(dev, "failed to add enclosure device\n"); else - device_set_ivars(child, (void *)(intptr_t)-1); + device_set_ivars(child, (void *)(intptr_t)AHCI_EM_UNIT); } bus_generic_attach(dev); return (0); @@ -562,23 +562,25 @@ ahci_alloc_resource(device_t dev, device_t child, int struct resource *res; rman_res_t st; int offset, size, unit; - bool is_remapped; + bool is_em, is_remapped; unit = (intptr_t)device_get_ivars(child); + is_em = is_remapped = false; if (unit & AHCI_REMAPPED_UNIT) { - unit &= ~AHCI_REMAPPED_UNIT; + unit &= AHCI_UNIT; unit -= ctlr->channels; is_remapped = true; - } else - is_remapped = false; + } else if (unit & AHCI_EM_UNIT) { + unit &= AHCI_UNIT; + is_em = true; + } res = NULL; switch (type) { case SYS_RES_MEMORY: if (is_remapped) { offset = ctlr->remap_offset + unit * ctlr->remap_size; size = ctlr->remap_size; - } - else if (unit >= 0) { + } else if (!is_em) { offset = AHCI_OFFSET + (unit << 7); size = 128; } else if (*rid == 0) { @@ -639,7 +641,7 @@ ahci_setup_intr(device_t dev, device_t child, struct r void *argument, void **cookiep) { struct ahci_controller *ctlr = device_get_softc(dev); - int unit = (intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT; + int unit = (intptr_t)device_get_ivars(child) & AHCI_UNIT; if (filter != NULL) { printf("ahci.c: we cannot use a filter here\n"); @@ -655,7 +657,7 @@ ahci_teardown_intr(device_t dev, device_t child, struc void *cookie) { struct ahci_controller *ctlr = device_get_softc(dev); - int unit = (intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT; + int unit = (intptr_t)device_get_ivars(child) & AHCI_UNIT; ctlr->interrupt[unit].function = NULL; ctlr->interrupt[unit].argument = NULL; @@ -665,12 +667,13 @@ ahci_teardown_intr(device_t dev, device_t child, struc int ahci_print_child(device_t dev, device_t child) { - int retval, channel; + intptr_t ivars; + int retval; retval = bus_print_child_header(dev, child); - channel = (int)(intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT; - if (channel >= 0) - retval += printf(" at channel %d", channel); + ivars = (intptr_t)device_get_ivars(child); + if ((ivars & AHCI_EM_UNIT) == 0) + retval += printf(" at channel %d", (int)ivars & AHCI_UNIT); retval += bus_print_child_footer(dev, child); return (retval); } @@ -679,11 +682,11 @@ int ahci_child_location_str(device_t dev, device_t child, char *buf, size_t buflen) { - int channel; + intptr_t ivars; - channel = (int)(intptr_t)device_get_ivars(child) & ~AHCI_REMAPPED_UNIT; - if (channel >= 0) - snprintf(buf, buflen, "channel=%d", channel); + ivars = (intptr_t)device_get_ivars(child); + if ((ivars & AHCI_EM_UNIT) == 0) + snprintf(buf, buflen, "channel=%d", (int)ivars & AHCI_UNIT); return (0); } Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Wed Aug 28 21:13:28 2019 (r351588) +++ head/sys/dev/ahci/ahci.h Wed Aug 28 22:04:04 2019 (r351589) @@ -319,9 +319,10 @@ /* Total main work area. */ #define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots) - -/* NVMe remapped device */ -#define AHCI_REMAPPED_UNIT (1 << 31) +/* ivars value fields */ +#define AHCI_REMAPPED_UNIT (1 << 31) /* NVMe remapped device. */ +#define AHCI_EM_UNIT (1 << 30) /* Enclosure Mgmt device. */ +#define AHCI_UNIT 0xff /* Channel number. */ struct ahci_dma_prd { u_int64_t dba; From owner-svn-src-head@freebsd.org Wed Aug 28 23:31:59 2019 Return-Path: Delivered-To: svn-src-head@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 6D0C9E9484; Wed, 28 Aug 2019 23:31:59 +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 46Jhpl2Fkfz3MvK; Wed, 28 Aug 2019 23:31:59 +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 2F1DDF130; Wed, 28 Aug 2019 23:31:59 +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 x7SNVxWZ081239; Wed, 28 Aug 2019 23:31:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SNVxqW081238; Wed, 28 Aug 2019 23:31:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201908282331.x7SNVxqW081238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 28 Aug 2019 23:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351590 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 351590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 23:31:59 -0000 Author: np Date: Wed Aug 28 23:31:58 2019 New Revision: 351590 URL: https://svnweb.freebsd.org/changeset/base/351590 Log: cxgbe/t4_tom: Use the correct value of sndbuf in AIO Tx. This should have been part of r351540. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Aug 28 22:04:04 2019 (r351589) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Aug 28 23:31:58 2019 (r351590) @@ -2023,7 +2023,6 @@ alloc_aiotx_mbuf(struct kaiocb *job, int len) static void t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) { - struct adapter *sc; struct sockbuf *sb; struct file *fp; struct inpcb *inp; @@ -2032,7 +2031,6 @@ t4_aiotx_process_job(struct toepcb *toep, struct socke int error, len; bool moretocome, sendmore; - sc = td_adapter(toep->td); sb = &so->so_snd; SOCKBUF_UNLOCK(sb); fp = job->fd_file; @@ -2104,8 +2102,8 @@ sendanother: moretocome = false; } else moretocome = true; - if (len > sc->tt.sndbuf) { - len = sc->tt.sndbuf; + if (len > toep->params.sndbuf) { + len = toep->params.sndbuf; sendmore = true; } else sendmore = false; From owner-svn-src-head@freebsd.org Wed Aug 28 23:40:58 2019 Return-Path: Delivered-To: svn-src-head@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 61390E95A4; Wed, 28 Aug 2019 23:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46Jj161qB7z3NBS; Wed, 28 Aug 2019 23:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 202CCF192; Wed, 28 Aug 2019 23:40:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7SNewoG082422; Wed, 28 Aug 2019 23:40:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7SNevUY082420; Wed, 28 Aug 2019 23:40:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908282340.x7SNevUY082420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Aug 2019 23:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351591 - in head/sys/amd64/vmm: . amd X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/amd64/vmm: . amd X-SVN-Commit-Revision: 351591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2019 23:40:58 -0000 Author: jhb Date: Wed Aug 28 23:40:57 2019 New Revision: 351591 URL: https://svnweb.freebsd.org/changeset/base/351591 Log: Use get_pcpu() to fetch the current CPU's pcpu pointer. This avoids encoding knowledge about how pcpu objects are allocated and is also a few instructions shorter. MFC after: 2 weeks Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/vmm_host.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed Aug 28 23:31:58 2019 (r351590) +++ head/sys/amd64/vmm/amd/svm.c Wed Aug 28 23:40:57 2019 (r351591) @@ -102,9 +102,6 @@ SYSCTL_INT(_hw_vmm_svm, OID_AUTO, vmcb_clean, CTLFLAG_ static MALLOC_DEFINE(M_SVM, "svm", "svm"); static MALLOC_DEFINE(M_SVM_VLAPIC, "svm-vlapic", "svm-vlapic"); -/* Per-CPU context area. */ -extern struct pcpu __pcpu[]; - static uint32_t svm_feature = ~0U; /* AMD SVM features. */ SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RDTUN, &svm_feature, 0, "SVM features advertised by CPUID.8000000AH:EDX"); @@ -2054,7 +2051,7 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t /* Launch Virtual Machine. */ VCPU_CTR1(vm, vcpu, "Resume execution at %#lx", state->rip); svm_dr_enter_guest(gctx); - svm_launch(vmcb_pa, gctx, &__pcpu[curcpu]); + svm_launch(vmcb_pa, gctx, get_pcpu()); svm_dr_leave_guest(gctx); CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); Modified: head/sys/amd64/vmm/vmm_host.h ============================================================================== --- head/sys/amd64/vmm/vmm_host.h Wed Aug 28 23:31:58 2019 (r351590) +++ head/sys/amd64/vmm/vmm_host.h Wed Aug 28 23:40:57 2019 (r351591) @@ -72,14 +72,11 @@ vmm_get_host_gdtrbase(void) return ((uint64_t)&gdt[NGDT * curcpu]); } -struct pcpu; -extern struct pcpu __pcpu[]; - static __inline uint64_t vmm_get_host_gsbase(void) { - return ((uint64_t)&__pcpu[curcpu]); + return ((uint64_t)get_pcpu()); } #endif From owner-svn-src-head@freebsd.org Thu Aug 29 02:44:19 2019 Return-Path: Delivered-To: svn-src-head@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 9E664EDD42; Thu, 29 Aug 2019 02:44:19 +0000 (UTC) (envelope-from karels@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 46Jn4g3h6Yz4408; Thu, 29 Aug 2019 02:44:19 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60E16193FA; Thu, 29 Aug 2019 02:44:19 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7T2iJjF096396; Thu, 29 Aug 2019 02:44:19 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T2iJeJ096395; Thu, 29 Aug 2019 02:44:19 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201908290244.x7T2iJeJ096395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Thu, 29 Aug 2019 02:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351592 - head/usr.bin/w X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/usr.bin/w X-SVN-Commit-Revision: 351592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 02:44:19 -0000 Author: karels Date: Thu Aug 29 02:44:18 2019 New Revision: 351592 URL: https://svnweb.freebsd.org/changeset/base/351592 Log: Fix address annotation in xml output from w The libxo xml feature of adding an annotation with the "original" address from the utmpx file if it is different than the final "from" field was broken by r351379. This was pointed out by the gcc error that save_p might be used uninitialized. Save the original address as needed in each entry, don't just use the last one from the previous loop. Reviewed by: marcel@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21390 Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Wed Aug 28 23:40:57 2019 (r351591) +++ head/usr.bin/w/w.c Thu Aug 29 02:44:18 2019 (r351592) @@ -118,6 +118,7 @@ static struct entry { char *args; /* arg list of interesting process */ struct kinfo_proc *dkp; /* debug option proc list */ char *from; /* "from": name or addr */ + char *save_from; /* original "from": name or addr */ } *ep, *ehead = NULL, **nextp = &ehead; #define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata) @@ -209,7 +210,6 @@ main(int argc, char *argv[]) if (*argv) sel_users = argv; - save_p = NULL; setutxent(); for (nusers = 0; (utmp = getutxent()) != NULL;) { struct addrinfo hints, *res; @@ -312,6 +312,8 @@ main(int argc, char *argv[]) ep->from = strdup(p); if ((i = strlen(p)) > fromwidth) fromwidth = i; + if (save_p != p) + ep->save_from = strdup(save_p); } endutxent(); @@ -451,8 +453,8 @@ main(int argc, char *argv[]) strncmp(ep->utmp.ut_line, "cua", 3) ? ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-"); - if (save_p && save_p != p) - xo_attr("address", "%s", save_p); + if (ep->save_from) + xo_attr("address", "%s", ep->save_from); xo_emit("{:from/%-*.*s/%@**@s} ", fromwidth, fromwidth, ep->from); t = ep->utmp.ut_tv.tv_sec; From owner-svn-src-head@freebsd.org Thu Aug 29 07:19:07 2019 Return-Path: Delivered-To: svn-src-head@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 C9E77CC841; Thu, 29 Aug 2019 07:19:07 +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 46Jv9l51rYz4K2V; Thu, 29 Aug 2019 07:19:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AF361C5C0; Thu, 29 Aug 2019 07:19:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7T7J7Gi057873; Thu, 29 Aug 2019 07:19:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7J7dN057872; Thu, 29 Aug 2019 07:19:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908290719.x7T7J7dN057872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 29 Aug 2019 07:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351593 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 351593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:19:07 -0000 Author: avg Date: Thu Aug 29 07:19:06 2019 New Revision: 351593 URL: https://svnweb.freebsd.org/changeset/base/351593 Log: zfs_ioc_snapshot: check user-prop permissions on snapshotted datasets Previously, the permissions were checked on the pool which was obviously incorrect. After this change, zfs_check_userprops() only validates the properties without any permission checks. The permissions are checked individually for each snapshotted dataset. This was also committed to ZoL: zfsonlinux/zfs@e6203d2 Reported by: CyberSecure MFC after: 1 week Sponsored by: CyberSecure Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 29 02:44:18 2019 (r351592) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 29 07:19:06 2019 (r351593) @@ -2747,10 +2747,9 @@ retry: * Check that all the properties are valid user properties. */ static int -zfs_check_userprops(const char *fsname, nvlist_t *nvl) +zfs_check_userprops(nvlist_t *nvl) { nvpair_t *pair = NULL; - int error = 0; while ((pair = nvlist_next_nvpair(nvl, pair)) != NULL) { const char *propname = nvpair_name(pair); @@ -2759,10 +2758,6 @@ zfs_check_userprops(const char *fsname, nvlist_t *nvl) nvpair_type(pair) != DATA_TYPE_STRING) return (SET_ERROR(EINVAL)); - if (error = zfs_secpolicy_write_perms(fsname, - ZFS_DELEG_PERM_USERPROP, CRED())) - return (error); - if (strlen(propname) >= ZAP_MAXNAMELEN) return (SET_ERROR(ENAMETOOLONG)); @@ -3429,12 +3424,11 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl nvpair_t *pair; (void) nvlist_lookup_nvlist(innvl, "props", &props); - if ((error = zfs_check_userprops(poolname, props)) != 0) - return (error); - if (!nvlist_empty(props) && zfs_earlier_version(poolname, SPA_VERSION_SNAP_PROPS)) return (SET_ERROR(ENOTSUP)); + if ((error = zfs_check_userprops(props)) != 0) + return (error); if (nvlist_lookup_nvlist(innvl, "snaps", &snaps) != 0) return (SET_ERROR(EINVAL)); @@ -3442,7 +3436,7 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { const char *name = nvpair_name(pair); - const char *cp = strchr(name, '@'); + char *cp = strchr(name, '@'); /* * The snap name must contain an @, and the part after it must @@ -3458,6 +3452,18 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl if (strncmp(name, poolname, poollen) != 0 || (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); + + /* + * Check for permission to set the properties on the fs. + */ + if (!nvlist_empty(props)) { + *cp = '\0'; + error = zfs_secpolicy_write_perms(name, + ZFS_DELEG_PERM_USERPROP, CRED()); + *cp = '@'; + if (error != 0) + return (error); + } /* This must be the only snap of this fs. */ for (nvpair_t *pair2 = nvlist_next_nvpair(snaps, pair); From owner-svn-src-head@freebsd.org Thu Aug 29 07:25:33 2019 Return-Path: Delivered-To: svn-src-head@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 7B230CCCD1; Thu, 29 Aug 2019 07:25:33 +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 46JvK93SYSz4KZn; Thu, 29 Aug 2019 07:25:33 +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 58FC11C782; Thu, 29 Aug 2019 07:25:33 +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 x7T7PXrc063581; Thu, 29 Aug 2019 07:25:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7PS3X063551; Thu, 29 Aug 2019 07:25:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908290725.x7T7PS3X063551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Aug 2019 07:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351594 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/arm64 arm64/include i386/i386 i386/include mips/include powerpc/include powerpc/powerpc riscv/include riscv/ri... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/arm64 arm64/include i386/i386 i386/include mips/include powerpc/include powerpc/powerpc riscv/include riscv/riscv sparc64/include sys X-SVN-Commit-Revision: 351594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:25:33 -0000 Author: kib Date: Thu Aug 29 07:25:27 2019 New Revision: 351594 URL: https://svnweb.freebsd.org/changeset/base/351594 Log: Centralize __pcpu definitions. Many extern struct pcpu __pcpu declarations were copied/pasted in sources. The issue is that the definition is MD, but it cannot be provided by machine/pcpu.h due to actual struct pcpu defined in sys/pcpu.h later than the inclusion of machine/pcpu.h. This forced the copying when other code needed direct access to __pcpu. There is no way around it, due to machine/pcpu.h supplying part of struct pcpu fields. To work around the problem, add a new machine/pcpu_aux.h header, which should fill any needed MD definitions after struct pcpu definition is completed. This allows to remove copies of __pcpu spread around the source. Also on x86 it makes it possible to remove work arounds like OFFSETOF_CURTHREAD or clang specific warnings supressions. Reported and tested by: lwhsu, bcran Reviewed by: imp, markj (previous version) Discussed with: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21418 Added: head/sys/amd64/include/pcpu_aux.h (contents, props changed) head/sys/arm/include/pcpu_aux.h (contents, props changed) head/sys/arm64/include/pcpu_aux.h (contents, props changed) head/sys/i386/include/pcpu_aux.h (contents, props changed) head/sys/mips/include/pcpu_aux.h (contents, props changed) head/sys/powerpc/include/pcpu_aux.h (contents, props changed) head/sys/riscv/include/pcpu_aux.h (contents, props changed) head/sys/sparc64/include/pcpu_aux.h (contents, props changed) Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/arm/arm/mp_machdep.c head/sys/arm/include/counter.h head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/counter.h head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/include/counter.h head/sys/i386/include/pcpu.h head/sys/powerpc/include/counter.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/riscv/include/counter.h head/sys/riscv/riscv/mp_machdep.c head/sys/sys/pcpu.h Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/amd64/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -94,8 +94,6 @@ __FBSDID("$FreeBSD$"); #define AP_BOOTPT_SZ (PAGE_SIZE * 3) -extern struct pcpu *__pcpu; - /* Temporary variables for init_secondary() */ char *doublefault_stack; char *mce_stack; Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/amd64/pmap.c Thu Aug 29 07:25:27 2019 (r351594) @@ -443,10 +443,6 @@ static pml4_entry_t *pti_pml4; static vm_pindex_t pti_pg_idx; static bool pti_finalized; -extern struct pcpu *__pcpu; -extern struct pcpu temp_bsp_pcpu; -extern pt_entry_t *pcpu_pte; - struct pmap_pkru_range { struct rs_el pkru_rs_el; u_int pkru_keyidx; Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/amd64/vm_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -84,10 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -_Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), - "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); -_Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), - "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb."); _Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf."); Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -33,9 +33,6 @@ #include -extern struct pcpu *__pcpu; -extern struct pcpu temp_bsp_pcpu; - #define EARLY_COUNTER &temp_bsp_pcpu.pc_early_dummy_counter #define counter_enter() do {} while (0) Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/include/pcpu.h Thu Aug 29 07:25:27 2019 (r351594) @@ -233,35 +233,6 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -#define OFFSETOF_CURTHREAD 0 -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnull-dereference" -#endif -static __inline __pure2 struct thread * -__curthread(void) -{ - struct thread *td; - - __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); - return (td); -} -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#define curthread (__curthread()) - -#define OFFSETOF_CURPCB 32 -static __inline __pure2 struct pcb * -__curpcb(void) -{ - struct pcb *pcb; - - __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (OFFSETOF_CURPCB)); - return (pcb); -} -#define curpcb (__curpcb()) - #define IS_BSP() (PCPU_GET(cpuid) == 0) #else /* !__GNUCLIKE_ASM || !__GNUCLIKE___TYPEOF */ Added: head/sys/amd64/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,72 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* Required for counters(9) to work on x86. */ +_Static_assert(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE, "fix pcpu size"); + +extern struct pcpu *__pcpu; +extern struct pcpu temp_bsp_pcpu; + +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu, + pc_curthread))); + return (td); +} +#define curthread (__curthread()) + +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (offsetof(struct pcpu, + pc_curpcb))); + return (pcb); +} +#define curpcb (__curpcb()) + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/arm/arm/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #endif -extern struct pcpu __pcpu[]; /* used to hold the AP's until we are ready to release them */ struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; Modified: head/sys/arm/include/counter.h ============================================================================== --- head/sys/arm/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/arm/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -34,8 +34,6 @@ #include #include -extern struct pcpu __pcpu[]; - #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() do {} while (0) Added: head/sys/arm/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/arm64/arm64/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -111,8 +112,6 @@ static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; static struct intr_ipi *intr_ipi_lookup(u_int); static void intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *); - -extern struct pcpu __pcpu[]; static void ipi_ast(void *); static void ipi_hardclock(void *); Modified: head/sys/arm64/include/counter.h ============================================================================== --- head/sys/arm64/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/arm64/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -32,8 +32,6 @@ #include #include -extern struct pcpu __pcpu[]; - #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() do {} while (0) Added: head/sys/arm64/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/i386/i386/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -130,8 +130,6 @@ __FBSDID("$FreeBSD$"); #endif /* CHECK_POINTS */ -extern struct pcpu __pcpu[]; - /* * Local data and functions. */ Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -90,10 +90,6 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif -_Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), - "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); -_Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), - "OFFSETOF_CURPCB does not correspond with offset of pc_curpcb."); _Static_assert(__OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "__OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf."); Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/i386/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -38,8 +38,6 @@ #include #include -extern struct pcpu __pcpu[]; - #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() do { \ Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/i386/include/pcpu.h Thu Aug 29 07:25:27 2019 (r351594) @@ -228,36 +228,6 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -#define OFFSETOF_CURTHREAD 0 -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnull-dereference" -#endif -static __inline __pure2 struct thread * -__curthread(void) -{ - struct thread *td; - - __asm("movl %%fs:%1,%0" : "=r" (td) - : "m" (*(char *)OFFSETOF_CURTHREAD)); - return (td); -} -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#define curthread (__curthread()) - -#define OFFSETOF_CURPCB 16 -static __inline __pure2 struct pcb * -__curpcb(void) -{ - struct pcb *pcb; - - __asm("movl %%fs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); - return (pcb); -} -#define curpcb (__curpcb()) - #define IS_BSP() (PCPU_GET(cpuid) == 0) #else /* defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ Added: head/sys/i386/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,71 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* Required for counters(9) to work on x86. */ +_Static_assert(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("movl %%fs:%1,%0" : "=r" (td) + : "m" (*(char *)offsetof(struct pcpu, pc_curthread))); + return (td); +} +#define curthread (__curthread()) + +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movl %%fs:%1,%0" : "=r" (pcb) + : "m" (*(char *)offsetof(struct pcpu, pc_curpcb))); + return (pcb); +} +#define curpcb (__curpcb()) + +#endif /* _MACHINE_PCPU_AUX_H_ */ Added: head/sys/mips/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/powerpc/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -36,8 +36,6 @@ #include #endif -extern struct pcpu __pcpu[]; - #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #ifdef __powerpc64__ Added: head/sys/powerpc/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/powerpc/powerpc/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" -extern struct pcpu __pcpu[MAXCPU]; - volatile static int ap_awake; volatile static u_int ap_letgo; volatile static u_quad_t ap_timebase; Modified: head/sys/riscv/include/counter.h ============================================================================== --- head/sys/riscv/include/counter.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/riscv/include/counter.h Thu Aug 29 07:25:27 2019 (r351594) @@ -34,8 +34,6 @@ #include #endif -extern struct pcpu __pcpu[]; - #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() critical_enter() Added: head/sys/riscv/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +extern struct pcpu __pcpu[]; + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/riscv/riscv/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); boolean_t ofw_cpu_reg(phandle_t node, u_int, cell_t *); -extern struct pcpu __pcpu[]; - uint32_t __riscv_boot_ap[MAXCPU]; static enum { Added: head/sys/sparc64/include/pcpu_aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/include/pcpu_aux.h Thu Aug 29 07:25:27 2019 (r351594) @@ -0,0 +1,50 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PCPU_AUX_H_ +#define _MACHINE_PCPU_AUX_H_ + +#ifndef _KERNEL +#error "Not for userspace" +#endif + +#ifndef _SYS_PCPU_H_ +#error "Do not include machine/pcpu_aux.h directly" +#endif + +/* + * To minimize memory waste in per-cpu UMA zones, the page size should + * be a multiple of the size of struct pcpu. + */ +_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); + +#endif /* _MACHINE_PCPU_AUX_H_ */ Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/sys/pcpu.h Thu Aug 29 07:25:27 2019 (r351594) @@ -216,26 +216,16 @@ extern struct cpuhead cpuhead; extern struct pcpu *cpuid_to_pcpu[]; #define curcpu PCPU_GET(cpuid) -#define curproc (curthread->td_proc) -#ifndef curthread -#define curthread PCPU_GET(curthread) -#endif #define curvidata PCPU_GET(vidata) #define UMA_PCPU_ALLOC_SIZE PAGE_SIZE -#ifdef CTASSERT -#if defined(__i386__) || defined(__amd64__) -/* Required for counters(9) to work on x86. */ -CTASSERT(sizeof(struct pcpu) == UMA_PCPU_ALLOC_SIZE); -#else -/* - * To minimize memory waste in per-cpu UMA zones, size of struct pcpu - * should be denominator of PAGE_SIZE. - */ -CTASSERT((PAGE_SIZE / sizeof(struct pcpu)) * sizeof(struct pcpu) == PAGE_SIZE); -#endif /* UMA_PCPU_ALLOC_SIZE && x86 */ -#endif /* CTASSERT */ +#include + +#ifndef curthread +#define curthread PCPU_GET(curthread) +#endif +#define curproc (curthread->td_proc) /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ static inline void * From owner-svn-src-head@freebsd.org Thu Aug 29 07:34:14 2019 Return-Path: Delivered-To: svn-src-head@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 CA9F7CD038; Thu, 29 Aug 2019 07:34:14 +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 46JvWB4x9wz4L6X; Thu, 29 Aug 2019 07:34:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A45FA1C979; Thu, 29 Aug 2019 07:34:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7T7YEMK069555; Thu, 29 Aug 2019 07:34:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7YEdw069554; Thu, 29 Aug 2019 07:34:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908290734.x7T7YEdw069554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Aug 2019 07:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351595 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 351595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:34:14 -0000 Author: kib Date: Thu Aug 29 07:34:14 2019 New Revision: 351595 URL: https://svnweb.freebsd.org/changeset/base/351595 Log: Remove useless redefinition of NSFBUFS in i386/vm_machdep.c. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/vm_machdep.c Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:25:27 2019 (r351594) +++ head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:34:14 2019 (r351595) @@ -86,10 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) -#endif - _Static_assert(__OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "__OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf."); From owner-svn-src-head@freebsd.org Thu Aug 29 07:39:32 2019 Return-Path: Delivered-To: svn-src-head@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 63307CD168; Thu, 29 Aug 2019 07:39:32 +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 46JvdJ1l44z4LHl; Thu, 29 Aug 2019 07:39:32 +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 18F411C97C; Thu, 29 Aug 2019 07:39:32 +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 x7T7dVe5069825; Thu, 29 Aug 2019 07:39:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7dVkJ069824; Thu, 29 Aug 2019 07:39:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908290739.x7T7dVkJ069824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 29 Aug 2019 07:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351596 - in head: sys/sys tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sys/sys tests/sys/sys X-SVN-Commit-Revision: 351596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:39:32 -0000 Author: trasz Date: Thu Aug 29 07:39:31 2019 New Revision: 351596 URL: https://svnweb.freebsd.org/changeset/base/351596 Log: Fix qmath(3) build problems with GCC 8. Discussed with: asomers Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D21442 Modified: head/sys/sys/qmath.h head/tests/sys/sys/qmath_test.c Modified: head/sys/sys/qmath.h ============================================================================== --- head/sys/sys/qmath.h Thu Aug 29 07:34:14 2019 (r351595) +++ head/sys/sys/qmath.h Thu Aug 29 07:39:31 2019 (r351596) @@ -267,7 +267,7 @@ typedef u64q_t umaxq_t; /* Left shift an integral value to align with the int bits of 'q'. */ #define Q_SHL(q, iv) \ - (Q_LTZ(iv) ? -(Q_ABS(iv) << Q_NFBITS(q)) : \ + (Q_LTZ(iv) ? -(int64_t)(Q_ABS(iv) << Q_NFBITS(q)) : \ Q_TC(q, iv) << Q_NFBITS(q)) /* Calculate the relative fractional precision between 'a' and 'b' in bits. */ Modified: head/tests/sys/sys/qmath_test.c ============================================================================== --- head/tests/sys/sys/qmath_test.c Thu Aug 29 07:34:14 2019 (r351595) +++ head/tests/sys/sys/qmath_test.c Thu Aug 29 07:39:31 2019 (r351596) @@ -208,7 +208,9 @@ ATF_TC_BODY(qmulq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; +#ifdef notyet int64_t a_int, b_int; +#endif int error; srandomdev(); @@ -231,8 +233,6 @@ ATF_TC_BODY(qmulq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -247,6 +247,9 @@ ATF_TC_BODY(qmulq_s64q, tc) r_dbl = a_dbl * b_dbl; #ifdef notyet + a_int = Q_GIVAL(a_s64q); + b_int = Q_GIVAL(b_s64q); + maxe_dbl = fabs(((1.0 / Q_NFBITS(a_s64q)) * (double)b_int) + ((1.0 / Q_NFBITS(b_s64q)) * (double)a_int)); #else @@ -270,7 +273,6 @@ ATF_TC_BODY(qdivq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -283,8 +285,6 @@ ATF_TC_BODY(qdivq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -318,7 +318,6 @@ ATF_TC_BODY(qaddq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -331,8 +330,6 @@ ATF_TC_BODY(qaddq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -369,7 +366,6 @@ ATF_TC_BODY(qsubq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -382,8 +378,6 @@ ATF_TC_BODY(qsubq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); From owner-svn-src-head@freebsd.org Thu Aug 29 07:45:25 2019 Return-Path: Delivered-To: svn-src-head@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 40F67CD538; Thu, 29 Aug 2019 07:45:25 +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 46Jvm46jv0z4Lk8; Thu, 29 Aug 2019 07:45:24 +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 C9C661CB4A; Thu, 29 Aug 2019 07:45:24 +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 x7T7jOPO075409; Thu, 29 Aug 2019 07:45:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7jOav075406; Thu, 29 Aug 2019 07:45:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908290745.x7T7jOav075406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Aug 2019 07:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351597 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 351597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:45:25 -0000 Author: kib Date: Thu Aug 29 07:45:23 2019 New Revision: 351597 URL: https://svnweb.freebsd.org/changeset/base/351597 Log: UFS: stop reusing the vnode for reallocated inode. In ffs_valloc(), force reclaim existing vnode on inode reuse, instead of trying to re-initialize the same vnode for new purposes. This is done in preparation of changes to the vp->v_object lifecycle handling. A new FFSV_REPLACE flag to ffs_vgetf() directs the function to vgone(9) the vnode if found in vfs hash, instead of returning it. Reviewed by: markj, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21412 Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Thu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_alloc.c Thu Aug 29 07:45:23 2019 (r351597) @@ -1137,10 +1137,15 @@ retry: (allocfcn_t *)ffs_nodealloccg); if (ino == 0) goto noinodes; - error = ffs_vget(pvp->v_mount, ino, LK_EXCLUSIVE, vpp); + + /* + * Get rid of the cached old vnode, force allocation of a new vnode + * for this inode. + */ + error = ffs_vgetf(pvp->v_mount, ino, LK_EXCLUSIVE, vpp, FFSV_REPLACE); if (error) { error1 = ffs_vgetf(pvp->v_mount, ino, LK_EXCLUSIVE, vpp, - FFSV_FORCEINSMQ); + FFSV_FORCEINSMQ | FFSV_REPLACE); ffs_vfree(pvp, ino, mode); if (error1 == 0) { ip = VTOI(*vpp); @@ -1176,7 +1181,6 @@ dup_alloc: ip->i_din2->di_birthtime = ts.tv_sec; ip->i_din2->di_birthnsec = ts.tv_nsec; } - ufs_prepare_reclaim(*vpp); ip->i_flag = 0; (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Thu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_extern.h Thu Aug 29 07:45:23 2019 (r351597) @@ -121,6 +121,7 @@ void process_deferred_inactive(struct mount *mp); * Flags to ffs_vgetf */ #define FFSV_FORCEINSMQ 0x0001 +#define FFSV_REPLACE 0x0002 /* * Flags to ffs_reload Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Aug 29 07:45:23 2019 (r351597) @@ -1671,9 +1671,17 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) struct vnode *vp; int error; + MPASS((ffs_flags & FFSV_REPLACE) == 0 || (flags & LK_EXCLUSIVE) != 0); + error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL); - if (error || *vpp != NULL) + if (error != 0) return (error); + if (*vpp != NULL) { + if ((ffs_flags & FFSV_REPLACE) == 0) + return (0); + vgone(*vpp); + vput(*vpp); + } /* * We must promote to an exclusive lock for vnode creation. This @@ -1735,8 +1743,19 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) } vp->v_vflag &= ~VV_FORCEINSMQ; error = vfs_hash_insert(vp, ino, flags, curthread, vpp, NULL, NULL); - if (error || *vpp != NULL) + if (error != 0) return (error); + if (*vpp != NULL) { + /* + * Calls from ffs_valloc() (i.e. FFSV_REPLACE set) + * operate on empty inode, which must not be found by + * other threads until fully filled. Vnode for empty + * inode must be not re-inserted on the hash by other + * thread, after removal by us at the beginning. + */ + MPASS((ffs_flags & FFSV_REPLACE) == 0); + return (0); + } /* Read in the disk contents for the inode, copy into the inode. */ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), From owner-svn-src-head@freebsd.org Thu Aug 29 07:50:29 2019 Return-Path: Delivered-To: svn-src-head@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 33FE5CD643; Thu, 29 Aug 2019 07:50:29 +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 46Jvsx1Jnrz4LvV; Thu, 29 Aug 2019 07:50:29 +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 1009A1CB5E; Thu, 29 Aug 2019 07:50:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7T7oSxI075725; Thu, 29 Aug 2019 07:50:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7oPce075709; Thu, 29 Aug 2019 07:50:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908290750.x7T7oPce075709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 29 Aug 2019 07:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351598 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/smbfs fs/tmpfs fs/udf kern ufs/ufs vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/smbfs fs/tmpfs fs/udf kern ufs/ufs vm X-SVN-Commit-Revision: 351598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:50:29 -0000 Author: kib Date: Thu Aug 29 07:50:25 2019 New Revision: 351598 URL: https://svnweb.freebsd.org/changeset/base/351598 Log: Rework v_object lifecycle for vnodes. Current implementation of vnode_create_vobject() and vnode_destroy_vobject() is written so that it prepared to handle the vm object destruction for live vnode. Practically, no filesystems use this, except for some remnants that were present in UFS till today. One of the consequences of that model is that each filesystem must call vnode_destroy_vobject() in VOP_RECLAIM() or earlier, as result all of them get rid of the v_object in reclaim. Move the call to vnode_destroy_vobject() to vgonel() before VOP_RECLAIM(). This makes v_object stable: either the object is NULL, or it is valid vm object till the vnode reclamation. Remove code from vnode_create_vobject() to handle races with the parallel destruction. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21412 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_node.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/vfs_subr.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_inode.c head/sys/vm/vm_object.h head/sys/vm/vnode_pager.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -5375,9 +5375,6 @@ zfs_freebsd_reclaim(ap) ASSERT(zp != NULL); - /* Destroy the vm object and flush associated pages. */ - vnode_destroy_vobject(vp); - /* * z_teardown_inactive_lock protects from a race with * zfs_znode_dmu_fini in zfsvfs_teardown during Modified: head/sys/fs/cd9660/cd9660_node.c ============================================================================== --- head/sys/fs/cd9660/cd9660_node.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/cd9660/cd9660_node.c Thu Aug 29 07:50:25 2019 (r351598) @@ -92,10 +92,6 @@ cd9660_reclaim(ap) struct vnode *vp = ap->a_vp; /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); - /* * Remove the inode from its hash chain. */ vfs_hash_remove(vp); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/devfs/devfs_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1428,7 +1428,6 @@ devfs_reclaim(struct vop_reclaim_args *ap) vp->v_data = NULL; } mtx_unlock(&devfs_de_interlock); - vnode_destroy_vobject(vp); return (0); } Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/ext2fs/ext2_inode.c Thu Aug 29 07:50:25 2019 (r351598) @@ -639,6 +639,5 @@ ext2_reclaim(struct vop_reclaim_args *ap) vfs_hash_remove(vp); free(vp->v_data, M_EXT2NODE); vp->v_data = 0; - vnode_destroy_vobject(vp); return (0); } Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1537,7 +1537,6 @@ fuse_vnop_reclaim(struct vop_reclaim_args *ap) fuse_vnode_setparent(vp, NULL); cache_purge(vp); vfs_hash_remove(vp); - vnode_destroy_vobject(vp); fuse_vnode_destroy(vp); return 0; Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/msdosfs/msdosfs_denode.c Thu Aug 29 07:50:25 2019 (r351598) @@ -552,10 +552,6 @@ msdosfs_reclaim(struct vop_reclaim_args *ap) #endif /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); - /* * Remove the denode from its hash chain. */ vfs_hash_remove(vp); Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/nfsclient/nfs_clnode.c Thu Aug 29 07:50:25 2019 (r351598) @@ -296,11 +296,6 @@ ncl_reclaim(struct vop_reclaim_args *ap) ncl_releasesillyrename(vp, ap->a_td); mtx_unlock(&np->n_mtx); - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); - if (NFS_ISV4(vp) && vp->v_type == VREG) /* * We can now safely close any remaining NFSv4 Opens for Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/smbfs/smbfs_node.c Thu Aug 29 07:50:25 2019 (r351598) @@ -272,10 +272,6 @@ smbfs_reclaim(ap) KASSERT((np->n_flag & NOPEN) == 0, ("file not closed before reclaim")); - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); dvp = (np->n_parent && (np->n_flag & NREFPARENT)) ? np->n_parent : NULL; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1317,8 +1317,6 @@ tmpfs_reclaim(struct vop_reclaim_args *v) if (vp->v_type == VREG) tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); - else - vnode_destroy_vobject(vp); vp->v_object = NULL; if (tmpfs_use_nc(vp)) cache_purge(vp); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/udf/udf_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1266,11 +1266,6 @@ udf_reclaim(struct vop_reclaim_args *a) vp = a->a_vp; unode = VTON(vp); - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); - if (unode != NULL) { vfs_hash_remove(vp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/kern/vfs_subr.c Thu Aug 29 07:50:25 2019 (r351598) @@ -3481,9 +3481,9 @@ static void vgonel(struct vnode *vp) { struct thread *td; - int oweinact; - int active; struct mount *mp; + vm_object_t object; + bool active, oweinact; ASSERT_VOP_ELOCKED(vp, "vgonel"); ASSERT_VI_LOCKED(vp, "vgonel"); @@ -3503,8 +3503,8 @@ vgonel(struct vnode *vp) * Check to see if the vnode is in use. If so, we have to call * VOP_CLOSE() and VOP_INACTIVE(). */ - active = vp->v_usecount; - oweinact = (vp->v_iflag & VI_OWEINACT); + active = vp->v_usecount > 0; + oweinact = (vp->v_iflag & VI_OWEINACT) != 0; VI_UNLOCK(vp); vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); @@ -3543,12 +3543,24 @@ vgonel(struct vnode *vp) ("vp %p bufobj not invalidated", vp)); /* - * For VMIO bufobj, BO_DEAD is set in vm_object_terminate() - * after the object's page queue is flushed. + * For VMIO bufobj, BO_DEAD is set later, or in + * vm_object_terminate() after the object's page queue is + * flushed. */ - if (vp->v_bufobj.bo_object == NULL) + object = vp->v_bufobj.bo_object; + if (object == NULL) vp->v_bufobj.bo_flag |= BO_DEAD; BO_UNLOCK(&vp->v_bufobj); + + /* + * Handle the VM part. Tmpfs handles v_object on its own (the + * OBJT_VNODE check). Nullfs or other bypassing filesystems + * should not touch the object borrowed from the lower vnode + * (the handle check). + */ + if (object != NULL && object->type == OBJT_VNODE && + object->handle == vp) + vnode_destroy_vobject(vp); /* * Reclaim the vnode. Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/ufs/ufs/ufs_extern.h Thu Aug 29 07:50:25 2019 (r351598) @@ -79,7 +79,6 @@ int ufs_inactive(struct vop_inactive_args *); int ufs_init(struct vfsconf *); void ufs_itimes(struct vnode *vp); int ufs_lookup(struct vop_cachedlookup_args *); -void ufs_prepare_reclaim(struct vnode *vp); int ufs_readdir(struct vop_readdir_args *); int ufs_reclaim(struct vop_reclaim_args *); void ffs_snapgone(struct inode *); Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/ufs/ufs/ufs_inode.c Thu Aug 29 07:50:25 2019 (r351598) @@ -179,18 +179,21 @@ out: return (error); } -void -ufs_prepare_reclaim(struct vnode *vp) +/* + * Reclaim an inode so that it can be used for other purposes. + */ +int +ufs_reclaim(ap) + struct vop_reclaim_args /* { + struct vnode *a_vp; + struct thread *a_td; + } */ *ap; { - struct inode *ip; + struct vnode *vp = ap->a_vp; + struct inode *ip = VTOI(vp); #ifdef QUOTA int i; -#endif - ip = VTOI(vp); - - vnode_destroy_vobject(vp); -#ifdef QUOTA for (i = 0; i < MAXQUOTAS; i++) { if (ip->i_dquot[i] != NODQUOT) { dqrele(vp, ip->i_dquot[i]); @@ -202,22 +205,6 @@ ufs_prepare_reclaim(struct vnode *vp) if (ip->i_dirhash != NULL) ufsdirhash_free(ip); #endif -} - -/* - * Reclaim an inode so that it can be used for other purposes. - */ -int -ufs_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - struct inode *ip = VTOI(vp); - - ufs_prepare_reclaim(vp); if (ip->i_flag & IN_LAZYMOD) ip->i_flag |= IN_MODIFIED; Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/vm/vm_object.h Thu Aug 29 07:50:25 2019 (r351598) @@ -189,7 +189,6 @@ struct vm_object { #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_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ #define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ /* Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/vm/vnode_pager.c Thu Aug 29 07:50:25 2019 (r351598) @@ -147,17 +147,9 @@ vnode_create_vobject(struct vnode *vp, off_t isize, st if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE) return (0); - while ((object = vp->v_object) != NULL) { - VM_OBJECT_WLOCK(object); - if (!(object->flags & OBJ_DEAD)) { - VM_OBJECT_WUNLOCK(object); - return (0); - } - VOP_UNLOCK(vp, 0); - vm_object_set_flag(object, OBJ_DISCONNECTWNT); - VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead", 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - } + object = vp->v_object; + if (object != NULL) + return (0); if (size == 0) { if (vn_isdisk(vp, NULL)) { @@ -190,10 +182,11 @@ vnode_destroy_vobject(struct vnode *vp) struct vm_object *obj; obj = vp->v_object; - if (obj == NULL) + if (obj == NULL || obj->handle != vp) return; ASSERT_VOP_ELOCKED(vp, "vnode_destroy_vobject"); VM_OBJECT_WLOCK(obj); + MPASS(obj->type == OBJT_VNODE); umtx_shm_object_terminated(obj); if (obj->ref_count == 0) { /* @@ -223,9 +216,6 @@ vnode_destroy_vobject(struct vnode *vp) * prevented new waiters from referencing the dying * object. */ - KASSERT((obj->flags & OBJ_DISCONNECTWNT) == 0, - ("OBJ_DISCONNECTWNT set obj %p flags %x", - obj, obj->flags)); vp->v_object = NULL; VM_OBJECT_WUNLOCK(obj); } @@ -243,8 +233,6 @@ vnode_destroy_vobject(struct vnode *vp) /* * Allocate (or lookup) pager for a vnode. * Handle is a vnode pointer. - * - * MPSAFE */ vm_object_t vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, @@ -259,28 +247,18 @@ vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_ if (handle == NULL) return (NULL); - vp = (struct vnode *) handle; - - /* - * If the object is being terminated, wait for it to - * go away. - */ + vp = (struct vnode *)handle; + ASSERT_VOP_LOCKED(vp, "vnode_pager_alloc"); + KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); retry: - while ((object = vp->v_object) != NULL) { - VM_OBJECT_WLOCK(object); - if ((object->flags & OBJ_DEAD) == 0) - break; - vm_object_set_flag(object, OBJ_DISCONNECTWNT); - VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead", 0); - } + object = vp->v_object; - KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); - if (object == NULL) { /* * Add an object of the appropriate size */ - object = vm_object_allocate(OBJT_VNODE, OFF_TO_IDX(round_page(size))); + object = vm_object_allocate(OBJT_VNODE, + OFF_TO_IDX(round_page(size))); object->un_pager.vnp.vnp_size = size; object->un_pager.vnp.writemappings = 0; @@ -290,7 +268,7 @@ retry: VI_LOCK(vp); if (vp->v_object != NULL) { /* - * Object has been created while we were sleeping + * Object has been created while we were allocating. */ VI_UNLOCK(vp); VM_OBJECT_WLOCK(object); @@ -305,6 +283,7 @@ retry: vp->v_object = object; VI_UNLOCK(vp); } else { + VM_OBJECT_WLOCK(object); object->ref_count++; #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); @@ -334,10 +313,6 @@ vnode_pager_dealloc(vm_object_t object) object->handle = NULL; object->type = OBJT_DEAD; - if (object->flags & OBJ_DISCONNECTWNT) { - vm_object_clear_flag(object, OBJ_DISCONNECTWNT); - wakeup(object); - } ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); if (object->un_pager.vnp.writemappings > 0) { object->un_pager.vnp.writemappings = 0; From owner-svn-src-head@freebsd.org Thu Aug 29 07:51:12 2019 Return-Path: Delivered-To: svn-src-head@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 3D1C0CD810; Thu, 29 Aug 2019 07:51:12 +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 46Jvtm1ZZmz4M4d; Thu, 29 Aug 2019 07:51:12 +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 18A891CC9E; Thu, 29 Aug 2019 07:51:12 +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 x7T7pCVG077565; Thu, 29 Aug 2019 07:51:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T7pB2X077563; Thu, 29 Aug 2019 07:51:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908290751.x7T7pB2X077563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 29 Aug 2019 07:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351599 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 351599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 07:51:12 -0000 Author: avg Date: Thu Aug 29 07:51:11 2019 New Revision: 351599 URL: https://svnweb.freebsd.org/changeset/base/351599 Log: scsi_cd: make the media check asynchronous This makes the media check process asynchronous, so we no longer block in cdstrategy() to check for media. PR: 219857 Obtained from: ken MFC after: 3 weeks Modified: head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_cd.h Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:50:25 2019 (r351598) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:51:11 2019 (r351599) @@ -114,13 +114,21 @@ typedef enum { CD_FLAG_RETRY_UA = 0x0200, CD_FLAG_VALID_MEDIA = 0x0400, CD_FLAG_VALID_TOC = 0x0800, - CD_FLAG_SCTX_INIT = 0x1000 + CD_FLAG_SCTX_INIT = 0x1000, + CD_FLAG_MEDIA_WAIT = 0x2000, + CD_FLAG_MEDIA_SCAN_ACT = 0x4000 } cd_flags; typedef enum { CD_CCB_PROBE = 0x01, CD_CCB_BUFFER_IO = 0x02, - CD_CCB_TUR = 0x04, + CD_CCB_TUR = 0x03, + CD_CCB_MEDIA_PREVENT = 0x04, + CD_CCB_MEDIA_ALLOW = 0x05, + CD_CCB_MEDIA_SIZE = 0x06, + CD_CCB_MEDIA_TOC_HDR = 0x07, + CD_CCB_MEDIA_TOC_FULL = 0x08, + CD_CCB_MEDIA_TOC_LEAD = 0x09, CD_CCB_TYPE_MASK = 0x0F, CD_CCB_RETRY_UA = 0x10 } cd_ccb_state; @@ -140,7 +148,13 @@ struct cd_toc_single { typedef enum { CD_STATE_PROBE, - CD_STATE_NORMAL + CD_STATE_NORMAL, + CD_STATE_MEDIA_PREVENT, + CD_STATE_MEDIA_ALLOW, + CD_STATE_MEDIA_SIZE, + CD_STATE_MEDIA_TOC_HDR, + CD_STATE_MEDIA_TOC_FULL, + CD_STATE_MEDIA_TOC_LEAD } cd_state; struct cd_softc { @@ -161,6 +175,8 @@ struct cd_softc { struct sysctl_oid *sysctl_tree; STAILQ_HEAD(, cd_mode_params) mode_queue; struct cd_tocdata toc; + int toc_read_len; + struct cd_toc_single leadout; struct disk *disk; struct callout mediapoll_c; @@ -246,7 +262,8 @@ static void cddone(struct cam_periph *periph, static union cd_pages *cdgetpage(struct cd_mode_params *mode_params); static int cdgetpagesize(int page_num); static void cdprevent(struct cam_periph *periph, int action); -static int cdcheckmedia(struct cam_periph *periph); +static void cdmediaprobedone(struct cam_periph *periph); +static int cdcheckmedia(struct cam_periph *periph, int do_wait); static int cdsize(struct cam_periph *periph, u_int32_t *size); static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, @@ -755,7 +772,7 @@ cdopen(struct disk *dp) * if we don't have media, but then we don't allow anything but the * CDIOCEJECT/CDIOCCLOSE ioctls if there is no media. */ - cdcheckmedia(periph); + cdcheckmedia(periph, /*do_wait*/ 1); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("leaving cdopen\n")); cam_periph_unhold(periph); @@ -851,27 +868,19 @@ cdstrategy(struct bio *bp) return; } - /* - * If we don't have valid media, look for it before trying to - * schedule the I/O. - */ - if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) { - int error; - - error = cdcheckmedia(periph); - if (error != 0) { - cam_periph_unlock(periph); - biofinish(bp, NULL, error); - return; - } - } - /* * Place it in the queue of disk activities for this disk */ bioq_disksort(&softc->bio_queue, bp); - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + /* + * If we don't know that we have valid media, schedule the media + * check first. The I/O will get executed after the media check. + */ + if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) + cdcheckmedia(periph, /*do_wait*/ 0); + else + xpt_schedule(periph, CAM_PRIORITY_NORMAL); cam_periph_unlock(periph); return; @@ -883,7 +892,6 @@ cdstart(struct cam_periph *periph, union ccb *start_cc struct cd_softc *softc; struct bio *bp; struct ccb_scsiio *csio; - struct scsi_read_capacity_data *rcap; softc = (struct cd_softc *)periph->softc; @@ -964,16 +972,40 @@ cdstart(struct cam_periph *periph, union ccb *start_cc break; } case CD_STATE_PROBE: + case CD_STATE_MEDIA_SIZE: { + struct scsi_read_capacity_data *rcap; rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap), M_SCSICD, M_NOWAIT | M_ZERO); if (rcap == NULL) { xpt_print(periph->path, - "cdstart: Couldn't malloc read_capacity data\n"); - /* cd_free_periph??? */ + "%s: Couldn't malloc read_capacity data\n", + __func__); + xpt_release_ccb(start_ccb); + /* + * We can't probe because we can't allocate memory, + * so invalidate the peripheral. The system probably + * has larger problems at this stage. If we've + * already probed (and are re-probing capacity), we + * don't need to invalidate. + * + * XXX KDM need to reset probe state and kick out + * pending I/O. + */ + if (softc->state == CD_STATE_PROBE) + cam_periph_invalidate(periph); break; } + + /* + * Set the default capacity and sector size to something that + * GEOM can handle. This will get reset when a read capacity + * completes successfully. + */ + softc->disk->d_sectorsize = 2048; + softc->disk->d_mediasize = 0; + csio = &start_ccb->csio; scsi_read_capacity(csio, /*retries*/ cd_retry_count, @@ -983,11 +1015,112 @@ cdstart(struct cam_periph *periph, union ccb *start_cc SSD_FULL_SIZE, /*timeout*/20000); start_ccb->ccb_h.ccb_bp = NULL; - start_ccb->ccb_h.ccb_state = CD_CCB_PROBE; + if (softc->state == CD_STATE_PROBE) + start_ccb->ccb_h.ccb_state = CD_CCB_PROBE; + else + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_SIZE; xpt_action(start_ccb); break; } + case CD_STATE_MEDIA_ALLOW: + case CD_STATE_MEDIA_PREVENT: + { + /* + * If the CD is already locked, we don't need to do this. + * Move on to the capacity check. + */ + if ((softc->flags & CD_FLAG_DISC_LOCKED) != 0) { + softc->state = CD_STATE_MEDIA_SIZE; + xpt_release_ccb(start_ccb); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + break; + } + + scsi_prevent(&start_ccb->csio, + /*retries*/ cd_retry_count, + /*cbfcnp*/ cddone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*action*/ (softc->state == CD_STATE_MEDIA_ALLOW) ? + PR_ALLOW : PR_PREVENT, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 60000); + + start_ccb->ccb_h.ccb_bp = NULL; + if (softc->state == CD_STATE_MEDIA_ALLOW) + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_ALLOW; + else + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_PREVENT; + xpt_action(start_ccb); + break; } + case CD_STATE_MEDIA_TOC_HDR: { + struct ioc_toc_header *toch; + + bzero(&softc->toc, sizeof(softc->toc)); + + toch = &softc->toc.header; + + scsi_read_toc(&start_ccb->csio, + /*retries*/ cd_retry_count, + /*cbfcnp*/ cddone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*byte1_flags*/ 0, + /*format*/ SRTOC_FORMAT_TOC, + /*track*/ 0, + /*data_ptr*/ (uint8_t *)toch, + /*dxfer_len*/ sizeof(*toch), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 50000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_TOC_HDR; + xpt_action(start_ccb); + break; + } + case CD_STATE_MEDIA_TOC_FULL: { + + bzero(&softc->toc, sizeof(softc->toc)); + + scsi_read_toc(&start_ccb->csio, + /*retries*/ cd_retry_count, + /*cbfcnp*/ cddone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*byte1_flags*/ 0, + /*format*/ SRTOC_FORMAT_TOC, + /*track*/ 0, + /*data_ptr*/ (uint8_t *)&softc->toc, + /*dxfer_len*/ softc->toc_read_len ? + softc->toc_read_len : + sizeof(softc->toc), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 50000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_TOC_FULL; + xpt_action(start_ccb); + break; + } + case CD_STATE_MEDIA_TOC_LEAD: { + struct cd_toc_single *leadout; + + leadout = &softc->leadout; + bzero(leadout, sizeof(*leadout)); + + scsi_read_toc(&start_ccb->csio, + /*retries*/ cd_retry_count, + /*cbfcnp*/ cddone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*byte1_flags*/ CD_MSF, + /*format*/ SRTOC_FORMAT_TOC, + /*track*/ LEADOUT, + /*data_ptr*/ (uint8_t *)leadout, + /*dxfer_len*/ sizeof(*leadout), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 50000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = CD_CCB_MEDIA_TOC_LEAD; + xpt_action(start_ccb); + break; + } + } } static void @@ -1251,6 +1384,293 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) cam_periph_release_locked(periph); return; } + case CD_CCB_MEDIA_ALLOW: + case CD_CCB_MEDIA_PREVENT: + { + int error; + int is_prevent; + + error = 0; + + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + error = cderror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_PRINT); + } + if (error == ERESTART) + return; + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + + /* + * Note that just like the original cdcheckmedia(), we do + * a prevent without failing the whole operation if the + * prevent fails. We try, but keep going if it doesn't + * work. + */ + + if ((done_ccb->ccb_h.ccb_state & CD_CCB_TYPE_MASK) == + CD_CCB_MEDIA_PREVENT) + is_prevent = 1; + else + is_prevent = 0; + + xpt_release_ccb(done_ccb); + + if (is_prevent != 0) { + if (error == 0) + softc->flags |= CD_FLAG_DISC_LOCKED; + else + softc->flags &= ~CD_FLAG_DISC_LOCKED; + softc->state = CD_STATE_MEDIA_SIZE; + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + } else { + if (error == 0) + softc->flags &= ~CD_FLAG_DISC_LOCKED; + softc->state = CD_STATE_NORMAL; + if (bioq_first(&softc->bio_queue) != NULL) + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + } + return; + } + case CD_CCB_MEDIA_SIZE: + { + struct scsi_read_capacity_data *rdcap; + int error; + + error = 0; + if ((csio->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + error = cderror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_PRINT); + } + if (error == ERESTART) + return; + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + rdcap = (struct scsi_read_capacity_data *)csio->data_ptr; + + if (error == 0) { + softc->params.disksize =scsi_4btoul(rdcap->addr) + 1; + softc->params.blksize = scsi_4btoul(rdcap->length); + + /* Make sure we got at least some block size. */ + if (softc->params.blksize == 0) + error = EIO; + /* + * SCSI-3 mandates that the reported blocksize shall be + * 2048. Older drives sometimes report funny values, + * trim it down to 2048, or other parts of the kernel + * will get confused. + * + * XXX we leave drives alone that might report 512 + * bytes, as well as drives reporting more weird + * sizes like perhaps 4K. + */ + if (softc->params.blksize > 2048 + && softc->params.blksize <= 2352) + softc->params.blksize = 2048; + } + free(rdcap, M_SCSICD); + + if (error == 0) { + softc->disk->d_sectorsize = softc->params.blksize; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * + softc->params.disksize; + softc->flags |= CD_FLAG_SAW_MEDIA | CD_FLAG_VALID_MEDIA; + softc->state = CD_STATE_MEDIA_TOC_HDR; + } else { + softc->flags &= ~(CD_FLAG_VALID_MEDIA | + CD_FLAG_VALID_TOC); + bioq_flush(&softc->bio_queue, NULL, EINVAL); + softc->state = CD_STATE_MEDIA_ALLOW; + cdmediaprobedone(periph); + } + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + return; + } + case CD_CCB_MEDIA_TOC_HDR: + case CD_CCB_MEDIA_TOC_FULL: + case CD_CCB_MEDIA_TOC_LEAD: + { + int error; + struct ioc_toc_header *toch; + int num_entries; + int cdindex; + + error = 0; + + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + error = cderror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_PRINT); + } + if (error == ERESTART) + return; + + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + + /* + * We will get errors here for media that doesn't have a table + * of contents. According to the MMC-3 spec: "When a Read + * TOC/PMA/ATIP command is presented for a DDCD/CD-R/RW media, + * where the first TOC has not been recorded (no complete + * session) and the Format codes 0000b, 0001b, or 0010b are + * specified, this command shall be rejected with an INVALID + * FIELD IN CDB. Devices that are not capable of reading an + * incomplete session on DDC/CD-R/RW media shall report + * CANNOT READ MEDIUM - INCOMPATIBLE FORMAT." + * + * So this isn't fatal if we can't read the table of contents, + * it just means that the user won't be able to issue the + * play tracks ioctl, and likely lots of other stuff won't + * work either. They need to burn the CD before we can do + * a whole lot with it. So we don't print anything here if + * we get an error back. + * + * We also bail out if the drive doesn't at least give us + * the full TOC header. + */ + if ((error != 0) + || ((csio->dxfer_len - csio->resid) < + sizeof(struct ioc_toc_header))) { + softc->flags &= ~CD_FLAG_VALID_TOC; + bzero(&softc->toc, sizeof(softc->toc)); + /* + * Failing the TOC read is not an error. + */ + softc->state = CD_STATE_NORMAL; + xpt_release_ccb(done_ccb); + + cdmediaprobedone(periph); + + /* + * Go ahead and schedule I/O execution if there is + * anything in the queue. It'll probably get + * kicked out with an error. + */ + if (bioq_first(&softc->bio_queue) != NULL) + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + return; + } + + /* + * Note that this is NOT the storage location used for the + * leadout! + */ + toch = &softc->toc.header; + + if (softc->quirks & CD_Q_BCD_TRACKS) { + toch->starting_track = bcd2bin(toch->starting_track); + toch->ending_track = bcd2bin(toch->ending_track); + } + + /* Number of TOC entries, plus leadout */ + num_entries = (toch->ending_track - toch->starting_track) + 2; + cdindex = toch->starting_track + num_entries -1; + + if ((done_ccb->ccb_h.ccb_state & CD_CCB_TYPE_MASK) == + CD_CCB_MEDIA_TOC_HDR) { + if (num_entries <= 0) { + softc->flags &= ~CD_FLAG_VALID_TOC; + bzero(&softc->toc, sizeof(softc->toc)); + /* + * Failing the TOC read is not an error. + */ + softc->state = CD_STATE_NORMAL; + xpt_release_ccb(done_ccb); + + cdmediaprobedone(periph); + + /* + * Go ahead and schedule I/O execution if + * there is anything in the queue. It'll + * probably get kicked out with an error. + */ + if (bioq_first(&softc->bio_queue) != NULL) + xpt_schedule(periph, + CAM_PRIORITY_NORMAL); + } else { + softc->toc_read_len = num_entries * + sizeof(struct cd_toc_entry); + softc->toc_read_len += sizeof(*toch); + + softc->state = CD_STATE_MEDIA_TOC_FULL; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + } + + return; + } else if ((done_ccb->ccb_h.ccb_state & CD_CCB_TYPE_MASK) == + CD_CCB_MEDIA_TOC_LEAD) { + struct cd_toc_single *leadout; + + leadout = (struct cd_toc_single *)csio->data_ptr; + softc->toc.entries[cdindex - toch->starting_track] = + leadout->entry; + } else if (((done_ccb->ccb_h.ccb_state & CD_CCB_TYPE_MASK) == + CD_CCB_MEDIA_TOC_FULL) + && (cdindex == toch->ending_track + 1)) { + /* + * XXX KDM is this necessary? Probably only if the + * drive doesn't return leadout information with the + * table of contents. + */ + softc->state = CD_STATE_MEDIA_TOC_LEAD; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + return; + } + + if (softc->quirks & CD_Q_BCD_TRACKS) { + for (cdindex = 0; cdindex < num_entries - 1; cdindex++){ + softc->toc.entries[cdindex].track = + bcd2bin(softc->toc.entries[cdindex].track); + } + } + + softc->flags |= CD_FLAG_VALID_TOC; + /* If the first track is audio, correct sector size. */ + if ((softc->toc.entries[0].control & 4) == 0) { + softc->disk->d_sectorsize =softc->params.blksize = 2352; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * + softc->params.disksize; + } + softc->state = CD_STATE_NORMAL; + + /* + * We unconditionally (re)set the blocksize each time the + * CD device is opened. This is because the CD can change, + * and therefore the blocksize might change. + * XXX problems here if some slice or partition is still + * open with the old size? + */ + if ((softc->disk->d_devstat->flags & DEVSTAT_BS_UNAVAILABLE)!=0) + softc->disk->d_devstat->flags &= + ~DEVSTAT_BS_UNAVAILABLE; + softc->disk->d_devstat->block_size = softc->params.blksize; + + xpt_release_ccb(done_ccb); + + cdmediaprobedone(periph); + + if (bioq_first(&softc->bio_queue) != NULL) + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + return; + } default: break; } @@ -1343,7 +1763,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f && ((cmd != CDIOCCLOSE) && (cmd != CDIOCEJECT)) && (IOCGROUP(cmd) == 'c')) { - error = cdcheckmedia(periph); + error = cdcheckmedia(periph, /*do_wait*/ 1); if (error != 0) { cam_periph_unhold(periph); cam_periph_unlock(periph); @@ -2227,11 +2647,66 @@ cdprevent(struct cam_periph *periph, int action) } } +static void +cdmediaprobedone(struct cam_periph *periph) +{ + struct cd_softc *softc; + + softc = (struct cd_softc *)periph->softc; + + softc->flags &= ~CD_FLAG_MEDIA_SCAN_ACT; + + if ((softc->flags & CD_FLAG_MEDIA_WAIT) != 0) { + softc->flags &= ~CD_FLAG_MEDIA_WAIT; + wakeup(&softc->toc); + } +} + /* * XXX: the disk media and sector size is only really able to change * XXX: while the device is closed. */ + static int +cdcheckmedia(struct cam_periph *periph, int do_wait) +{ + struct cd_softc *softc; + int error; + + softc = (struct cd_softc *)periph->softc; + error = 0; + + if ((do_wait != 0) + && ((softc->flags & CD_FLAG_MEDIA_WAIT) == 0)) { + softc->flags |= CD_FLAG_MEDIA_WAIT; + } + if ((softc->flags & CD_FLAG_MEDIA_SCAN_ACT) == 0) { + softc->state = CD_STATE_MEDIA_PREVENT; + softc->flags |= CD_FLAG_MEDIA_SCAN_ACT; + xpt_schedule(periph, CAM_PRIORITY_NORMAL); + } + + if (do_wait == 0) + goto bailout; + + error = msleep(&softc->toc, cam_periph_mtx(periph), PRIBIO,"cdmedia",0); + + if (error != 0) + goto bailout; + + /* + * Check to see whether we have a valid size from the media. We + * may or may not have a valid TOC. + */ + if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) + error = EINVAL; +bailout: + + return (error); +} + +#if 0 +static int cdcheckmedia(struct cam_periph *periph) { struct cd_softc *softc; @@ -2371,6 +2846,7 @@ bailout: return (error); } +#endif static int cdsize(struct cam_periph *periph, u_int32_t *size) @@ -2650,7 +3126,6 @@ static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags) { - struct scsi_read_toc *scsi_cmd; u_int32_t ntoc; struct ccb_scsiio *csio; union ccb *ccb; @@ -2663,29 +3138,18 @@ cdreadtoc(struct cam_periph *periph, u_int32_t mode, u csio = &ccb->csio; - cam_fill_csio(csio, + scsi_read_toc(csio, /* retries */ cd_retry_count, /* cbfcnp */ NULL, - /* flags */ CAM_DIR_IN, /* tag_action */ MSG_SIMPLE_Q_TAG, + /* byte1_flags */ (mode == CD_MSF_FORMAT) ? CD_MSF : 0, + /* format */ SRTOC_FORMAT_TOC, + /* track*/ start, /* data_ptr */ data, /* dxfer_len */ len, /* sense_len */ SSD_FULL_SIZE, - sizeof(struct scsi_read_toc), - /* timeout */ 50000); + /* timeout */ 50000); - scsi_cmd = (struct scsi_read_toc *)&csio->cdb_io.cdb_bytes; - bzero (scsi_cmd, sizeof(*scsi_cmd)); - - if (mode == CD_MSF_FORMAT) - scsi_cmd->byte2 |= CD_MSF; - scsi_cmd->from_track = start; - /* scsi_ulto2b(ntoc, (u_int8_t *)scsi_cmd->data_len); */ - scsi_cmd->data_len[0] = (ntoc) >> 8; - scsi_cmd->data_len[1] = (ntoc) & 0xff; - - scsi_cmd->op_code = READ_TOC; - error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA | sense_flags); @@ -3742,4 +4206,39 @@ scsi_read_dvd_structure(struct ccb_scsiio *csio, u_int sense_len, sizeof(*scsi_cmd), timeout); +} + +void +scsi_read_toc(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t byte1_flags, uint8_t format, + uint8_t track, uint8_t *data_ptr, uint32_t dxfer_len, + int sense_len, int timeout) +{ + struct scsi_read_toc *scsi_cmd; + + scsi_cmd = (struct scsi_read_toc *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->op_code = READ_TOC; + + /* + * The structure is counting from 1, the function counting from 0. + * The spec counts from 0. In MMC-6, there is only one flag, the + * MSF flag. But we put the whole byte in for a bit a future-proofing. + */ + scsi_cmd->byte2 = byte1_flags; + scsi_cmd->format = format; + scsi_cmd->from_track = track; + scsi_ulto2b(dxfer_len, scsi_cmd->data_len); + + cam_fill_csio(csio, + /* retries */ retries, + /* cbfcnp */ cbfcnp, + /* flags */ CAM_DIR_IN, + /* tag_action */ tag_action, + /* data_ptr */ data_ptr, + /* dxfer_len */ dxfer_len, + /* sense_len */ sense_len, + sizeof(*scsi_cmd), + /* timeout */ timeout); } Modified: head/sys/cam/scsi/scsi_cd.h ============================================================================== --- head/sys/cam/scsi/scsi_cd.h Thu Aug 29 07:50:25 2019 (r351598) +++ head/sys/cam/scsi/scsi_cd.h Thu Aug 29 07:51:11 2019 (r351599) @@ -231,6 +231,12 @@ struct scsi_read_toc u_int8_t op_code; u_int8_t byte2; u_int8_t format; +#define SRTOC_FORMAT_TOC 0x00 +#define SRTOC_FORMAT_LAST_ADDR 0x01 +#define SRTOC_FORMAT_QSUB_TOC 0x02 +#define SRTOC_FORMAT_QSUB_PMA 0x03 +#define SRTOC_FORMAT_ATIP 0x04 +#define SRTOC_FORMAT_CD_TEXT 0x05 u_int8_t unused[3]; u_int8_t from_track; u_int8_t data_len[2]; @@ -870,6 +876,12 @@ void scsi_read_dvd_structure(struct ccb_scsiio *csio, u_int8_t agid, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); + +void scsi_read_toc(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t byte1_flags, uint8_t format, + uint8_t track, uint8_t *data_ptr, uint32_t dxfer_len, + int sense_len, int timeout); __END_DECLS From owner-svn-src-head@freebsd.org Thu Aug 29 08:19:12 2019 Return-Path: Delivered-To: svn-src-head@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 057E4CEE30; Thu, 29 Aug 2019 08:19:12 +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 46JwW36L80z4NVh; Thu, 29 Aug 2019 08:19:11 +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 BBFCB1D0F2; Thu, 29 Aug 2019 08:19:11 +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 x7T8JBs0093434; Thu, 29 Aug 2019 08:19:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T8JBn4093433; Thu, 29 Aug 2019 08:19:11 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908290819.x7T8JBn4093433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 29 Aug 2019 08:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351600 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 351600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 08:19:12 -0000 Author: avg Date: Thu Aug 29 08:19:11 2019 New Revision: 351600 URL: https://svnweb.freebsd.org/changeset/base/351600 Log: scsi_cd: ifdef out cdsize() It was used only by the old cdcheckmedia(). MFC after: 3 weeks Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:51:11 2019 (r351599) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:19:11 2019 (r351600) @@ -264,7 +264,9 @@ static int cdgetpagesize(int page_num); static void cdprevent(struct cam_periph *periph, int action); static void cdmediaprobedone(struct cam_periph *periph); static int cdcheckmedia(struct cam_periph *periph, int do_wait); +#if 0 static int cdsize(struct cam_periph *periph, u_int32_t *size); +#endif static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); @@ -2846,7 +2848,6 @@ bailout: return (error); } -#endif static int cdsize(struct cam_periph *periph, u_int32_t *size) @@ -2903,6 +2904,7 @@ cdsize(struct cam_periph *periph, u_int32_t *size) return (error); } +#endif static int cd6byteworkaround(union ccb *ccb) From owner-svn-src-head@freebsd.org Thu Aug 29 08:26:40 2019 Return-Path: Delivered-To: svn-src-head@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 7E349CF133; Thu, 29 Aug 2019 08:26:40 +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 46Jwgh3RdCz4NwF; Thu, 29 Aug 2019 08:26:40 +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 591E91D2B8; Thu, 29 Aug 2019 08:26:40 +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 x7T8Qet8099195; Thu, 29 Aug 2019 08:26:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7T8Qe3C099193; Thu, 29 Aug 2019 08:26:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908290826.x7T8Qe3C099193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 29 Aug 2019 08:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351601 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 351601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 08:26:40 -0000 Author: avg Date: Thu Aug 29 08:26:40 2019 New Revision: 351601 URL: https://svnweb.freebsd.org/changeset/base/351601 Log: scsi_cd: whitespace cleanup Remove trailing whitespace and fix mixed indentation. MFC after: 3 weeks Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:19:11 2019 (r351600) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:26:40 2019 (r351601) @@ -270,25 +270,25 @@ static int cdsize(struct cam_periph *periph, u_int32_ static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, - u_int32_t start, u_int8_t *data, +static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, + u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags); -static int cdgetmode(struct cam_periph *periph, +static int cdgetmode(struct cam_periph *periph, struct cd_mode_params *data, u_int32_t page); static int cdsetmode(struct cam_periph *periph, struct cd_mode_params *data); -static int cdplay(struct cam_periph *periph, u_int32_t blk, +static int cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len); -static int cdreadsubchannel(struct cam_periph *periph, - u_int32_t mode, u_int32_t format, - int track, - struct cd_sub_channel_info *data, +static int cdreadsubchannel(struct cam_periph *periph, + u_int32_t mode, u_int32_t format, + int track, + struct cd_sub_channel_info *data, u_int32_t len); -static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, - u_int32_t starts, u_int32_t startf, - u_int32_t endm, u_int32_t ends, +static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, + u_int32_t starts, u_int32_t startf, + u_int32_t endm, u_int32_t ends, u_int32_t endf); -static int cdplaytracks(struct cam_periph *periph, +static int cdplaytracks(struct cam_periph *periph, u_int32_t strack, u_int32_t sindex, u_int32_t etrack, u_int32_t eindex); static int cdpause(struct cam_periph *periph, u_int32_t go); @@ -599,7 +599,7 @@ cdregister(struct cam_periph *periph, void *arg) M_NOWAIT | M_ZERO); if (softc == NULL) { printf("cdregister: Unable to probe new device. " - "Unable to allocate softc\n"); + "Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } @@ -876,7 +876,7 @@ cdstrategy(struct bio *bp) bioq_disksort(&softc->bio_queue, bp); /* - * If we don't know that we have valid media, schedule the media + * If we don't know that we have valid media, schedule the media * check first. The I/O will get executed after the media check. */ if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) @@ -951,7 +951,6 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; - LIST_INSERT_HEAD(&softc->pending_ccbs, &start_ccb->ccb_h, periph_links.le); softc->outstanding_cmds++; @@ -1038,7 +1037,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc break; } - scsi_prevent(&start_ccb->csio, + scsi_prevent(&start_ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/ cddone, /*tag_action*/ MSG_SIMPLE_Q_TAG, @@ -1057,7 +1056,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } case CD_STATE_MEDIA_TOC_HDR: { struct ioc_toc_header *toch; - + bzero(&softc->toc, sizeof(softc->toc)); toch = &softc->toc.header; @@ -1069,7 +1068,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc /*byte1_flags*/ 0, /*format*/ SRTOC_FORMAT_TOC, /*track*/ 0, - /*data_ptr*/ (uint8_t *)toch, + /*data_ptr*/ (uint8_t *)toch, /*dxfer_len*/ sizeof(*toch), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 50000); @@ -1113,7 +1112,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc /*byte1_flags*/ CD_MSF, /*format*/ SRTOC_FORMAT_TOC, /*track*/ LEADOUT, - /*data_ptr*/ (uint8_t *)leadout, + /*data_ptr*/ (uint8_t *)leadout, /*dxfer_len*/ sizeof(*leadout), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 50000); @@ -1127,7 +1126,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc static void cddone(struct cam_periph *periph, union ccb *done_ccb) -{ +{ struct cd_softc *softc; struct ccb_scsiio *csio; @@ -1182,7 +1181,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) bp->bio_error = 0; if (bp->bio_resid != 0) { /* - * Short transfer ??? + * Short transfer ??? * XXX: not sure this is correct for partial * transfers at EOM */ @@ -1208,7 +1207,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) bzero(announce_buf, CD_ANNOUNCETMP_SZ); rdcap = (struct scsi_read_capacity_data *)csio->data_ptr; - + cdp->disksize = scsi_4btoul (rdcap->addr) + 1; cdp->blksize = scsi_4btoul (rdcap->length); @@ -1248,7 +1247,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) status = done_ccb->ccb_h.status; - xpt_setup_ccb(&cgd.ccb_h, + xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; @@ -1282,15 +1281,15 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) "size failed: %s, %s", sense_key_desc, asc_desc); - } else if ((have_sense == 0) - && ((status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (csio->scsi_status == - SCSI_STATUS_BUSY)) { - snprintf(announce_buf, + } else if ((have_sense == 0) + && ((status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) + && (csio->scsi_status == + SCSI_STATUS_BUSY)) { + snprintf(announce_buf, CD_ANNOUNCETMP_SZ, - "Attempt to query device " - "size failed: SCSI Status: %s", + "Attempt to query device " + "size failed: SCSI Status: %s", scsi_status_string(csio)); } else if (SID_TYPE(&cgd.inq_data) == T_CDROM) { /* @@ -1301,7 +1300,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * don't support CDROM commands. * If we have sense information, go * ahead and print it out. - * Otherwise, just say that we + * Otherwise, just say that we * couldn't attach. */ @@ -1354,7 +1353,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) */ taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); } - softc->state = CD_STATE_NORMAL; + softc->state = CD_STATE_NORMAL; /* * Since our peripheral may be invalidated by an error * above or an external event, we must release our CCB @@ -1386,7 +1385,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) cam_periph_release_locked(periph); return; } - case CD_CCB_MEDIA_ALLOW: + case CD_CCB_MEDIA_ALLOW: case CD_CCB_MEDIA_PREVENT: { int error; @@ -1526,12 +1525,12 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) /* * We will get errors here for media that doesn't have a table - * of contents. According to the MMC-3 spec: "When a Read + * of contents. According to the MMC-3 spec: "When a Read * TOC/PMA/ATIP command is presented for a DDCD/CD-R/RW media, * where the first TOC has not been recorded (no complete * session) and the Format codes 0000b, 0001b, or 0010b are - * specified, this command shall be rejected with an INVALID - * FIELD IN CDB. Devices that are not capable of reading an + * specified, this command shall be rejected with an INVALID + * FIELD IN CDB. Devices that are not capable of reading an * incomplete session on DDC/CD-R/RW media shall report * CANNOT READ MEDIUM - INCOMPATIBLE FORMAT." * @@ -1792,7 +1791,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYTRACKS\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -1838,7 +1837,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f softc->toc.header.starting_track; if ((st < 0) || (et < 0) - || (st > (softc->toc.header.ending_track - + || (st > (softc->toc.header.ending_track - softc->toc.header.starting_track))) { error = EINVAL; cam_periph_unlock(periph); @@ -1888,7 +1887,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYMSF\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -1929,7 +1928,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYBLOCKS\n")); @@ -1960,11 +1959,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f struct cd_sub_channel_info *data; u_int32_t len = args->data_len; - data = malloc(sizeof(struct cd_sub_channel_info), + data = malloc(sizeof(struct cd_sub_channel_info), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCREADSUBCHANNEL\n")); if ((len > sizeof(struct cd_sub_channel_info)) || @@ -1988,7 +1987,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f if (error) { free(data, M_SCSICD); cam_periph_unlock(periph); - break; + break; } if (softc->quirks & CD_Q_BCD_TRACKS) data->what.track_info.track_number = @@ -2010,10 +2009,10 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCHEADER\n")); - error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, + error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, sizeof (*th), /*sense_flags*/SF_NO_PRINT); if (error) { free(th, M_SCSICD); @@ -2024,7 +2023,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f /* we are going to have to convert the BCD * encoding on the cd to what is expected */ - th->starting_track = + th->starting_track = bcd2bin(th->starting_track); th->ending_track = bcd2bin(th->ending_track); } @@ -2051,7 +2050,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCENTRYS\n")); if (te->data_len < sizeof(struct cd_toc_entry) @@ -2068,7 +2067,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } th = &data->header; - error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, + error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, sizeof (*th), /*sense_flags*/0); if (error) { free(data, M_SCSICD); @@ -2152,7 +2151,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f cam_periph_unlock(periph); break; } - data->entries[idx - starting_track] = + data->entries[idx - starting_track] = lead->entry; } if (softc->quirks & CD_Q_BCD_TRACKS) { @@ -2180,7 +2179,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCENTRY\n")); if (te->address_format != CD_MSF_FORMAT @@ -2249,11 +2248,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETPATCH\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2264,9 +2263,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = arg->patch[0]; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = arg->patch[1]; page->audio.port[2].channels = arg->patch[2]; page->audio.port[3].channels = arg->patch[3]; @@ -2282,11 +2281,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCGETVOL\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2297,9 +2296,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - arg->vol[LEFT_PORT] = + arg->vol[LEFT_PORT] = page->audio.port[LEFT_PORT].volume; - arg->vol[RIGHT_PORT] = + arg->vol[RIGHT_PORT] = page->audio.port[RIGHT_PORT].volume; arg->vol[2] = page->audio.port[2].volume; arg->vol[3] = page->audio.port[3].volume; @@ -2314,11 +2313,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETVOL\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2330,10 +2329,10 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f page = cdgetpage(¶ms); page->audio.port[LEFT_PORT].channels = CHANNEL_0; - page->audio.port[LEFT_PORT].volume = + page->audio.port[LEFT_PORT].volume = arg->vol[LEFT_PORT]; page->audio.port[RIGHT_PORT].channels = CHANNEL_1; - page->audio.port[RIGHT_PORT].volume = + page->audio.port[RIGHT_PORT].volume = arg->vol[RIGHT_PORT]; page->audio.port[2].volume = arg->vol[2]; page->audio.port[3].volume = arg->vol[3]; @@ -2352,7 +2351,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETMONO\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2363,9 +2362,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL; page->audio.port[2].channels = 0; page->audio.port[3].channels = 0; @@ -2384,7 +2383,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETSTEREO\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2395,9 +2394,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = LEFT_CHANNEL; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = RIGHT_CHANNEL; page->audio.port[2].channels = 0; page->audio.port[3].channels = 0; @@ -2416,7 +2415,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETMUTE\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2446,7 +2445,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETLEFT\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2476,7 +2475,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETRIGHT\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2598,7 +2597,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f cam_periph_lock(periph); cam_periph_unhold(periph); - + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("leaving cdioctl\n")); if (error && bootverbose) { printf("scsi_cd.c::ioctl cmd=%08lx error=%d\n", cmd, error); @@ -2618,24 +2617,24 @@ cdprevent(struct cam_periph *periph, int action) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdprevent\n")); softc = (struct cd_softc *)periph->softc; - + if (((action == PR_ALLOW) && (softc->flags & CD_FLAG_DISC_LOCKED) == 0) || ((action == PR_PREVENT) && (softc->flags & CD_FLAG_DISC_LOCKED) != 0)) { return; } - + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); - scsi_prevent(&ccb->csio, + scsi_prevent(&ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/NULL, MSG_SIMPLE_Q_TAG, action, SSD_FULL_SIZE, /* timeout */60000); - + error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA|SF_NO_PRINT); @@ -2692,7 +2691,7 @@ cdcheckmedia(struct cam_periph *periph, int do_wait) goto bailout; error = msleep(&softc->toc, cam_periph_mtx(periph), PRIBIO,"cdmedia",0); - + if (error != 0) goto bailout; @@ -2807,7 +2806,7 @@ cdcheckmedia(struct cam_periph *periph) cdindex = toch->starting_track + num_entries -1; if (cdindex == toch->ending_track + 1) { - error = cdreadtoc(periph, CD_MSF_FORMAT, LEADOUT, + error = cdreadtoc(periph, CD_MSF_FORMAT, LEADOUT, (u_int8_t *)&leadout, sizeof(leadout), SF_NO_PRINT); if (error != 0) { @@ -2860,16 +2859,16 @@ cdsize(struct cam_periph *periph, u_int32_t *size) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdsize\n")); softc = (struct cd_softc *)periph->softc; - + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); /* XXX Should be M_WAITOK */ - rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), + rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), M_SCSICD, M_NOWAIT | M_ZERO); if (rcap_buf == NULL) return (ENOMEM); - scsi_read_capacity(&ccb->csio, + scsi_read_capacity(&ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/NULL, MSG_SIMPLE_Q_TAG, @@ -2969,9 +2968,9 @@ cd6byteworkaround(union ccb *ccb) ms6 = (struct scsi_mode_sense_6 *)cdb; bzero(&ms10, sizeof(ms10)); - ms10.opcode = MODE_SENSE_10; - ms10.byte2 = ms6->byte2; - ms10.page = ms6->page; + ms10.opcode = MODE_SENSE_10; + ms10.byte2 = ms6->byte2; + ms10.page = ms6->page; /* * 10 byte mode header, block descriptor, @@ -3124,8 +3123,8 @@ cdmediapoll(void *arg) /* * Read table of contents */ -static int -cdreadtoc(struct cam_periph *periph, u_int32_t mode, u_int32_t start, +static int +cdreadtoc(struct cam_periph *periph, u_int32_t mode, u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags) { u_int32_t ntoc; @@ -3141,7 +3140,7 @@ cdreadtoc(struct cam_periph *periph, u_int32_t mode, u csio = &ccb->csio; scsi_read_toc(csio, - /* retries */ cd_retry_count, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* tag_action */ MSG_SIMPLE_Q_TAG, /* byte1_flags */ (mode == CD_MSF_FORMAT) ? CD_MSF : 0, @@ -3161,9 +3160,9 @@ cdreadtoc(struct cam_periph *periph, u_int32_t mode, u } static int -cdreadsubchannel(struct cam_periph *periph, u_int32_t mode, - u_int32_t format, int track, - struct cd_sub_channel_info *data, u_int32_t len) +cdreadsubchannel(struct cam_periph *periph, u_int32_t mode, + u_int32_t format, int track, + struct cd_sub_channel_info *data, u_int32_t len) { struct scsi_read_subchannel *scsi_cmd; struct ccb_scsiio *csio; @@ -3176,8 +3175,8 @@ cdreadsubchannel(struct cam_periph *periph, u_int32_t csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_IN, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3185,7 +3184,7 @@ cdreadsubchannel(struct cam_periph *periph, u_int32_t /* dxfer_len */ len, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_read_subchannel), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_read_subchannel *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3406,7 +3405,7 @@ cdsetmode(struct cam_periph *periph, struct cd_mode_pa } -static int +static int cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len) { struct ccb_scsiio *csio; @@ -3476,8 +3475,8 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3485,7 +3484,7 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_play_msf), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_play_msf *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3496,11 +3495,11 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, scsi_cmd->start_f = startf; scsi_cmd->end_m = endm; scsi_cmd->end_s = ends; - scsi_cmd->end_f = endf; + scsi_cmd->end_f = endf; error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); - + xpt_release_ccb(ccb); return(error); @@ -3522,8 +3521,8 @@ cdplaytracks(struct cam_periph *periph, u_int32_t stra csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3531,7 +3530,7 @@ cdplaytracks(struct cam_periph *periph, u_int32_t stra /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_play_track), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_play_track *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3564,8 +3563,8 @@ cdpause(struct cam_periph *periph, u_int32_t go) csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3573,7 +3572,7 @@ cdpause(struct cam_periph *periph, u_int32_t go) /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_pause), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_pause *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3672,7 +3671,7 @@ cdsetspeed(struct cam_periph *periph, u_int32_t rdspee /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_set_speed), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_set_speed *)&csio->cdb_io.cdb_bytes; bzero(scsi_cmd, sizeof(*scsi_cmd)); @@ -4095,7 +4094,7 @@ cdreaddvdstructure(struct cam_periph *periph, struct d * Tell the user what the overall length is, no matter * what we can actually fit in the data buffer. */ - dvdstruct->length = length - ccb->csio.resid - + dvdstruct->length = length - ccb->csio.resid - sizeof(struct scsi_read_dvd_struct_data_header); /* @@ -4233,8 +4232,8 @@ scsi_read_toc(struct ccb_scsiio *csio, uint32_t retrie scsi_cmd->from_track = track; scsi_ulto2b(dxfer_len, scsi_cmd->data_len); - cam_fill_csio(csio, - /* retries */ retries, + cam_fill_csio(csio, + /* retries */ retries, /* cbfcnp */ cbfcnp, /* flags */ CAM_DIR_IN, /* tag_action */ tag_action, @@ -4242,5 +4241,5 @@ scsi_read_toc(struct ccb_scsiio *csio, uint32_t retrie /* dxfer_len */ dxfer_len, /* sense_len */ sense_len, sizeof(*scsi_cmd), - /* timeout */ timeout); + /* timeout */ timeout); } From owner-svn-src-head@freebsd.org Thu Aug 29 12:05:06 2019 Return-Path: Delivered-To: svn-src-head@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 E74F0D46E8; Thu, 29 Aug 2019 12:05:06 +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 46K1Wk5rxVz4ZZ5; Thu, 29 Aug 2019 12:05:06 +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 AA9A91FA72; Thu, 29 Aug 2019 12:05:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TC56Sj028330; Thu, 29 Aug 2019 12:05:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TC56qJ028329; Thu, 29 Aug 2019 12:05:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908291205.x7TC56qJ028329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Aug 2019 12:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351603 - head/sys/dev/vnic X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vnic X-SVN-Commit-Revision: 351603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 12:05:07 -0000 Author: emaste Date: Thu Aug 29 12:05:06 2019 New Revision: 351603 URL: https://svnweb.freebsd.org/changeset/base/351603 Log: vnic: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vnic/thunder_bgx.c Modified: head/sys/dev/vnic/thunder_bgx.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 09:29:39 2019 (r351602) +++ head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 12:05:06 2019 (r351603) @@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx bgx_idx += node * MAX_BGX_PER_CN88XX; bgx = bgx_vnic[bgx_idx]; - if (!bgx) { - device_printf(bgx->dev, - "BGX%d not yet initialized, ignoring DMAC addition\n", + if (bgx == NULL) { + printf("BGX%d not yet initialized, ignoring DMAC addition\n", bgx_idx); return; } From owner-svn-src-head@freebsd.org Thu Aug 29 12:49:22 2019 Return-Path: Delivered-To: svn-src-head@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 54414D563A; Thu, 29 Aug 2019 12:49:22 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46K2Vp1XlSz4d1p; Thu, 29 Aug 2019 12:49:22 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12750201A7; Thu, 29 Aug 2019 12:49:22 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TCnLie052928; Thu, 29 Aug 2019 12:49:21 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TCnLMi052927; Thu, 29 Aug 2019 12:49:21 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201908291249.x7TCnLMi052927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 29 Aug 2019 12:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351604 - head/sys/dev/ichsmb X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/sys/dev/ichsmb X-SVN-Commit-Revision: 351604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 12:49:22 -0000 Author: yuripv Date: Thu Aug 29 12:49:21 2019 New Revision: 351604 URL: https://svnweb.freebsd.org/changeset/base/351604 Log: ichsmb: defer smbus attach until interrupts are available This fixes a "timed sleep before timers are working" panic seen while attaching jedec_dimm(4) instances too early in the boot. Submitted by: ian Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D21452 Modified: head/sys/dev/ichsmb/ichsmb.c Modified: head/sys/dev/ichsmb/ichsmb.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb.c Thu Aug 29 12:05:06 2019 (r351603) +++ head/sys/dev/ichsmb/ichsmb.c Thu Aug 29 12:49:21 2019 (r351604) @@ -131,11 +131,8 @@ ichsmb_attach(device_t dev) goto fail; } - /* Attach "smbus" child */ - if ((error = bus_generic_attach(dev)) != 0) { - device_printf(dev, "failed to attach child: %d\n", error); - goto fail; - } + /* Probe and attach the smbus when interrupts are available */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); return (0); From owner-svn-src-head@freebsd.org Thu Aug 29 13:46:56 2019 Return-Path: Delivered-To: svn-src-head@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 570B6D67E6; Thu, 29 Aug 2019 13:46:56 +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 46K3nD1XqYz3CLP; Thu, 29 Aug 2019 13:46:56 +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 1240E20C59; Thu, 29 Aug 2019 13:46:56 +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 x7TDktCQ088193; Thu, 29 Aug 2019 13:46:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TDkt1H088187; Thu, 29 Aug 2019 13:46:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908291346.x7TDkt1H088187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Aug 2019 13:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351605 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 351605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 13:46:56 -0000 Author: mav Date: Thu Aug 29 13:46:54 2019 New Revision: 351605 URL: https://svnweb.freebsd.org/changeset/base/351605 Log: Man page for AMD Non-Transparent Bridge (ntb_hw_amd) driver. Submitted by: Rajesh Kumar Reviewed by: bcr MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21462 Added: head/share/man/man4/ntb_hw_amd.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/ntb.4 head/share/man/man4/ntb_transport.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Aug 29 12:49:21 2019 (r351604) +++ head/share/man/man4/Makefile Thu Aug 29 13:46:54 2019 (r351605) @@ -371,6 +371,7 @@ MAN= aac.4 \ ng_vlan.4 \ nmdm.4 \ ${_ntb.4} \ + ${_ntb_hw_amd.4} \ ${_ntb_hw_intel.4} \ ${_ntb_hw_plx.4} \ ${_ntb_transport.4} \ @@ -795,6 +796,7 @@ _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _if_ntb.4= if_ntb.4 _ntb.4= ntb.4 +_ntb_hw_amd.4= ntb_hw_amd.4 _ntb_hw_intel.4= ntb_hw_intel.4 _ntb_hw_plx.4= ntb_hw_plx.4 _ntb_transport.4=ntb_transport.4 Modified: head/share/man/man4/ntb.4 ============================================================================== --- head/share/man/man4/ntb.4 Thu Aug 29 12:49:21 2019 (r351604) +++ head/share/man/man4/ntb.4 Thu Aug 29 13:46:54 2019 (r351605) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2017 +.Dd August 29, 2019 .Dt NTB 4 .Os .Sh NAME @@ -66,7 +66,7 @@ The default configuration is empty string, which means with all available resources, allowing any driver to attach. .El .Sh DESCRIPTION -Non-Transparent Bridges allow to connect two computer systems with PCIe +Non-Transparent Bridges connect two computer systems with PCIe link(s), providing each of them limited access to others memory space, scratchpad registers and interrupts. The @@ -76,9 +76,10 @@ and splits them between several functions, according t configuration. .Sh SEE ALSO .Xr if_ntb 4 , -.Xr ntb_transport 4 , +.Xr ntb_hw_amd 4 , .Xr ntb_hw_intel 4 , -.Xr ntb_hw_plx 4 +.Xr ntb_hw_plx 4 , +.Xr ntb_transport 4 .Sh AUTHORS .An -nosplit The Added: head/share/man/man4/ntb_hw_amd.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ntb_hw_amd.4 Thu Aug 29 13:46:54 2019 (r351605) @@ -0,0 +1,94 @@ +.\" +.\" Copyright (c) 2019 Rajesh Kumar +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 29, 2019 +.Dt NTB_HW_AMD 4 +.Os +.Sh NAME +.Nm ntb_hw_amd +.Nd AMD Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb" +.Cd "device ntb_hw_amd" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_hw_amd_load="YES" +.Ed +.Pp +The following sysctls are supported in this driver +.Bl -ohang +.It Va dev.ntb_hw.X.info +Reading this sysctl will give the basic details like the number of memory +windows, scratchpads and doorbells exposed by the NTB on the local host to +access the devices beyond the bridge. +It also provides details about the masked doorbells, translation address and +size limit of each exposed memory window and link status information. +.El +.Sh DESCRIPTION +The +.Nm ntb_hw_amd +driver provides support for the Non-Transparent Bridge (NTB) hardware in +AMD EPYC processor family. +The Non-Transparent Bridge does not look as a regular PCI bridge, but as PCI +endpoint device, hiding the devices behind it. +The driver hides details of hardware on the other side, but exposes memory windows, +scratchpads and doorbells to access the other side via hardware independent +KPI to +.Xr ntb 4 +subsystem. +.Pp +The hardware provides 2 (both 64-bit) or 3 (one 32-bit and two 64-bit) memory +windows to the other system's memory, up to 16 scratchpad registers and 16 +doorbells to communicate with and interrupt the other system respectively. +.Sh CONFIGURATION +The NTB configuration should be set by BIOS. +This includes enabling NTB, choosing topology (only NTB-to-Root Port +mode is supported now), role of the host in the topology. +This needs to be done on both systems. +.Pp +The BAR size for memory windows is configured to 1 MiB by default. +.Sh SEE ALSO +.Xr if_ntb 4 , +.Xr ntb 4 , +.Xr ntb_transport 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by AMD and originally written by +.An Rajesh Kumar Aq Mt rajesh1.kumar@amd.com . +Reviewed by +.An Alexander Motin Aq Mt mav@FreeBSD.org , +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Warner Losh Aq Mt imp@FreeBSD.org . Modified: head/share/man/man4/ntb_transport.4 ============================================================================== --- head/share/man/man4/ntb_transport.4 Thu Aug 29 12:49:21 2019 (r351604) +++ head/share/man/man4/ntb_transport.4 Thu Aug 29 13:46:54 2019 (r351605) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2019 +.Dd August 29, 2019 .Dt NTB_TRANSPORT 4 .Os .Sh NAME @@ -92,6 +92,7 @@ instance: .Sh SEE ALSO .Xr if_ntb 4 , .Xr ntb 4 , +.Xr ntb_hw_amd 4 , .Xr ntb_hw_intel 4 , .Xr ntb_hw_plx 4 .Sh AUTHORS From owner-svn-src-head@freebsd.org Thu Aug 29 17:02:03 2019 Return-Path: Delivered-To: svn-src-head@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 D10E0DB621; Thu, 29 Aug 2019 17:02:03 +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 46K86M53YPz3R2p; Thu, 29 Aug 2019 17:02:03 +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 8B59823024; Thu, 29 Aug 2019 17:02:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TH236m006563; Thu, 29 Aug 2019 17:02:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TH22xM006558; Thu, 29 Aug 2019 17:02:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908291702.x7TH22xM006558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Aug 2019 17:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351606 - in head/sys/cam: ata mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: ata mmc nvme scsi X-SVN-Commit-Revision: 351606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 17:02:03 -0000 Author: mav Date: Thu Aug 29 17:02:02 2019 New Revision: 351606 URL: https://svnweb.freebsd.org/changeset/base/351606 Log: Take proper lock in ses_setphyspath_callback(). XPT_DEV_ADVINFO call should be protected by the lock of the specific device it is addressed to, not the lock of SES device. In some weird case, probably with hardware violating standards, it sometimes caused NULL dereference due to race. To protect from it further, add lock assertion to *_dev_advinfo(). MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/ata/ata_xpt.c Thu Aug 29 17:02:02 2019 (r351606) @@ -1726,8 +1726,9 @@ ata_dev_advinfo(union ccb *start_ccb) { struct cam_ed *device; struct ccb_dev_advinfo *cdai; - off_t amt; + off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Thu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/mmc/mmc_xpt.c Thu Aug 29 17:02:02 2019 (r351606) @@ -341,6 +341,7 @@ mmc_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Thu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/nvme/nvme_xpt.c Thu Aug 29 17:02:02 2019 (r351606) @@ -588,8 +588,9 @@ nvme_dev_advinfo(union ccb *start_ccb) { struct cam_ed *device; struct ccb_dev_advinfo *cdai; - off_t amt; + off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Thu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/scsi/scsi_enc_ses.c Thu Aug 29 17:02:02 2019 (r351606) @@ -1027,7 +1027,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element args = (ses_setphyspath_callback_args_t *)arg; old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); - cam_periph_lock(enc->periph); + xpt_path_lock(path); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; @@ -1052,7 +1052,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element if (cdai.ccb_h.status == CAM_REQ_CMP) args->num_set++; } - cam_periph_unlock(enc->periph); + xpt_path_unlock(path); free(old_physpath, M_SCSIENC); } Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/scsi/scsi_xpt.c Thu Aug 29 17:02:02 2019 (r351606) @@ -2515,6 +2515,7 @@ scsi_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; From owner-svn-src-head@freebsd.org Thu Aug 29 17:17:39 2019 Return-Path: Delivered-To: svn-src-head@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 DAC0FDBA19; Thu, 29 Aug 2019 17:17:39 +0000 (UTC) (envelope-from zeising@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 46K8SM5Sghz3wp0; Thu, 29 Aug 2019 17:17:39 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98AD52322C; Thu, 29 Aug 2019 17:17:39 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7THHduN012463; Thu, 29 Aug 2019 17:17:39 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7THHddD012462; Thu, 29 Aug 2019 17:17:39 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201908291717.x7THHddD012462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Thu, 29 Aug 2019 17:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351607 - head X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 351607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 17:17:39 -0000 Author: zeising (doc,ports committer) Date: Thu Aug 29 17:17:39 2019 New Revision: 351607 URL: https://svnweb.freebsd.org/changeset/base/351607 Log: pwm.9 symlink shouldn't be removed When the pwm.9 manual was removed, a symlink between pwmbus.9 and pwm.9 was created, but there's an entry in ObsoleteFiles.inc to remove pwn.9, meaning that on every installation pwm.9 is created, and make delete-old deletes it. Remove the entry from ObsoleteFiles.inc, the symlink is clearly intentional and shouldn't be removed. Reviewed by: imp, ian Approved by: imp (implicit, review OK) Differential Revision: https://reviews.freebsd.org/D21198 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Aug 29 17:02:02 2019 (r351606) +++ head/ObsoleteFiles.inc Thu Aug 29 17:17:39 2019 (r351607) @@ -57,8 +57,8 @@ OLD_FILES+=usr/share/man/man3/cap_random_buf.3.gz OLD_FILES+=usr/share/man/man9/vm_page_hold.9.gz # 20190618: sys/capability.h removed (sys/capsicum.h is the one to use) OLD_FILES+=usr/include/sys/capability.h -# 20190615: 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.gz +# 20190615: sys/pwm.h renamed to dev/pwmc.h +OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h From owner-svn-src-head@freebsd.org Thu Aug 29 17:25:51 2019 Return-Path: Delivered-To: svn-src-head@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 AAD07DBCE0; Thu, 29 Aug 2019 17:25:51 +0000 (UTC) (envelope-from zeising@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 46K8dq42xQz3xGS; Thu, 29 Aug 2019 17:25:51 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C7A6233F0; Thu, 29 Aug 2019 17:25:51 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7THPpOI018298; Thu, 29 Aug 2019 17:25:51 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7THPpKs018297; Thu, 29 Aug 2019 17:25:51 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201908291725.x7THPpKs018297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Thu, 29 Aug 2019 17:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351608 - head X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 351608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 17:25:51 -0000 Author: zeising (doc,ports committer) Date: Thu Aug 29 17:25:50 2019 New Revision: 351608 URL: https://svnweb.freebsd.org/changeset/base/351608 Log: Use relative paths in ObsoleteFiles.inc Approved by: imp Differential Revision: https://reviews.freebsd.org/D21467 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Aug 29 17:17:39 2019 (r351607) +++ head/ObsoleteFiles.inc Thu Aug 29 17:25:50 2019 (r351608) @@ -39,8 +39,8 @@ # done # 20190825: zlib 1.0.4 removed from kernel -OLD_FILES+=/usr/include/sys/zlib.h -OLD_FILES+=/usr/include/sys/zutil.h +OLD_FILES+=usr/include/sys/zlib.h +OLD_FILES+=usr/include/sys/zutil.h # 20190817: pft_ping.py and sniffer.py moved to /usr/tests/sys/netpfil/common OLD_FILES+=usr/tests/sys/netpfil/pf/sniffer.py OLD_FILES+=usr/tests/sys/netpfil/pf/pft_ping.py From owner-svn-src-head@freebsd.org Thu Aug 29 18:23:39 2019 Return-Path: Delivered-To: svn-src-head@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 8D782DCEFB; Thu, 29 Aug 2019 18:23:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46K9wW2cyBz41xP; Thu, 29 Aug 2019 18:23:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2155A23ED7; Thu, 29 Aug 2019 18:23:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TINdGM054020; Thu, 29 Aug 2019 18:23:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TINcJC054017; Thu, 29 Aug 2019 18:23:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908291823.x7TINcJC054017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Aug 2019 18:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351609 - head/sys/amd64/vmm/io X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/io X-SVN-Commit-Revision: 351609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 18:23:39 -0000 Author: jhb Date: Thu Aug 29 18:23:38 2019 New Revision: 351609 URL: https://svnweb.freebsd.org/changeset/base/351609 Log: Simplify bhyve vlapic ESR logic. The bhyve virtual local APIC uses an instance-global flag to indicate when an error LVT is being delivered to prevent infinite recursion. Use a function argument instead to reduce the amount of instance-global state. This was inspired by reviewing the bhyve save/restore work, which saves a copy of the instance-global state for each vlapic. Smart OS bug: https://smartos.org/bugview/OS-7777 Submitted by: Patrick Mooney Reviewed by: markj, rgrimes Obtained from: SmartOS / Joyent Differential Revision: https://reviews.freebsd.org/D20365 Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Thu Aug 29 17:25:50 2019 (r351608) +++ head/sys/amd64/vmm/io/vlapic.c Thu Aug 29 18:23:38 2019 (r351609) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,6 +79,8 @@ __FBSDID("$FreeBSD$"); */ #define VLAPIC_BUS_FREQ (128 * 1024 * 1024) +static void vlapic_set_error(struct vlapic *, uint32_t, bool); + static __inline uint32_t vlapic_get_id(struct vlapic *vlapic) { @@ -275,7 +278,8 @@ vlapic_set_intr_ready(struct vlapic *vlapic, int vecto } if (vector < 16) { - vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR); + vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR, + false); VLAPIC_CTR1(vlapic, "vlapic ignoring interrupt to vector %d", vector); return (1); @@ -432,20 +436,22 @@ vlapic_mask_lvts(struct vlapic *vlapic) } static int -vlapic_fire_lvt(struct vlapic *vlapic, uint32_t lvt) +vlapic_fire_lvt(struct vlapic *vlapic, u_int lvt) { - uint32_t vec, mode; + uint32_t mode, reg, vec; - if (lvt & APIC_LVT_M) + reg = atomic_load_acq_32(&vlapic->lvt_last[lvt]); + + if (reg & APIC_LVT_M) return (0); + vec = reg & APIC_LVT_VECTOR; + mode = reg & APIC_LVT_DM; - vec = lvt & APIC_LVT_VECTOR; - mode = lvt & APIC_LVT_DM; - switch (mode) { case APIC_LVT_DM_FIXED: if (vec < 16) { - vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR, + lvt == APIC_LVT_ERROR); return (0); } if (vlapic_set_intr_ready(vlapic, vec, false)) @@ -606,22 +612,22 @@ vlapic_periodic_timer(struct vlapic *vlapic) static VMM_STAT(VLAPIC_INTR_ERROR, "error interrupts generated by vlapic"); -void -vlapic_set_error(struct vlapic *vlapic, uint32_t mask) +static void +vlapic_set_error(struct vlapic *vlapic, uint32_t mask, bool lvt_error) { - uint32_t lvt; vlapic->esr_pending |= mask; - if (vlapic->esr_firing) + + /* + * Avoid infinite recursion if the error LVT itself is configured with + * an illegal vector. + */ + if (lvt_error) return; - vlapic->esr_firing = 1; - // The error LVT always uses the fixed delivery mode. - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); - if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + if (vlapic_fire_lvt(vlapic, APIC_LVT_ERROR)) { vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_ERROR, 1); } - vlapic->esr_firing = 0; } static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts generated by vlapic"); @@ -629,13 +635,10 @@ static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts g static void vlapic_fire_timer(struct vlapic *vlapic) { - uint32_t lvt; KASSERT(VLAPIC_TIMER_LOCKED(vlapic), ("vlapic_fire_timer not locked")); - - // The timer LVT always uses the fixed delivery mode. - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); - if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + + if (vlapic_fire_lvt(vlapic, APIC_LVT_TIMER)) { VLAPIC_CTR0(vlapic, "vlapic timer fired"); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); } @@ -647,10 +650,8 @@ static VMM_STAT(VLAPIC_INTR_CMC, void vlapic_fire_cmci(struct vlapic *vlapic) { - uint32_t lvt; - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); - if (vlapic_fire_lvt(vlapic, lvt)) { + if (vlapic_fire_lvt(vlapic, APIC_LVT_CMCI)) { vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_CMC, 1); } } @@ -661,7 +662,6 @@ static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_I int vlapic_trigger_lvt(struct vlapic *vlapic, int vector) { - uint32_t lvt; if (vlapic_enabled(vlapic) == false) { /* @@ -684,35 +684,20 @@ vlapic_trigger_lvt(struct vlapic *vlapic, int vector) switch (vector) { case APIC_LVT_LINT0: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT0_LVT); - break; case APIC_LVT_LINT1: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT1_LVT); - break; case APIC_LVT_TIMER: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); - lvt |= APIC_LVT_DM_FIXED; - break; case APIC_LVT_ERROR: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); - lvt |= APIC_LVT_DM_FIXED; - break; case APIC_LVT_PMC: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_PERF_LVT); - break; case APIC_LVT_THERMAL: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_THERM_LVT); - break; case APIC_LVT_CMCI: - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); + if (vlapic_fire_lvt(vlapic, vector)) { + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, + LVTS_TRIGGERRED, vector, 1); + } break; default: return (EINVAL); } - if (vlapic_fire_lvt(vlapic, lvt)) { - vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, - LVTS_TRIGGERRED, vector, 1); - } return (0); } @@ -980,7 +965,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool mode = icrval & APIC_DELMODE_MASK; if (mode == APIC_DELMODE_FIXED && vec < 16) { - vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR, false); VLAPIC_CTR1(vlapic, "Ignoring invalid IPI %d", vec); return (0); } Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Thu Aug 29 17:25:50 2019 (r351608) +++ head/sys/amd64/vmm/io/vlapic.h Thu Aug 29 18:23:38 2019 (r351609) @@ -71,7 +71,6 @@ int vlapic_set_intr_ready(struct vlapic *vlapic, int v */ void vlapic_post_intr(struct vlapic *vlapic, int hostcpu, int ipinum); -void vlapic_set_error(struct vlapic *vlapic, uint32_t mask); void vlapic_fire_cmci(struct vlapic *vlapic); int vlapic_trigger_lvt(struct vlapic *vlapic, int vector); Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Thu Aug 29 17:25:50 2019 (r351608) +++ head/sys/amd64/vmm/io/vlapic_priv.h Thu Aug 29 18:23:38 2019 (r351609) @@ -156,7 +156,6 @@ struct vlapic { struct vlapic_ops ops; uint32_t esr_pending; - int esr_firing; struct callout callout; /* vlapic timer */ struct bintime timer_fire_bt; /* callout expiry time */ From owner-svn-src-head@freebsd.org Thu Aug 29 22:13:16 2019 Return-Path: Delivered-To: svn-src-head@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 045AAE15B9; Thu, 29 Aug 2019 22:13:16 +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 46KH1R6JC8z4G7L; Thu, 29 Aug 2019 22:13:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9B4826893; Thu, 29 Aug 2019 22:13:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TMDFUa090785; Thu, 29 Aug 2019 22:13:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TMDFpJ090784; Thu, 29 Aug 2019 22:13:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908292213.x7TMDFpJ090784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 29 Aug 2019 22:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351613 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 351613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 22:13:16 -0000 Author: markj Date: Thu Aug 29 22:13:15 2019 New Revision: 351613 URL: https://svnweb.freebsd.org/changeset/base/351613 Log: Remove unused VM page locking macros. They were orphaned by r292373. Reviewed by: asomers MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21469 Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 20:39:24 2019 (r351612) +++ head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 22:13:15 2019 (r351613) @@ -226,11 +226,6 @@ struct vop_vector fuse_vnops = { uma_zone_t fuse_pbuf_zone; -#define fuse_vm_page_lock(m) vm_page_lock((m)); -#define fuse_vm_page_unlock(m) vm_page_unlock((m)); -#define fuse_vm_page_lock_queues() ((void)0) -#define fuse_vm_page_unlock_queues() ((void)0) - /* Check permission for extattr operations, much like extattr_check_cred */ static int fuse_extattr_check_cred(struct vnode *vp, int ns, struct ucred *cred, From owner-svn-src-head@freebsd.org Thu Aug 29 23:23:12 2019 Return-Path: Delivered-To: svn-src-head@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 DC894E2522; Thu, 29 Aug 2019 23:23:12 +0000 (UTC) (envelope-from jgh@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 46KJZ85FZKz4JSN; Thu, 29 Aug 2019 23:23:12 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D97274FF; Thu, 29 Aug 2019 23:23:12 +0000 (UTC) (envelope-from jgh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7TNNC3S031423; Thu, 29 Aug 2019 23:23:12 GMT (envelope-from jgh@FreeBSD.org) Received: (from jgh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7TNNCNT031422; Thu, 29 Aug 2019 23:23:12 GMT (envelope-from jgh@FreeBSD.org) Message-Id: <201908292323.x7TNNCNT031422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jgh set sender to jgh@FreeBSD.org using -f From: Jason Helfman Date: Thu, 29 Aug 2019 23:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351614 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: jgh X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 351614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 23:23:12 -0000 Author: jgh (doc,ports committer) Date: Thu Aug 29 23:23:12 2019 New Revision: 351614 URL: https://svnweb.freebsd.org/changeset/base/351614 Log: - address missing whitespace for indent PR: 239727 Submitted by: gbergling@gmail.com Reviewed by: 0mp@ MFC after: 1 week Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Thu Aug 29 22:13:15 2019 (r351613) +++ head/usr.bin/indent/indent.1 Thu Aug 29 23:23:12 2019 (r351614) @@ -159,7 +159,7 @@ except that it only applies to the first set of declar in a procedure (just after the first `{') and it causes a blank line to be generated even if there are no declarations. The default is -.Fl nbadp. +.Fl nbadp . .It Fl bap , nbap If .Fl bap @@ -202,7 +202,7 @@ if (...) { .It Fl bs , nbs Whether a blank should always be inserted after sizeof. The default is -.Fl nbs. +.Fl nbs . .It Fl c Ns Ar n The column in which comments on code start. The default is 33. @@ -353,7 +353,7 @@ The default is 78. .It Fl lc Ns Ar n Maximum length of an output line in a block comment. The default is 0, which means to limit block comment lines in accordance with -.Fl l. +.Fl l . .It Fl \&ldi Ns Ar n Specifies the indentation, in character positions, of local variable names From owner-svn-src-head@freebsd.org Fri Aug 30 00:03:42 2019 Return-Path: Delivered-To: svn-src-head@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 83E53E3903; Fri, 30 Aug 2019 00:03:42 +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 46KKSt2DHvz4MC6; Fri, 30 Aug 2019 00:03:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2233D27C2F; Fri, 30 Aug 2019 00:03:42 +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 x7U03gr2055511; Fri, 30 Aug 2019 00:03:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U03fio055510; Fri, 30 Aug 2019 00:03:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201908300003.x7U03fio055510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 30 Aug 2019 00:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351615 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 351615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:03:42 -0000 Author: glebius Date: Fri Aug 30 00:03:41 2019 New Revision: 351615 URL: https://svnweb.freebsd.org/changeset/base/351615 Log: Allow mbuf queues to be unlimited. There is number of legacy code that uses ifqueue without setting a limit on it first. Easier to allow for that rather than improve legacy drivers. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Aug 29 23:23:12 2019 (r351614) +++ head/sys/sys/mbuf.h Fri Aug 30 00:03:41 2019 (r351615) @@ -1434,7 +1434,7 @@ static inline int mbufq_full(const struct mbufq *mq) { - return (mq->mq_len >= mq->mq_maxlen); + return (mq->mq_maxlen > 0 && mq->mq_len >= mq->mq_maxlen); } static inline int From owner-svn-src-head@freebsd.org Fri Aug 30 00:05:06 2019 Return-Path: Delivered-To: svn-src-head@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 ADFDEE3C88; Fri, 30 Aug 2019 00:05:06 +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 46KKVV1qY0z4NZh; Fri, 30 Aug 2019 00:05: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 DA41627C3F; Fri, 30 Aug 2019 00:05:05 +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 x7U055hQ057391; Fri, 30 Aug 2019 00:05:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U055YI057385; Fri, 30 Aug 2019 00:05:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201908300005.x7U055YI057385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 30 Aug 2019 00:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351616 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 351616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:05:06 -0000 Author: glebius Date: Fri Aug 30 00:05:04 2019 New Revision: 351616 URL: https://svnweb.freebsd.org/changeset/base/351616 Log: Use mbuf queue instead of ifqueue in USB network drivers. Reviewed by: stevek Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/usb/net/usb_ethernet.h Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/if_axe.c Fri Aug 30 00:05:04 2019 (r351616) @@ -1149,7 +1149,7 @@ axe_rxeof(struct usb_ether *ue, struct usb_page_cache } } - _IF_ENQUEUE(&ue->ue_rxq, m); + (void)mbufq_enqueue(&ue->ue_rxq, m); return (0); } Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/if_axge.c Fri Aug 30 00:05:04 2019 (r351616) @@ -1041,7 +1041,7 @@ axge_rxeof(struct usb_ether *ue, struct usb_page_cache } if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - _IF_ENQUEUE(&ue->ue_rxq, m); + (void)mbufq_enqueue(&ue->ue_rxq, m); } static void Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/usb_ethernet.c Fri Aug 30 00:05:04 2019 (r351616) @@ -598,7 +598,7 @@ uether_rxmbuf(struct usb_ether *ue, struct mbuf *m, m->m_pkthdr.len = m->m_len = len; /* enqueue for later when the lock can be released */ - _IF_ENQUEUE(&ue->ue_rxq, m); + (void)mbufq_enqueue(&ue->ue_rxq, m); return (0); } @@ -628,7 +628,7 @@ uether_rxbuf(struct usb_ether *ue, struct usb_page_cac m->m_pkthdr.len = m->m_len = len; /* enqueue for later when the lock can be released */ - _IF_ENQUEUE(&ue->ue_rxq, m); + (void)mbufq_enqueue(&ue->ue_rxq, m); return (0); } @@ -641,7 +641,7 @@ uether_rxflush(struct usb_ether *ue) UE_LOCK_ASSERT(ue, MA_OWNED); for (;;) { - _IF_DEQUEUE(&ue->ue_rxq, m); + m = mbufq_dequeue(&ue->ue_rxq); if (m == NULL) break; Modified: head/sys/dev/usb/net/usb_ethernet.h ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.h Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/usb_ethernet.h Fri Aug 30 00:05:04 2019 (r351616) @@ -41,12 +41,10 @@ #include #include -#include #include #include #include #include -#include #include #include @@ -89,7 +87,7 @@ struct usb_ether { struct usb_process ue_tq; struct sysctl_ctx_list ue_sysctl_ctx; - struct ifqueue ue_rxq; + struct mbufq ue_rxq; struct usb_callout ue_watchdog; struct usb_ether_cfg_task ue_sync_task[2]; struct usb_ether_cfg_task ue_media_task[2]; From owner-svn-src-head@freebsd.org Fri Aug 30 00:30:04 2019 Return-Path: Delivered-To: svn-src-head@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 A18F8E4875; Fri, 30 Aug 2019 00:30:04 +0000 (UTC) (envelope-from mjg@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 46KL3J3pvhz4R2c; Fri, 30 Aug 2019 00:30:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6124427FEB; Fri, 30 Aug 2019 00:30:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7U0U437071585; Fri, 30 Aug 2019 00:30:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0U4Ss071584; Fri, 30 Aug 2019 00:30:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908300030.x7U0U4Ss071584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Aug 2019 00:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351617 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 351617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:30:04 -0000 Author: mjg Date: Fri Aug 30 00:30:03 2019 New Revision: 351617 URL: https://svnweb.freebsd.org/changeset/base/351617 Log: nullfs: use VOP_NEED_INACTIVE Reviewed by: kib Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Fri Aug 30 00:05:04 2019 (r351616) +++ head/sys/fs/nullfs/null_vnops.c Fri Aug 30 00:30:03 2019 (r351617) @@ -732,14 +732,13 @@ null_unlock(struct vop_unlock_args *ap) * ours. */ static int -null_inactive(struct vop_inactive_args *ap __unused) +null_want_recycle(struct vnode *vp) { - struct vnode *vp, *lvp; + struct vnode *lvp; struct null_node *xp; struct mount *mp; struct null_mount *xmp; - vp = ap->a_vp; xp = VTONULL(vp); lvp = NULLVPTOLOWERVP(vp); mp = vp->v_mount; @@ -753,12 +752,31 @@ null_inactive(struct vop_inactive_args *ap __unused) * deleted, then free up the vnode so as not to tie up * the lower vnodes. */ + return (1); + } + return (0); +} + +static int +null_inactive(struct vop_inactive_args *ap) +{ + struct vnode *vp; + + vp = ap->a_vp; + if (null_want_recycle(vp)) { vp->v_object = NULL; vrecycle(vp); } return (0); } +static int +null_need_inactive(struct vop_need_inactive_args *ap) +{ + + return (null_want_recycle(ap->a_vp)); +} + /* * Now, the nullfs vnode and, due to the sharing lock, the lower * vnode, are exclusively locked, and we shall destroy the null vnode. @@ -907,7 +925,7 @@ struct vop_vector null_vnodeops = { .vop_getattr = null_getattr, .vop_getwritemount = null_getwritemount, .vop_inactive = null_inactive, - .vop_need_inactive = vop_stdneed_inactive, + .vop_need_inactive = null_need_inactive, .vop_islocked = vop_stdislocked, .vop_lock1 = null_lock, .vop_lookup = null_lookup, From owner-svn-src-head@freebsd.org Fri Aug 30 00:34:28 2019 Return-Path: Delivered-To: svn-src-head@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 A4511E4A92; Fri, 30 Aug 2019 00:34:28 +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 46KL8N3sJMz4RQF; Fri, 30 Aug 2019 00:34:28 +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 663AF281A7; Fri, 30 Aug 2019 00:34:28 +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 x7U0YSQ3076937; Fri, 30 Aug 2019 00:34:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0YSXx076936; Fri, 30 Aug 2019 00:34:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908300034.x7U0YSXx076936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Aug 2019 00:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351618 - head/sys/arm/samsung/exynos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/samsung/exynos X-SVN-Commit-Revision: 351618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:34:28 -0000 Author: emaste Date: Fri Aug 30 00:34:27 2019 New Revision: 351618 URL: https://svnweb.freebsd.org/changeset/base/351618 Log: exynos5: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 30 00:30:03 2019 (r351617) +++ head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 30 00:34:27 2019 (r351618) @@ -314,7 +314,7 @@ combiner_setup_intr(char *source_name, void (*ih)(void sc = combiner_sc; if (sc == NULL) { - device_printf(sc->dev, "Error: combiner is not attached\n"); + printf("%s: error: combiner is not attached\n", __func__); return; } From owner-svn-src-head@freebsd.org Fri Aug 30 00:36:18 2019 Return-Path: Delivered-To: svn-src-head@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 29E8DE4B20; Fri, 30 Aug 2019 00:36:18 +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 46KLBV0Hz8z4RY4; Fri, 30 Aug 2019 00:36:18 +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 DFCBE281A9; Fri, 30 Aug 2019 00:36:17 +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 x7U0aH43077071; Fri, 30 Aug 2019 00:36:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0aHU6077070; Fri, 30 Aug 2019 00:36:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908300036.x7U0aHU6077070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Aug 2019 00:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351619 - head/sys/arm/samsung/exynos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/samsung/exynos X-SVN-Commit-Revision: 351619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:36:18 -0000 Author: emaste Date: Fri Aug 30 00:36:17 2019 New Revision: 351619 URL: https://svnweb.freebsd.org/changeset/base/351619 Log: exynos5: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days MFC with: r351618 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/samsung/exynos/exynos5_pad.c Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 30 00:34:27 2019 (r351618) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 30 00:36:17 2019 (r351619) @@ -410,7 +410,7 @@ pad_setup_intr(int gpio_number, void (*ih)(void *), vo sc = gpio_sc; if (sc == NULL) { - device_printf(sc->dev, "Error: pad is not attached\n"); + printf("%s: Error: pad is not attached\n", __func__); return (-1); } From owner-svn-src-head@freebsd.org Fri Aug 30 00:38:17 2019 Return-Path: Delivered-To: svn-src-head@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 1CDA1E4BB3; Fri, 30 Aug 2019 00:38:17 +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 46KLDm72Wqz4Rgj; Fri, 30 Aug 2019 00:38:16 +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 CEEFD281AA; Fri, 30 Aug 2019 00:38:16 +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 x7U0cGpY077202; Fri, 30 Aug 2019 00:38:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0cGEq077201; Fri, 30 Aug 2019 00:38:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908300038.x7U0cGEq077201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Aug 2019 00:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351620 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 351620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:38:17 -0000 Author: emaste Date: Fri Aug 30 00:38:16 2019 New Revision: 351620 URL: https://svnweb.freebsd.org/changeset/base/351620 Log: qlxgbe: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/qlxgbe/ql_isr.c Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Fri Aug 30 00:36:17 2019 (r351619) +++ head/sys/dev/qlxgbe/ql_isr.c Fri Aug 30 00:38:16 2019 (r351620) @@ -793,7 +793,7 @@ ql_mbx_isr(void *arg) ha = arg; if (ha == NULL) { - device_printf(ha->pci_dev, "%s: arg == NULL\n", __func__); + printf("%s: arg == NULL\n", __func__); return; } From owner-svn-src-head@freebsd.org Fri Aug 30 00:40:08 2019 Return-Path: Delivered-To: svn-src-head@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 B46D9E4C74; Fri, 30 Aug 2019 00:40:08 +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 46KLGw4JzNz4Rq9; Fri, 30 Aug 2019 00:40:08 +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 72FC1281AE; Fri, 30 Aug 2019 00:40:08 +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 x7U0e8cK077357; Fri, 30 Aug 2019 00:40:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0e8aQ077356; Fri, 30 Aug 2019 00:40:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908300040.x7U0e8aQ077356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Aug 2019 00:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351621 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 351621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:40:08 -0000 Author: emaste Date: Fri Aug 30 00:40:08 2019 New Revision: 351621 URL: https://svnweb.freebsd.org/changeset/base/351621 Log: xdma: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:38:16 2019 (r351620) +++ head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:40:08 2019 (r351621) @@ -186,8 +186,7 @@ xchan_bufs_alloc(xdma_channel_t *xchan) xdma = xchan->xdma; if (xdma == NULL) { - device_printf(xdma->dev, - "%s: Channel was not allocated properly.\n", __func__); + printf("%s: Channel was not allocated properly.\n", __func__); return (-1); } From owner-svn-src-head@freebsd.org Fri Aug 30 00:45:54 2019 Return-Path: Delivered-To: svn-src-head@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 DC89AE4EE5; Fri, 30 Aug 2019 00:45:54 +0000 (UTC) (envelope-from mjg@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 46KLPZ5BrJz4SF2; Fri, 30 Aug 2019 00:45:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FA032836B; Fri, 30 Aug 2019 00:45:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7U0jsx5083260; Fri, 30 Aug 2019 00:45:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U0jsq9083259; Fri, 30 Aug 2019 00:45:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908300045.x7U0jsq9083259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Aug 2019 00:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351622 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 00:45:54 -0000 Author: mjg Date: Fri Aug 30 00:45:53 2019 New Revision: 351622 URL: https://svnweb.freebsd.org/changeset/base/351622 Log: vfs: tidy up assertions in vfs_subr - assert unlocked vnode interlock in vref - assert right counts in vputx - print debug info for panic in vdrop Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 30 00:40:08 2019 (r351621) +++ head/sys/kern/vfs_subr.c Fri Aug 30 00:45:53 2019 (r351622) @@ -2778,6 +2778,7 @@ void vref(struct vnode *vp) { + ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); _vhold(vp, false); v_incr_usecount(vp); @@ -2853,6 +2854,9 @@ vputx(struct vnode *vp, int func) else KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); ASSERT_VI_UNLOCKED(vp, __func__); + VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, + ("%s: wrong ref counts", __func__)); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (vp->v_type != VCHR && @@ -3069,8 +3073,10 @@ _vdrop(struct vnode *vp, bool locked) else ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if ((int)vp->v_holdcnt <= 0) - panic("vdrop: holdcnt %d", vp->v_holdcnt); + if (__predict_false((int)vp->v_holdcnt <= 0)) { + vn_printf(vp, "vdrop: holdcnt %d", vp->v_holdcnt); + panic("vdrop: wrong holdcnt"); + } if (!locked) { if (refcount_release_if_not_last(&vp->v_holdcnt)) return; From owner-svn-src-head@freebsd.org Fri Aug 30 04:29:23 2019 Return-Path: Delivered-To: svn-src-head@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 3709DC12EF; Fri, 30 Aug 2019 04:29:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 46KRMQ161bz4d04; Fri, 30 Aug 2019 04:29:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 2DA28362490; Fri, 30 Aug 2019 14:29:19 +1000 (AEST) Date: Fri, 30 Aug 2019 14:29:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351319 - in head/usr.sbin/makefs: ffs msdos In-Reply-To: <201908210145.x7L1jU3x072180@repo.freebsd.org> Message-ID: <20190830140337.D1405@besplex.bde.org> References: <201908210145.x7L1jU3x072180@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Tet0GMRg2H-6MN17sk8A:9 a=PqWL37kH3jd52NYQ:21 a=5lQ2c9eFih_14WG5:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46KRMQ161bz4d04 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-3.23 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23:c]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[optusnet.com.au]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-5.35), ipnet: 211.28.0.0/14(-3.27), asn: 4804(-2.40), country: AU(0.01)]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 04:29:23 -0000 On Wed, 21 Aug 2019, Ed Maste wrote: > Author: emaste > Date: Wed Aug 21 01:45:29 2019 > New Revision: 351319 > URL: https://svnweb.freebsd.org/changeset/base/351319 > > Log: > makefs: use `char *` not `void *` for buf b_data, drop casts in msdos > > (The kernel uses caddr_t.) This is much better than churning the copy of the working code. However, the kernel type is still bogus. caddr_t should not exist, and should have been more like vm_offset_t to begin with. void * is no good as an opaque type for it, since void * is only good for C addresses within a single address space, but caddr_t is supposed to be able to represent anything in a (possibly multiple) "core" address space. [u]intptr_t has the same problem. Bus space addresses are also withing a single address space and in general need a tag for uniqueness. caddr_t has been char * for too long, so too much code including buf b_data depends on it being precisely char * or u_char * to work. char * is an honestly broken variant of void *. It is similarly limited to a single address space. This is hard to fix. It works for [Free]BSD since no arches with more than a single address space are supported (i386 with PAE or pae_mode=1 or pae_mode has a larger physical address space where addresses aren't unique, but only the kernel can see this). Bruce From owner-svn-src-head@freebsd.org Fri Aug 30 06:06:13 2019 Return-Path: Delivered-To: svn-src-head@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 2252EC3579; Fri, 30 Aug 2019 06:06:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46KTW90361z3D9g; Fri, 30 Aug 2019 06:06:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7A692BD78; Fri, 30 Aug 2019 06:06:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7U66C1A072410; Fri, 30 Aug 2019 06:06:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7U66CUV072409; Fri, 30 Aug 2019 06:06:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908300606.x7U66CUV072409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 30 Aug 2019 06:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351623 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 351623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 06:06:13 -0000 Author: delphij Date: Fri Aug 30 06:06:12 2019 New Revision: 351623 URL: https://svnweb.freebsd.org/changeset/base/351623 Log: Remove unneeded blank line. No functional change. MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/fat.c Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Fri Aug 30 00:45:53 2019 (r351622) +++ head/sbin/fsck_msdosfs/fat.c Fri Aug 30 06:06:12 2019 (r351623) @@ -518,7 +518,6 @@ clear: } if (head == fat[n].head) { pwarn("Cluster chain starting at %u loops at cluster %u\n", - head, p); goto clear; } From owner-svn-src-head@freebsd.org Fri Aug 30 10:29:53 2019 Return-Path: Delivered-To: svn-src-head@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 AE78ACA3AD; Fri, 30 Aug 2019 10:29:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46KbMP2bC6z3xkn; Fri, 30 Aug 2019 10:29:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x7UATi7t091264 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 30 Aug 2019 13:29:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x7UATi7t091264 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x7UATi2v091263; Fri, 30 Aug 2019 13:29:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 30 Aug 2019 13:29:43 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351622 - head/sys/kern Message-ID: <20190830102943.GE71821@kib.kiev.ua> References: <201908300045.x7U0jsq9083259@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908300045.x7U0jsq9083259@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46KbMP2bC6z3xkn X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 10:29:53 -0000 On Fri, Aug 30, 2019 at 12:45:54AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Fri Aug 30 00:45:53 2019 > New Revision: 351622 > URL: https://svnweb.freebsd.org/changeset/base/351622 > > Log: > vfs: tidy up assertions in vfs_subr > > - assert unlocked vnode interlock in vref > - assert right counts in vputx > - print debug info for panic in vdrop > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Fri Aug 30 00:40:08 2019 (r351621) > +++ head/sys/kern/vfs_subr.c Fri Aug 30 00:45:53 2019 (r351622) > @@ -2778,6 +2778,7 @@ void > vref(struct vnode *vp) > { > > + ASSERT_VI_UNLOCKED(vp, __func__); > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > _vhold(vp, false); > v_incr_usecount(vp); > @@ -2853,6 +2854,9 @@ vputx(struct vnode *vp, int func) > else > KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); > ASSERT_VI_UNLOCKED(vp, __func__); > + VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, A more precise assert condition would also include vp->v_holdcont >= vp->v_usecount > + ("%s: wrong ref counts", __func__)); > + > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > > if (vp->v_type != VCHR && > @@ -3069,8 +3073,10 @@ _vdrop(struct vnode *vp, bool locked) > else > ASSERT_VI_UNLOCKED(vp, __func__); > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > - if ((int)vp->v_holdcnt <= 0) > - panic("vdrop: holdcnt %d", vp->v_holdcnt); > + if (__predict_false((int)vp->v_holdcnt <= 0)) { > + vn_printf(vp, "vdrop: holdcnt %d", vp->v_holdcnt); > + panic("vdrop: wrong holdcnt"); > + } > if (!locked) { > if (refcount_release_if_not_last(&vp->v_holdcnt)) > return; From owner-svn-src-head@freebsd.org Fri Aug 30 15:40:31 2019 Return-Path: Delivered-To: svn-src-head@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 E2F04D17A2; Fri, 30 Aug 2019 15:40:31 +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 46KkFq5GkDz4DwK; Fri, 30 Aug 2019 15:40:31 +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 93F2C2497; Fri, 30 Aug 2019 15:40:31 +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 x7UFeVp2011332; Fri, 30 Aug 2019 15:40:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UFeVrN011331; Fri, 30 Aug 2019 15:40:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908301540.x7UFeVrN011331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 30 Aug 2019 15:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351624 - head/sys/dev/sound/midi X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/sound/midi X-SVN-Commit-Revision: 351624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 15:40:31 -0000 Author: markj Date: Fri Aug 30 15:40:31 2019 New Revision: 351624 URL: https://svnweb.freebsd.org/changeset/base/351624 Log: Properly check for an interrupted cv_wait_sig(). The returned error number may be EINTR or ERESTART depending on whether or not the signal is supposed to interrupt the system call. Reported and tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/sound/midi/sequencer.c Modified: head/sys/dev/sound/midi/sequencer.c ============================================================================== --- head/sys/dev/sound/midi/sequencer.c Fri Aug 30 06:06:12 2019 (r351623) +++ head/sys/dev/sound/midi/sequencer.c Fri Aug 30 15:40:31 2019 (r351624) @@ -912,7 +912,7 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int iof goto err1; retval = cv_wait_sig(&scp->in_cv, &scp->seq_lock); - if (retval == EINTR) + if (retval != 0) goto err1; } @@ -977,7 +977,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io * We slept, maybe things have changed since last * dying check */ - if (retval == EINTR) + if (retval != 0) goto err0; #if 0 /* From owner-svn-src-head@freebsd.org Fri Aug 30 16:30:10 2019 Return-Path: Delivered-To: svn-src-head@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 88DE3D289B; Fri, 30 Aug 2019 16:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46KlM633tgz4H5P; Fri, 30 Aug 2019 16:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FF3E2D78; Fri, 30 Aug 2019 16:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7UGUA49040273; Fri, 30 Aug 2019 16:30:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UGUA9Q040272; Fri, 30 Aug 2019 16:30:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908301630.x7UGUA9Q040272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Aug 2019 16:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351625 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 351625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 16:30:10 -0000 Author: jhb Date: Fri Aug 30 16:30:09 2019 New Revision: 351625 URL: https://svnweb.freebsd.org/changeset/base/351625 Log: Add entries for unmapped mbufs and KTLS. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Fri Aug 30 15:40:31 2019 (r351624) +++ head/RELNOTES Fri Aug 30 16:30:09 2019 (r351625) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r351522: + Add kernel-side support for in-kernel Transport Layer Security + (KTLS). KTLS permits using sendfile(2) over sockets using + TLS. + r351361: Add probes for lockmgr(9) to the lockstat DTrace provider, add corresponding lockstat(1) events, and document the new probes in @@ -64,6 +69,9 @@ r350315, r350316: r350307: libcap_random(3) has been removed. Applications can use native APIs to get random data in capability mode. + +r349529,r349530: + Add support for using unmapped mbufs with sendfile(2). r349352: nand(4) and related components have been removed. From owner-svn-src-head@freebsd.org Fri Aug 30 16:35:32 2019 Return-Path: Delivered-To: svn-src-head@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 0DB2FD2B78; Fri, 30 Aug 2019 16:35:32 +0000 (UTC) (envelope-from emax@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 46KlTH6vdHz4HZJ; Fri, 30 Aug 2019 16:35:31 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CABC22F30; Fri, 30 Aug 2019 16:35:31 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7UGZVh0045885; Fri, 30 Aug 2019 16:35:31 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UGZVQp045884; Fri, 30 Aug 2019 16:35:31 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201908301635.x7UGZVQp045884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Fri, 30 Aug 2019 16:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351626 - head/sys/netgraph/bluetooth/socket X-SVN-Group: head X-SVN-Commit-Author: emax X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/socket X-SVN-Commit-Revision: 351626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 16:35:32 -0000 Author: emax Date: Fri Aug 30 16:35:31 2019 New Revision: 351626 URL: https://svnweb.freebsd.org/changeset/base/351626 Log: avoid holding PCB mutex during copyin/copyout() Reported by: imp, mms dot vanbreukelingen at gmail dot com Reviewed by: imp Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Fri Aug 30 16:30:09 2019 (r351625) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Fri Aug 30 16:35:31 2019 (r351626) @@ -1156,15 +1156,15 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long if (p->num_entries <= 0 || p->num_entries > NG_HCI_MAX_NEIGHBOR_NUM || p->entries == NULL) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_HCI_COOKIE, NGM_HCI_NODE_GET_NEIGHBOR_CACHE, 0, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_hci_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -1173,7 +1173,8 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, @@ -1181,16 +1182,21 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long ng_btsocket_hci_raw_ioctl_timeout * hz); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_HCI_NODE_GET_NEIGHBOR_CACHE) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_HCI_NODE_GET_NEIGHBOR_CACHE) { /* Return data back to user space */ - p1 = (ng_hci_node_get_neighbor_cache_ep *) - (pcb->msg->data); - p2 = (ng_hci_node_neighbor_cache_entry_ep *) - (p1 + 1); + p1 = (ng_hci_node_get_neighbor_cache_ep *)(msg->data); + p2 = (ng_hci_node_neighbor_cache_entry_ep *)(p1 + 1); p->num_entries = min(p->num_entries, p1->num_entries); if (p->num_entries > 0) @@ -1200,8 +1206,9 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - }break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_HCI_RAW_NODE_GET_CON_LIST: { struct ng_btsocket_hci_raw_con_list *p = @@ -1212,15 +1219,15 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long if (p->num_connections == 0 || p->num_connections > NG_HCI_MAX_CON_NUM || p->connections == NULL) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_HCI_COOKIE, NGM_HCI_NODE_GET_CON_LIST, 0, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_hci_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -1229,7 +1236,8 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, @@ -1237,13 +1245,20 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long ng_btsocket_hci_raw_ioctl_timeout * hz); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_HCI_NODE_GET_CON_LIST) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_HCI_NODE_GET_CON_LIST) { /* Return data back to user space */ - p1 = (ng_hci_node_con_list_ep *)(pcb->msg->data); + p1 = (ng_hci_node_con_list_ep *)(msg->data); p2 = (ng_hci_node_con_ep *)(p1 + 1); p->num_connections = min(p->num_connections, @@ -1255,8 +1270,9 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_HCI_RAW_NODE_GET_LINK_POLICY_MASK: { struct ng_btsocket_hci_raw_node_link_policy_mask *p = @@ -1332,15 +1348,15 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long struct nodeinfo *ni = nl->names; if (nl->num_names == 0) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_LISTNAMES, 0, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_hci_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -1349,7 +1365,8 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, ".:", 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, @@ -1357,12 +1374,19 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long ng_btsocket_hci_raw_ioctl_timeout * hz); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && pcb->msg->header.cmd == NGM_LISTNAMES) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && msg->header.cmd == NGM_LISTNAMES) { /* Return data back to user space */ - struct namelist *nl1 = (struct namelist *) pcb->msg->data; + struct namelist *nl1 = (struct namelist *) msg->data; struct nodeinfo *ni1 = &nl1->nodeinfo[0]; while (nl->num_names > 0 && nl1->numnames > 0) { @@ -1385,8 +1409,9 @@ ng_btsocket_hci_raw_control(struct socket *so, u_long } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ default: error = EINVAL; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Fri Aug 30 16:30:09 2019 (r351625) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Fri Aug 30 16:35:31 2019 (r351626) @@ -852,15 +852,15 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon if (p->num_connections == 0 || p->num_connections > NG_L2CAP_MAX_CON_NUM || p->connections == NULL) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_L2CAP_COOKIE, NGM_L2CAP_NODE_GET_CON_LIST, 0, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_l2cap_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -870,20 +870,28 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon pcb->rt->hook, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "l2ctl", ng_btsocket_l2cap_raw_ioctl_timeout * hz); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_L2CAP_NODE_GET_CON_LIST) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_L2CAP_NODE_GET_CON_LIST) { /* Return data back to user space */ - p1 = (ng_l2cap_node_con_list_ep *)(pcb->msg->data); + p1 = (ng_l2cap_node_con_list_ep *)(msg->data); p2 = (ng_l2cap_node_con_ep *)(p1 + 1); p->num_connections = min(p->num_connections, @@ -895,8 +903,9 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_L2CAP_NODE_GET_CHAN_LIST: { struct ng_btsocket_l2cap_raw_chan_list *p = @@ -907,15 +916,15 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon if (p->num_channels == 0 || p->num_channels > NG_L2CAP_MAX_CHAN_NUM || p->channels == NULL) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_L2CAP_COOKIE, NGM_L2CAP_NODE_GET_CHAN_LIST, 0, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_l2cap_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -925,20 +934,28 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon pcb->rt->hook, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "l2ctl", ng_btsocket_l2cap_raw_ioctl_timeout * hz); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_L2CAP_NODE_GET_CHAN_LIST) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_L2CAP_NODE_GET_CHAN_LIST) { /* Return data back to user space */ - p1 = (ng_l2cap_node_chan_list_ep *)(pcb->msg->data); + p1 = (ng_l2cap_node_chan_list_ep *)(msg->data); p2 = (ng_l2cap_node_chan_ep *)(p1 + 1); p->num_channels = min(p->num_channels, @@ -950,8 +967,9 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_L2CAP_L2CA_PING: { struct ng_btsocket_l2cap_raw_ping *p = @@ -961,16 +979,16 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon if ((p->echo_size != 0 && p->echo_data == NULL) || p->echo_size > NG_L2CAP_MAX_ECHO_SIZE) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_L2CAP_COOKIE, NGM_L2CAP_L2CA_PING, sizeof(*ip) + p->echo_size, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_l2cap_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -981,11 +999,15 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon ip->echo_size = p->echo_size; if (ip->echo_size > 0) { + mtx_unlock(&pcb->pcb_mtx); error = copyin(p->echo_data, ip + 1, p->echo_size); + mtx_lock(&pcb->pcb_mtx); + if (error != 0) { NG_FREE_MSG(msg); pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } } @@ -993,20 +1015,28 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon pcb->rt->hook, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "l2ctl", bluetooth_l2cap_rtx_timeout()); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_L2CAP_L2CA_PING) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_L2CAP_L2CA_PING) { /* Return data back to the user space */ - op = (ng_l2cap_l2ca_ping_op *)(pcb->msg->data); + op = (ng_l2cap_l2ca_ping_op *)(msg->data); p->result = op->result; p->echo_size = min(p->echo_size, op->echo_size); @@ -1016,8 +1046,9 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_L2CAP_L2CA_GET_INFO: { struct ng_btsocket_l2cap_raw_get_info *p = @@ -1026,21 +1057,21 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon ng_l2cap_l2ca_get_info_op *op = NULL; if (!(pcb->flags & NG_BTSOCKET_L2CAP_RAW_PRIVILEGED)) { - error = EPERM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EPERM); } if (p->info_size != 0 && p->info_data == NULL) { - error = EINVAL; - break; + mtx_unlock(&pcb->pcb_mtx); + return (EINVAL); } NG_MKMESSAGE(msg, NGM_L2CAP_COOKIE, NGM_L2CAP_L2CA_GET_INFO, sizeof(*ip) + p->info_size, M_NOWAIT); if (msg == NULL) { - error = ENOMEM; - break; + mtx_unlock(&pcb->pcb_mtx); + return (ENOMEM); } ng_btsocket_l2cap_raw_get_token(&msg->header.token); pcb->token = msg->header.token; @@ -1054,20 +1085,28 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon pcb->rt->hook, 0); if (error != 0) { pcb->token = 0; - break; + mtx_unlock(&pcb->pcb_mtx); + return (error); } error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "l2ctl", bluetooth_l2cap_rtx_timeout()); pcb->token = 0; - if (error != 0) - break; + if (error != 0) { + mtx_unlock(&pcb->pcb_mtx); + return (error); + } - if (pcb->msg != NULL && - pcb->msg->header.cmd == NGM_L2CAP_L2CA_GET_INFO) { + msg = pcb->msg; + pcb->msg = NULL; + + mtx_unlock(&pcb->pcb_mtx); + + if (msg != NULL && + msg->header.cmd == NGM_L2CAP_L2CA_GET_INFO) { /* Return data back to the user space */ - op = (ng_l2cap_l2ca_get_info_op *)(pcb->msg->data); + op = (ng_l2cap_l2ca_get_info_op *)(msg->data); p->result = op->result; p->info_size = min(p->info_size, op->info_size); @@ -1077,8 +1116,9 @@ ng_btsocket_l2cap_raw_control(struct socket *so, u_lon } else error = EINVAL; - NG_FREE_MSG(pcb->msg); /* checks for != NULL */ - } break; + NG_FREE_MSG(msg); /* checks for != NULL */ + return (error); + } /* NOTREACHED */ case SIOC_L2CAP_NODE_GET_AUTO_DISCON_TIMO: { struct ng_btsocket_l2cap_raw_auto_discon_timo *p = From owner-svn-src-head@freebsd.org Fri Aug 30 19:35:44 2019 Return-Path: Delivered-To: svn-src-head@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 DA17CD68B2; Fri, 30 Aug 2019 19:35:44 +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 46KqTD67LMz4Sq6; Fri, 30 Aug 2019 19:35:44 +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 B35865229; Fri, 30 Aug 2019 19:35: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 x7UJZiV3052132; Fri, 30 Aug 2019 19:35:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UJZiqV052130; Fri, 30 Aug 2019 19:35:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908301935.x7UJZiqV052130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 30 Aug 2019 19:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351628 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 351628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 19:35:44 -0000 Author: markj Date: Fri Aug 30 19:35:44 2019 New Revision: 351628 URL: https://svnweb.freebsd.org/changeset/base/351628 Log: Update and clean up the UMA man page. - Fix warnings from igor and mandoc. - Provide a brief description of the separation between zones and their backend slab allocators. - Document cache zones and secondary zones. - Document the kernel config options added in r350659. - Document the uma_zalloc_pcpu() and uma_zfree_pcpu() wrappers. - Document uma_zone_reserve(), uma_zone_reserve_kva() and uma_zone_prealloc(). - Document uma_zone_alloc() and uma_zone_freef(). - Add some missing MLINKs and Xrefs. MFC after: 2 weeks Modified: head/share/man/man9/Makefile head/share/man/man9/zone.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Aug 30 17:36:45 2019 (r351627) +++ head/share/man/man9/Makefile Fri Aug 30 19:35:44 2019 (r351628) @@ -2223,7 +2223,9 @@ MLINKS+=vm_map_lookup.9 vm_map_lookup_done.9 MLINKS+=vm_map_max.9 vm_map_min.9 \ vm_map_max.9 vm_map_pmap.9 MLINKS+=vm_map_stack.9 vm_map_growstack.9 -MLINKS+=vm_map_wire.9 vm_map_unwire.9 +MLINKS+=vm_map_wire.9 vm_map_wire_mapped.9 \ + vm_page_wire.9 vm_page_unwire.9 \ + vm_page_wire.9 vm_page_unwire_noq.9 MLINKS+=vm_page_bits.9 vm_page_clear_dirty.9 \ vm_page_bits.9 vm_page_dirty.9 \ vm_page_bits.9 vm_page_is_valid.9 \ @@ -2282,15 +2284,27 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zalloc.9 \ zone.9 uma_zalloc_arg.9 \ zone.9 uma_zalloc_domain.9 \ + zone.9 uma_zalloc_pcpu.9 \ + zone.9 uma_zalloc_pcpu_arg.9 \ + zone.9 uma_zcache_create.9 \ zone.9 uma_zcreate.9 \ zone.9 uma_zdestroy.9 \ zone.9 uma_zfree.9 \ zone.9 uma_zfree_arg.9 \ zone.9 uma_zfree_domain.9 \ + zone.9 uma_zfree_pcpu.9 \ + zone.9 uma_zfree_pcpu_arg.9 \ zone.9 uma_zone_get_cur.9 \ zone.9 uma_zone_get_max.9 \ + zone.9 uma_zone_prealloc.9 \ + zone.9 uma_zone_reserve.9 \ + zone.9 uma_zone_reserve_kva.9 \ + zone.9 uma_zone_set_allocf.9 \ + zone.9 uma_zone_set_freef.9 \ zone.9 uma_zone_set_max.9 \ + zone.9 uma_zone_set_maxaction.9 \ + zone.9 uma_zone_set_maxcache.9 \ zone.9 uma_zone_set_warning.9 \ - zone.9 uma_zone_set_maxaction.9 + zone.9 uma_zsecond_create.9 .include Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Fri Aug 30 17:36:45 2019 (r351627) +++ head/share/man/man9/zone.9 Fri Aug 30 19:35:44 2019 (r351628) @@ -25,40 +25,62 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2018 -.Dt ZONE 9 +.Dd August 30, 2019 +.Dt UMA 9 .Os .Sh NAME -.Nm uma_zcreate , -.Nm uma_zalloc , -.Nm uma_zalloc_arg , -.Nm uma_zalloc_domain , -.Nm uma_zfree , -.Nm uma_zfree_arg , -.Nm uma_zfree_domain , -.Nm uma_zdestroy , -.Nm uma_zone_set_max , -.Nm uma_zone_get_max , -.Nm uma_zone_get_cur , -.Nm uma_zone_set_warning , -.Nm uma_zone_set_maxaction -.Nd zone allocator +.Nm UMA +.Nd general-purpose kernel object allocator .Sh SYNOPSIS .In sys/param.h .In sys/queue.h .In vm/uma.h +.Cd "options UMA_FIRSTTOUCH" +.Cd "options UMA_XDOMAIN" +.Bd -literal +typedef int (*uma_ctor)(void *mem, int size, void *arg, int flags); +typedef void (*uma_dtor)(void *mem, int size, void *arg); +typedef int (*uma_init)(void *mem, int size, int flags); +typedef void (*uma_fini)(void *mem, int size); +typedef int (*uma_import)(void *arg, void **store, int count, int domain, + int flags); +typedef void (*uma_release)(void *arg, void **store, int count); +typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t size, int domain, + uint8_t *pflag, int wait); +typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); + +.Ed .Ft uma_zone_t .Fo uma_zcreate .Fa "char *name" "int size" -.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init uminit" "uma_fini fini" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" .Fa "int align" "uint16_t flags" .Fc +.Ft uma_zone_t +.Fo uma_zcache_create +.Fa "char *name" "int size" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" +.Fa "uma_import zimport" "uma_release zrelease" +.Fa "void *arg" "int flags" +.Fc +.Ft uma_zone_t +.Fo uma_zsecond_create +.Fa "char *name" +.Fa "uma_ctor ctor" "uma_dtor dtor" "uma_init zinit" "uma_fini zfini" +.Fa "uma_zone_t master" +.Fc +.Ft void +.Fn uma_zdestroy "uma_zone_t zone" .Ft "void *" .Fn uma_zalloc "uma_zone_t zone" "int flags" .Ft "void *" .Fn uma_zalloc_arg "uma_zone_t zone" "void *arg" "int flags" .Ft "void *" .Fn uma_zalloc_domain "uma_zone_t zone" "void *arg" "int domain" "int flags" +.Ft "void *" +.Fn uma_zalloc_pcpu "uma_zone_t zone" "int flags" +.Ft "void *" +.Fn uma_zalloc_pcpu_arg "uma_zone_t zone" "void *arg" "int flags" .Ft void .Fn uma_zfree "uma_zone_t zone" "void *item" .Ft void @@ -66,10 +88,24 @@ .Ft void .Fn uma_zfree_domain "uma_zone_t zone" "void *item" "void *arg" .Ft void -.Fn uma_zdestroy "uma_zone_t zone" +.Fn uma_zfree_pcpu "uma_zone_t zone" "void *item" +.Ft void +.Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" +.Ft void +.Fn uma_prealloc "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_reserve "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_reserve_kva "uma_zone_t zone" "int nitems" +.Ft void +.Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" +.Ft void +.Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" .Ft int .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" .Ft int +.Fn uma_zone_set_maxcache "uma_zone_t zone" "int nitems" +.Ft int .Fn uma_zone_get_max "uma_zone_t zone" .Ft int .Fn uma_zone_get_cur "uma_zone_t zone" @@ -77,34 +113,56 @@ .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" .Ft void .Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)" +.Ft void +.Fn uma_reclaim .In sys/sysctl.h .Fn SYSCTL_UMA_MAX parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr .Fn SYSCTL_UMA_CUR parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr .Sh DESCRIPTION -The zone allocator provides an efficient interface for managing -dynamically-sized collections of items of identical size. -The zone allocator can work with preallocated zones as well as with -runtime-allocated ones, and is therefore available much earlier in the -boot process than other memory management routines. The zone allocator -provides per-cpu allocation caches with linear scalability on SMP +UMA (Universal Memory Allocator) provides an efficient interface for managing +dynamically-sized collections of items of identical size, referred to as zones. +Zones keep track of which items are in use and which +are not, and UMA provides functions for allocating items from a zone and +for releasing them back, making them available for subsequent allocation requests. +Zones maintain per-CPU caches with linear scalability on SMP systems as well as round-robin and first-touch policies for NUMA systems. +The number of items cached per CPU is bounded, and each zone additionally +maintains an unbounded cache of items that is used to quickly satisfy +per-CPU cache allocation misses. .Pp -A zone is an extensible collection of items of identical size. -The zone allocator keeps track of which items are in use and which -are not, and provides functions for allocating items from the zone and -for releasing them back (which makes them available for later use). +Two types of zones exist: regular zones and cache zones. +In a regular zone, items are allocated from a slab, which is one or more +virtually contiguous memory pages that have been allocated from the kernel's +page allocator. +Internally, slabs are managed by a UMA keg, which is responsible for allocating +slabs and keeping track of their usage by one or more zones. +In typical usage, there is one keg per zone, so slabs are not shared among +multiple zones. .Pp -After the first allocation of an item, -it will have been cleared to zeroes, however subsequent allocations -will retain the contents as of the last free. +Normal zones import items from a keg, and release items back to that keg if +requested. +Cache zones do not have a keg, and instead use custom import and release +methods. +For example, some collections of kernel objects are statically allocated +at boot-time, and the size of the collection does not change. +A cache zone can be used to implement an efficient allocator for the objects in +such a collection. .Pp The .Fn uma_zcreate -function creates a new zone from which items may then be allocated from. +and +.Fn uma_zcache_create +functions create a new regular zone and cache zone, respectively. The +.Fn uma_zsecond_create +function creates a regular zone which shares the keg of the zone +specified by the +.Fa master +argument. +The .Fa name argument is a text name of the zone for debugging and stats; this memory should not be freed until the zone has been deallocated. @@ -114,7 +172,7 @@ The and .Fa dtor arguments are callback functions that are called by -the uma subsystem at the time of the call to +the UMA subsystem at the time of the call to .Fn uma_zalloc and .Fn uma_zfree @@ -126,49 +184,91 @@ A good usage for the .Fa ctor and .Fa dtor -callbacks -might be to adjust a global count of the number of objects allocated. +callbacks might be to initialize a data structure embedded in the item, +such as a +.Xr queue 3 +head. .Pp The -.Fa uminit +.Fa zinit and -.Fa fini -arguments are used to optimize the allocation of -objects from the zone. -They are called by the uma subsystem whenever -it needs to allocate or free several items to satisfy requests or memory -pressure. +.Fa zfini +arguments are used to optimize the allocation of items from the zone. +They are called by the UMA subsystem whenever +it needs to allocate or free items to satisfy requests or memory pressure. A good use for the -.Fa uminit +.Fa zinit and -.Fa fini +.Fa zfini callbacks might be to -initialize and destroy mutexes contained within the object. -This would -allow one to re-use already initialized mutexes when an object is returned -from the uma subsystem's object cache. +initialize and destroy a mutex contained within an item. +This would allow one to avoid destroying and re-initializing the mutex +each time the item is freed and re-allocated. They are not called on each call to .Fn uma_zalloc and .Fn uma_zfree -but rather in a batch mode on several objects. +but rather when an item is imported into a zone's cache, and when a zone +releases an item to the slab allocator, typically as a response to memory +pressure. .Pp +For +.Fn uma_zcache_create , +the +.Fa zimport +and +.Fa zrelease +functions are called to import items into the zone and to release items +from the zone, respectively. The +.Fa zimport +function should store pointers to items in the +.Fa store +array, which contains a maximum of +.Fa count +entries. +The function must return the number of imported items, which may be less than +the maximum. +Similarly, the +.Fa store +parameter to the +.Fa zrelease +function contains an array of +.Fa count +pointers to items. +The +.Fa arg +parameter passed to +.Fn uma_zcache_create +is provided to the import and release functions. +The +.Fa domain +parameter to +.Fa zimport +specifies the requested +.Xr numa 4 +domain for the allocation. +It is either a NUMA domain number or the special value +.Dv UMA_ANYDOMAIN . +.Pp +The .Fa flags -argument of the +argument of .Fn uma_zcreate +and +.Fn uma_zcache_create is a subset of the following flags: .Bl -tag -width "foo" .It Dv UMA_ZONE_NOFREE -Slabs of the zone are never returned back to VM. +Slabs allocated to the zone's keg are never freed. .It Dv UMA_ZONE_NODUMP -Pages belonging to the zone will not be included into mini-dumps. +Pages belonging to the zone will not be included in minidumps. .It Dv UMA_ZONE_PCPU An allocation from zone would have .Va mp_ncpu shadow copies, that are privately assigned to CPUs. -A CPU can address its private copy using base allocation address plus -multiple of current CPU id and +A CPU can address its private copy using base the allocation address plus +a multiple of the current CPU ID and .Fn sizeof "struct pcpu" : .Bd -literal -offset indent foo_zone = uma_zcreate(..., UMA_ZONE_PCPU); @@ -179,7 +279,15 @@ critical_enter(); foo_pcpu = (foo_t *)zpcpu_get(foo_base); /* do something with foo_pcpu */ critical_exit(); + .Ed +Note that +.Dv M_ZERO +cannot be used when allocating items from a PCPU zone. +To obtain zeroed memory from a PCPU zone, use the +.Fn uma_zalloc_pcpu +function and its variants instead, and pass +.Dv M_ZERO . .It Dv UMA_ZONE_OFFPAGE By default book-keeping of items within a slab is done in the slab page itself. This flag explicitly tells subsystem that book-keeping structure should be @@ -220,24 +328,40 @@ subsystem. The zone is for the VM subsystem. .It Dv UMA_ZONE_NUMA The zone should use a first-touch NUMA policy rather than the round-robin -default. Callers that do not free memory on the same domain it is allocated -from will cause mixing in per-cpu caches. See -.Xr numa 9 for more details. +default. +If the +.Dv UMA_FIRSTTOUCH +kernel option is configured, all zones implicitly use a first-touch policy, +and the +.Dv UMA_ZONE_NUMA +flag has no effect. +The +.Dv UMA_XDOMAIN +kernel option, when configured, causes UMA to do the extra tracking to ensure +that allocations from first-touch zones are always local. +Otherwise, consumers that do not free memory on the same domain from which it +was allocated will cause mixing in per-CPU caches. +See +.Xr numa 4 +for more details. .El .Pp +Zones can be destroyed using +.Fn uma_zdestroy , +freeing all memory that is cached in the zone. +All items allocated from the zone must be freed to the zone before the zone +may be safely destroyed. +.Pp To allocate an item from a zone, simply call .Fn uma_zalloc -with a pointer to that zone -and set the +with a pointer to that zone and set the .Fa flags argument to selected flags as documented in .Xr malloc 9 . -It will return a pointer to an item if successful, -or +It will return a pointer to an item if successful, or .Dv NULL in the rare case where all items in the zone are in use and the -allocator is unable to grow the zone -and +allocator is unable to grow the zone and .Dv M_NOWAIT is specified. .Pp @@ -253,7 +377,7 @@ then .Fn uma_zfree does nothing. .Pp -The variations +The variants .Fn uma_zalloc_arg and .Fn uma_zfree_arg @@ -262,29 +386,71 @@ specify an argument for the .Dv ctor and .Dv dtor -functions, respectively. -The +functions of the zone, respectively. +The .Fn uma_zalloc_domain function allows callers to specify a fixed -.Xr numa 9 domain to allocate from. This uses a guaranteed but slow path in -the allocator which reduces concurrency. The +.Xr numa 4 +domain to allocate from. +This uses a guaranteed but slow path in the allocator which reduces +concurrency. +The .Fn uma_zfree_domain -function should be used to return memory allocated in this fashion. This -function infers the domain from the pointer and does not require it as an +function should be used to return memory allocated in this fashion. +This function infers the domain from the pointer and does not require it as an argument. .Pp -Created zones, -which are empty, -can be destroyed using -.Fn uma_zdestroy , -freeing all memory that was allocated for the zone. -All items allocated from the zone with +The +.Fn uma_zone_prealloc +function allocates slabs for the requested number of items, typically following +the initial creation of a zone. +Subsequent allocations from the zone will be satisfied using the pre-allocated +slabs. +Note that slab allocation is performed with the +.Dv M_WAITOK +flag, so +.Fn uma_zone_prealloc +may sleep. +.Pp +The +.Fn uma_zone_reserve +function sets the number of reserved items for the zone. .Fn uma_zalloc -must have been freed with -.Fn uma_zfree -before. +and variants will ensure that the zone contains at least the reserved number +of free items. +Reserved items may be allocated by specifying +.Dv M_USE_RESERVE +in the allocation request flags. +.Fn uma_zone_reserve +does not perform any pre-allocation by itself. .Pp The +.Fn uma_zone_reserve_kva +function pre-allocates kernel virtual address space for the requested +number of items. +Subsequent allocations from the zone will be satisfied using the pre-allocated +address space. +Note that unlike +.Fn uma_zone_reserve , +.Fn uma_zone_reserve_kva +does not restrict the use of the pre-allocation to +.Dv M_USE_RESERVE +requests. +.Pp +The +.Fn uma_zone_set_allocf +and +.Fn uma_zone_set_freef +functions allow a zone's default slab allocation and free functions to be +overridden. +This is useful if the zone's items have special memory allocation constraints. +For example, if multi-page objects are required to be physically contiguous, +an +.Fa allocf +function which requests contiguous memory from the kernel's page allocator +may be used. +.Pp +The .Fn uma_zone_set_max function limits the number of items .Pq and therefore memory @@ -304,12 +470,21 @@ because all of the remaining free items may be in the other CPUs when the limit is hit. .Pp The +.Fn uma_zone_set_maxcache +function limits the number of free items which may be cached in the zone, +excluding the per-CPU caches, which are bounded in size. +For example, to implement a +.Ql pure +per-CPU cache, a cache zone may be configured with a maximum cache size of 0. +.Pp +The .Fn uma_zone_get_max function returns the effective upper limit number of items for a zone. .Pp The .Fn uma_zone_get_cur -function returns the approximate current occupancy of the zone. +function returns an approximation of the number of items currently allocated +from the zone. The returned value is approximate because appropriate synchronisation to determine an exact value is not performed by the implementation. This ensures low overhead at the expense of potentially stale data being used @@ -338,7 +513,7 @@ this function should do very little work (similar to a The .Fn SYSCTL_UMA_MAX parent nbr name access zone descr macro declares a static -.Xr sysctl +.Xr sysctl 9 oid that exports the effective upper limit number of items for a zone. The .Fa zone @@ -355,7 +530,7 @@ macro is provided to create this type of oid dynamical The .Fn SYSCTL_UMA_CUR parent nbr name access zone descr macro declares a static read-only -.Xr sysctl +.Xr sysctl 9 oid that exports the approximate current occupancy of the zone. The .Fa zone @@ -366,15 +541,6 @@ A read of the oid returns value obtained through The .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr macro is provided to create this type of oid dynamically. -.Sh RETURN VALUES -The -.Fn uma_zalloc -function returns a pointer to an item, or -.Dv NULL -if the zone ran out of unused items -and -.Dv M_NOWAIT -was specified. .Sh IMPLEMENTATION NOTES The memory that these allocation calls return is not executable. The @@ -385,7 +551,14 @@ flag to allocate executable memory. Not all platforms enforce a distinction between executable and non-executable memory. .Sh SEE ALSO +.Xr numa 4 , +.Xr vmstat 8 , .Xr malloc 9 +.Rs +.%A Jeff Bonwick +.%T "The Slab Allocator: An Object-Caching Kernel Memory Allocator" +.%D 1994 +.Re .Sh HISTORY The zone allocator first appeared in .Fx 3.0 . From owner-svn-src-head@freebsd.org Fri Aug 30 20:19:44 2019 Return-Path: Delivered-To: svn-src-head@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 7BD71D7895; Fri, 30 Aug 2019 20:19:44 +0000 (UTC) (envelope-from mjoras@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 46KrS02hY0z4WBr; Fri, 30 Aug 2019 20:19:44 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D3D5969; Fri, 30 Aug 2019 20:19:44 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7UKJidI080470; Fri, 30 Aug 2019 20:19:44 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UKJiRQ080469; Fri, 30 Aug 2019 20:19:44 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201908302019.x7UKJiRQ080469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Fri, 30 Aug 2019 20:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351629 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 351629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 20:19:44 -0000 Author: mjoras Date: Fri Aug 30 20:19:43 2019 New Revision: 351629 URL: https://svnweb.freebsd.org/changeset/base/351629 Log: Wrap a vlan's parent's if_output in a separate function. When a vlan interface is created, its if_output is set directly to the parent interface's if_output. This is fine in the normal case but has an unfortunate consequence if you end up with a certain combination of vlan and lagg interfaces. Consider you have a lagg interface with a single laggport member. When an interface is added to a lagg its if_output is set to lagg_port_output, which blackholes traffic from the normal networking stack but not certain frames from BPF (pseudo_AF_HDRCMPLT). If you now create a vlan with the laggport member (not the lagg interface) as its parent, its if_output is set to lagg_port_output as well. While this is confusing conceptually and likely represents a misconfigured system, it is not itself a problem. The problem arises when you then remove the lagg interface. Doing this resets the if_output of the laggport member back to its original state, but the vlan's if_output is left pointing to lagg_port_output. This gives rise to the possibility that the system will panic when e.g. bpf is used to send any frames on the vlan interface. Fix this by creating a new function, vlan_output, which simply wraps the parent's current if_output. That way when the parent's if_output is restored there is no stale usage of lagg_port_output. Reviewed by: rstone Differential Revision: D21209 Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Aug 30 19:35:44 2019 (r351628) +++ head/sys/net/if_vlan.c Fri Aug 30 20:19:43 2019 (r351629) @@ -294,6 +294,8 @@ static int vlan_setflag(struct ifnet *ifp, int flag, i static int vlan_setflags(struct ifnet *ifp, int status); static int vlan_setmulti(struct ifnet *ifp); static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); +static int vlan_output(struct ifnet *ifp, struct mbuf *m, + const struct sockaddr *dst, struct route *ro); static void vlan_unconfig(struct ifnet *ifp); static void vlan_unconfig_locked(struct ifnet *ifp, int departing); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); @@ -1209,6 +1211,27 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m) return (error); } +static int +vlan_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) +{ + struct epoch_tracker et; + struct ifvlan *ifv; + struct ifnet *p; + + NET_EPOCH_ENTER(et); + ifv = ifp->if_softc; + if (TRUNK(ifv) == NULL) { + NET_EPOCH_EXIT(et); + m_freem(m); + return (ENETDOWN); + } + p = PARENT(ifv); + NET_EPOCH_EXIT(et); + return p->if_output(ifp, m, dst, ro); +} + + /* * The ifp->if_qflush entry point for vlan(4) is a no-op. */ @@ -1424,12 +1447,17 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint1 */ ifp->if_mtu = p->if_mtu - ifv->ifv_mtufudge; ifp->if_baudrate = p->if_baudrate; - ifp->if_output = p->if_output; ifp->if_input = p->if_input; ifp->if_resolvemulti = p->if_resolvemulti; ifp->if_addrlen = p->if_addrlen; ifp->if_broadcastaddr = p->if_broadcastaddr; ifp->if_pcp = ifv->ifv_pcp; + + /* + * We wrap the parent's if_output using vlan_output to ensure that it + * can't become stale. + */ + ifp->if_output = vlan_output; /* * Copy only a selected subset of flags from the parent. From owner-svn-src-head@freebsd.org Fri Aug 30 20:54:31 2019 Return-Path: Delivered-To: svn-src-head@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 2C0E4D83C1; Fri, 30 Aug 2019 20:54:31 +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 46KsD70Lxfz4XwW; Fri, 30 Aug 2019 20:54:31 +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 DD7C160B6; Fri, 30 Aug 2019 20:54:30 +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 x7UKsUfd005628; Fri, 30 Aug 2019 20:54:30 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7UKsUWp005627; Fri, 30 Aug 2019 20:54:30 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908302054.x7UKsUWp005627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Aug 2019 20:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351630 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 351630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 20:54:31 -0000 Author: tsoome Date: Fri Aug 30 20:54:30 2019 New Revision: 351630 URL: https://svnweb.freebsd.org/changeset/base/351630 Log: qemu-system-aarch64 does list block device with very large block size Also insert Vendor device as "parent" disk (found in qemu-system-aarch64 -cpu cortex-a57). This does fix lsdev in loader.efi on this platform. Modified: head/stand/efi/libefi/efipart.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Fri Aug 30 20:19:43 2019 (r351629) +++ head/stand/efi/libefi/efipart.c Fri Aug 30 20:54:30 2019 (r351630) @@ -255,10 +255,12 @@ efipart_inithandles(void) /* * We assume the block size 512 or greater power of 2. + * Also skip devices with block size > 32k. * iPXE is known to insert stub BLOCK IO device with * BlockSize 1. */ if (blkio->Media->BlockSize < 512 || + blkio->Media->BlockSize > (1 << 15) || !powerof2(blkio->Media->BlockSize)) { continue; } @@ -603,7 +605,8 @@ restart: continue; if (DevicePathType(node) == HARDWARE_DEVICE_PATH && - DevicePathSubType(node) == HW_PCI_DP) { + (DevicePathSubType(node) == HW_PCI_DP || + DevicePathSubType(node) == HW_VENDOR_DP)) { STAILQ_REMOVE(&pdinfo, hd, pdinfo, pd_link); efipart_hdinfo_add(hd, NULL); goto restart; From owner-svn-src-head@freebsd.org Fri Aug 30 21:49:01 2019 Return-Path: Delivered-To: svn-src-head@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 17B5BD9687; Fri, 30 Aug 2019 21:49:01 +0000 (UTC) (envelope-from sevan@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 46KtR06dTGz4bSK; Fri, 30 Aug 2019 21:49:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0CD669AC; Fri, 30 Aug 2019 21:49:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7ULn0Ek036023; Fri, 30 Aug 2019 21:49:00 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7ULn0dO036022; Fri, 30 Aug 2019 21:49:00 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201908302149.x7ULn0dO036022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Fri, 30 Aug 2019 21:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351631 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 351631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 21:49:01 -0000 Author: sevan (doc committer) Date: Fri Aug 30 21:49:00 2019 New Revision: 351631 URL: https://svnweb.freebsd.org/changeset/base/351631 Log: Earliest reference to /dev/null I can find is in v4 sh(1) and nulldev in nsys/ken/subr.c via TUHS archive https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4 MFC after: 5 days Modified: head/share/man/man4/null.4 Modified: head/share/man/man4/null.4 ============================================================================== --- head/share/man/man4/null.4 Fri Aug 30 20:54:30 2019 (r351630) +++ head/share/man/man4/null.4 Fri Aug 30 21:49:00 2019 (r351631) @@ -28,7 +28,7 @@ .\" @(#)null.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd August 30, 2019 .Dt NULL 4 .Os .Sh NAME @@ -54,4 +54,4 @@ device is always zero. A .Nm device appeared in -.At v7 . +.At v4 . From owner-svn-src-head@freebsd.org Fri Aug 30 21:54:46 2019 Return-Path: Delivered-To: svn-src-head@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 3533ED995C; Fri, 30 Aug 2019 21:54:46 +0000 (UTC) (envelope-from mjg@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 46KtYf0WxTz4bx1; Fri, 30 Aug 2019 21:54:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E76AF6B83; Fri, 30 Aug 2019 21:54:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7ULsjix041812; Fri, 30 Aug 2019 21:54:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7ULsjda041811; Fri, 30 Aug 2019 21:54:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908302154.x7ULsjda041811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 30 Aug 2019 21:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351632 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 21:54:46 -0000 Author: mjg Date: Fri Aug 30 21:54:45 2019 New Revision: 351632 URL: https://svnweb.freebsd.org/changeset/base/351632 Log: vfs: add a missing VNODE_REFCOUNT_FENCE_REL to v_incr_usecount_locked Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 30 21:49:00 2019 (r351631) +++ head/sys/kern/vfs_subr.c Fri Aug 30 21:54:45 2019 (r351632) @@ -2641,6 +2641,7 @@ v_incr_usecount_locked(struct vnode *vp) VNASSERT(vp->v_usecount == 0, vp, ("vnode with usecount and VI_OWEINACT set")); vp->v_iflag &= ~VI_OWEINACT; + VNODE_REFCOUNT_FENCE_REL(); } refcount_acquire(&vp->v_usecount); v_incr_devcount(vp); From owner-svn-src-head@freebsd.org Fri Aug 30 22:00:27 2019 Return-Path: Delivered-To: svn-src-head@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 627C9D9A62; Fri, 30 Aug 2019 22:00:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 46KthB3cdRz4cBD; Fri, 30 Aug 2019 22:00:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x230.google.com with SMTP id h4so3092193oih.8; Fri, 30 Aug 2019 15:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8jadTFPHqI2qy7CCPO767KRMGil7ZNTX2CJLKyglCYA=; b=CNoL0OnPjDFOUBaNDpPe/bSyW4YsABEPeVcQernMwznYXCP+RYQjM1QfksUnU4hYHd YPQy8XvptNr5fcYtC8YOs0Z9/VrNRze4Y9GCQlzUW5NrhVN25mUCRn52ZKahAQAQDtN7 l/C8RqF+H31dsogiwnl1bIG9DYT2Hws/feF/r2onZCe257khr41mzZX3DUwOugMvKyLM gSJuOpRkU0QEA99GM/FIwXBHJxwUA7LdAQORkRPCWXnHTqcHRCCaO76qB5vupcYLTV0d yh3UYZBH1t9vCDhByiCTLZg2t37tOdnmuNZDuI5fTfPzUPTxBsf8Ui74Q/D3anPtRTHS 2G4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8jadTFPHqI2qy7CCPO767KRMGil7ZNTX2CJLKyglCYA=; b=L9/n2SPDottw2HaLuJPX32f3RDtskeKkmp/AcsX5cWn4+rsRW8gSZBhN7l0756Mcrp NY0Zsf5h/T4SfX+TSu46HYMtzxPzpeKXaEOkbFPnytSDl23R+FZttN0zfjQRHGes7yS0 DebnmTLmIcfH6jFBtumATbJhsgqg4TxSpzc7Asw1m8BvO6bPQvkd6YDDs9nbcXZ6HQpt N4y1mCXQtJN+tBPHzwoYO3P5IUdDqrmhBDWTuchHm5QWjCYwbz1B3O8yad3s+n+aNGQh Lzgp9PJtFH0Lvuc8n2vsXRZZUCpMV3WMSuSzaWz0MoMz54kTNxxdz+ggBOLFlDaez34N 3R2A== X-Gm-Message-State: APjAAAWvlPmhNP7knTO00zvEBm7lbUM41L58PAfJ2CiO0WiU8yVrnNvd guXIvBTvraZg6xbAjhAJ9XH1xwkpNOk+Yf/aQNA= X-Google-Smtp-Source: APXvYqxVQzqWjcQETz/o9ukowb46jWZ1tJMOwtF+fuaU5VppLprv6IJRuDaWFlGgk9glTJ305PMRATNvn1PyUvLacZE= X-Received: by 2002:aca:bb42:: with SMTP id l63mr11859820oif.85.1567202424975; Fri, 30 Aug 2019 15:00:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:83d6:0:0:0:0:0 with HTTP; Fri, 30 Aug 2019 15:00:24 -0700 (PDT) In-Reply-To: <20190830102943.GE71821@kib.kiev.ua> References: <201908300045.x7U0jsq9083259@repo.freebsd.org> <20190830102943.GE71821@kib.kiev.ua> From: Mateusz Guzik Date: Sat, 31 Aug 2019 00:00:24 +0200 Message-ID: Subject: Re: svn commit: r351622 - head/sys/kern To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46KthB3cdRz4cBD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=CNoL0OnP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::230 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-8.23), ipnet: 2607:f8b0::/32(-2.84), asn: 15169(-2.32), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.2.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]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 22:00:27 -0000 On 8/30/19, Konstantin Belousov wrote: > On Fri, Aug 30, 2019 at 12:45:54AM +0000, Mateusz Guzik wrote: >> + VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, > A more precise assert condition would also include > vp->v_holdcont >= vp->v_usecount > I agree, but that would be problematic to test for due to other threads playing with these counters. Note this commit was just diff reduction for "usecount implies holdcnt" ( https://reviews.freebsd.org/D21471 ) after which the stronger assertion would not hold. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Aug 30 22:03:11 2019 Return-Path: Delivered-To: svn-src-head@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 94BA7D9C63; Fri, 30 Aug 2019 22:03:11 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 46KtlL5fxNz4cYj; Fri, 30 Aug 2019 22:03:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x32a.google.com with SMTP id n7so940644otk.6; Fri, 30 Aug 2019 15:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nMw7XNkA4/p00cNqHNL5Pq5Gy+S1aHYJthDnzgkucoM=; b=RmaMf6a0js/5ZPhA+N8ApOHQjx12QSVDlM7AwEmlVhZ1qUrUF3aIvHz61zK1bXAWMZ 5KCySgEpmHSa6g1Qc8t2AJodKAzzBPXD8BXwJWDIiHPa45OlugMjpeyQBLA66N1W1mlf q3OYSQQkEoHVx57ojHnk56cEp2+wZiXjXcrIEhkZgn5GMhLcAbUdMf52ohK700WcXe+n mzPwPBo19QtXaaMkiCEGL9R7PETfkDJ5pFzS24BcRt4qkEx8GCaP2yC53fRDERb+6jge /m7ZW1Q3q4HYMDEi3/MtxwpfGFXuRveBMH3usajn4Be7S2pS8R2l5MKadfHIlojT+bg8 +fPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nMw7XNkA4/p00cNqHNL5Pq5Gy+S1aHYJthDnzgkucoM=; b=jQCc64goME4sAN0Mk8rcGkaRsOAAoZUJyhoIleBe5Owa7ZncfX2cQ4kEMVPdXE4Jmx ZM2F1bDnzfHVIlDDq7m7Eg50PAUk7ltfFcm2r9tJIZPjcDlZIsXfkAziyBjEEjJRFVGA xZ+hDC+MnTCKjXrZK7kg1UbxcMiJKOjvAxiwafCuj+iwGObNRroVFwzEl3wMTZ5muZPj h2WWtbscahw4DS1/8MLDAiikEOkONXA5MuN1X3l2dYUdl6/sbDPR6jqMh/V8U5KXhxOR cGEX7jUYzM587CiLK5u23+vIuuAmO581zGFUIWy0Mg18WWd8fZtKm8rNW6rb1ZCWTVjh 9WUg== X-Gm-Message-State: APjAAAX7jCHkejZar4GR5OQsCxfi02akOmtYKKH6/HRjlFqA3GiFCMzW 9WGOhzmyWqnc+68sr6Ay2JIcXkT6R2X0y+Ifp6OYWQ== X-Google-Smtp-Source: APXvYqwshPBQXyh0XwGHA1XapoHrXxcRCShkoUE6jQwclTFWw+S5bRrJPYUGd3+f7zW/P9F5gVlxilTGQUdwhUqD254= X-Received: by 2002:a9d:7f05:: with SMTP id j5mr5429033otq.102.1567202589509; Fri, 30 Aug 2019 15:03:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:83d6:0:0:0:0:0 with HTTP; Fri, 30 Aug 2019 15:03:08 -0700 (PDT) In-Reply-To: References: <201908250511.x7P5BiPl016074@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 31 Aug 2019 00:03:08 +0200 Message-ID: Subject: Re: svn commit: r351471 - in head/sys: kern sys To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46KtlL5fxNz4cYj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=RmaMf6a0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::32a as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-7.71), ipnet: 2607:f8b0::/32(-2.84), asn: 15169(-2.32), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[a.2.3.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]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 22:03:11 -0000 On 8/25/19, Oliver Pinter wrote: > On Sunday, August 25, 2019, Mateusz Guzik wrote: > >> Author: mjg >> Date: Sun Aug 25 05:11:43 2019 >> New Revision: 351471 >> URL: https://svnweb.freebsd.org/changeset/base/351471 >> >> Log: >> vfs: add vholdnz (for already held vnodes) > > > Why? > > (Yes, is can read the real reason in phabricator, but the phabricator > didn't considered a persistent information in relation to commit message. > Review helper tool just comes and goes as time goes forward, but commit > messages survives the repo conversions to other VCS...) > > And once you have taken the time to write a correct description in > phabricator, it would be really really nice and helpful if you would copy > them into commit message. > I think it's a fair point that if I included this info in the review it should make it's way into the commit message. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Aug 30 22:09:12 2019 Return-Path: Delivered-To: svn-src-head@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 028F6DA238 for ; Fri, 30 Aug 2019 22:09:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46KttH4Dzlz4cyc for ; Fri, 30 Aug 2019 22:09:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1567202949; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=BDnzhzE0LkDTjnsUmL9zcDpb/Tsk/FQgEIvQ1WPCgLpRi8bOXsttT9gIlXiBYK0B+XGmaQJlvpGkx 04KAdPiV577aIIzmO2CLcoZSV+71PTpBl9wMlVvHs4AqEj1IlUTb92KQ+zTfLHedC+L0H8d+k82HqW 5u69E6tus7RY/HZYsksZX8bHtayQVwIDw6+v/iyv0IyuO4B1GVa8g0CQ7JSHIGrFb3wsgWIbBwBWT9 W6PN5t6EGxf2RfZuOdzUydRL4C1Rsm40imMCXqSIXrx3sSVboEetObVycAJLwvERJKuOi2F1n3z27y xee5kPN9F6c69/bzWmwnR2z26xj+2Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=Y2vNdoT36ll9dWXbUeng8xFhar5CS2TAf83tj3AUalM=; b=gOaVBI0Rz1AaNz48KB0D9B6WTGpVSgxcMCSf2mGwc1L1id1HhR+6VGWM6lCI0Pn3TOjc5CzaVtYLO HDzxLiunBi6eqNT5T3gKeu2aE3YFjqlElSVMV4c9TSXNaNILg306Qy3//JfaRf+TiDlQEuilv7ce+6 8Lok6BCD1PvJHdlrUpMn7e9Ea2lWihZSPM2Jf9uMRFF+f82MHLI0U2r6bhp2RyO+JjCY5EPVjjOVdT 8/R1y0tMM+WJOqDarbTxXDMNO4nCmAD5z0Dp6X+EOPvu6jKs3pU7F9/dCQED7PKQGeyhXO03xg2xMI 2VMgjSMrVbCJuKUoZ0Wd2cdp8P1yfkg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=Y2vNdoT36ll9dWXbUeng8xFhar5CS2TAf83tj3AUalM=; b=so5Ac+XmcIpus9PacZnDPeHR0BOpLZdqb453R5PRaY5NnJj2qsTz50laofCbWtiNu0xXAcB9NASVy qLLj09lR37uqqs24XKONtElFZaNL1xdxCQoaxdhv3NvPwsf+kdjVtjo9ZSCuadzPKnmxtXQQKzYqUg 82MZ40tXfQF1ana7byNgMq1GruXIw9n+EPmR6fR0a7X4yfM0LpR7tNf/BD3k2xgvBvArZ1Bzv2R2Vl bjWs5VtInldb086+INKf2TeOn9bgVNiGCSDVDuDI9QHUZbJbixQ2qJIv/examb/S7NGe2fnfNLQr/Z Q0uygIm8pE5WQab6jBVRfLANZB+M9iQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: c8e7425b-cb72-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c8e7425b-cb72-11e9-85ed-13b9aae3a1d2; Fri, 30 Aug 2019 22:09:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x7UM96rB022648; Fri, 30 Aug 2019 16:09:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <6035df87490ebb7429f76d57a3a5d33e86c06b56.camel@freebsd.org> Subject: Re: svn commit: r351471 - in head/sys: kern sys From: Ian Lepore To: Mateusz Guzik , Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Fri, 30 Aug 2019 16:09:06 -0600 In-Reply-To: References: <201908250511.x7P5BiPl016074@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46KttH4Dzlz4cyc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2019 22:09:12 -0000 On Sat, 2019-08-31 at 00:03 +0200, Mateusz Guzik wrote: > On 8/25/19, Oliver Pinter wrote: > > On Sunday, August 25, 2019, Mateusz Guzik wrote: > > > > > Author: mjg > > > Date: Sun Aug 25 05:11:43 2019 > > > New Revision: 351471 > > > URL: https://svnweb.freebsd.org/changeset/base/351471 > > > > > > Log: > > > vfs: add vholdnz (for already held vnodes) > > > > > > Why? > > > > (Yes, is can read the real reason in phabricator, but the > > phabricator > > didn't considered a persistent information in relation to commit > > message. > > Review helper tool just comes and goes as time goes forward, but > > commit > > messages survives the repo conversions to other VCS...) > > > > And once you have taken the time to write a correct description in > > phabricator, it would be really really nice and helpful if you > > would copy > > them into commit message. > > > > I think it's a fair point that if I included this info in the review > it > should make it's way into the commit message. > When I open a new phab review, I specifically write the one-line summary and text that follows with the idea that I'm going to cut and paste that exact text as the commit message (mostly because it's easier to just write all that stuff once). If there are things I want to say there that don't make sense for the commit I typically add them as a separate comment right after I open the initial review. -- Ian From owner-svn-src-head@freebsd.org Sat Aug 31 00:45:02 2019 Return-Path: Delivered-To: svn-src-head@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 586BADC887; Sat, 31 Aug 2019 00:45:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46KyL56XQpz3Fky; Sat, 31 Aug 2019 00:45:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3rVgiYr3ISrVc3rVhi3G37; Fri, 30 Aug 2019 18:44:59 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=FmdZ9Uzk2mMA:10 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=YxBL1-UpAAAA:8 a=KWaSwiQ3T9b_v806dOsA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [IPv6:2605:8d80:403:7c6b:45f7:b036:707d:4d1f] (unknown [72.143.236.68]) by spqr.komquats.com (Postfix) with ESMTPSA id 268CB97A; Fri, 30 Aug 2019 17:44:55 -0700 (PDT) Date: Fri, 30 Aug 2019 17:44:26 -0700 In-Reply-To: <6035df87490ebb7429f76d57a3a5d33e86c06b56.camel@freebsd.org> References: <201908250511.x7P5BiPl016074@repo.freebsd.org> <6035df87490ebb7429f76d57a3a5d33e86c06b56.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r351471 - in head/sys: kern sys To: Ian Lepore , Mateusz Guzik , Oliver Pinter CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfFQXh4OD9+nXTHXvrSfxvAArtUAegC3sJuW4rhoGKUvZqxJzgy6ctoP3i3g0shM/BDv45mqu+5Gl73azHOl7UUnCOtBjD4fDGMae0H0cV1L4xCKpd6jQ ltzCNdUwmJa7sBaX8h+fryxlOmnsMAaEhgBZyObgx2pwUtmrOsTBk0W338mzpDK3Wn6s3NWQ0zHHXmCd5n76BEe+UTG7KHsm4ty45XjANQSKs3V3F1PWEUBz HzYStXkbseRDY4K/fv1wOm7VeoU610d/ZqFiUvVnbp+WMrqh53txNrAAJnmg5v6987zsm7lE1yW2uwjVer93SeffG629HXvMDK1Bw+RRsXY= X-Rspamd-Queue-Id: 46KyL56XQpz3Fky X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 00:45:02 -0000 On August 30, 2019 3:09:06 PM PDT, Ian Lepore wrote: >On Sat, 2019-08-31 at 00:03 +0200, Mateusz Guzik wrote: >> On 8/25/19, Oliver Pinter wrote: >> > On Sunday, August 25, 2019, Mateusz Guzik wrote: >> >=20 >> > > Author: mjg >> > > Date: Sun Aug 25 05:11:43 2019 >> > > New Revision: 351471 >> > > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/351471 >> > >=20 >> > > Log: >> > > vfs: add vholdnz (for already held vnodes) >> >=20 >> >=20 >> > Why? >> >=20 >> > (Yes, is can read the real reason in phabricator, but the >> > phabricator >> > didn't considered a persistent information in relation to commit >> > message=2E >> > Review helper tool just comes and goes as time goes forward, but >> > commit >> > messages survives the repo conversions to other VCS=2E=2E=2E) >> >=20 >> > And once you have taken the time to write a correct description in >> > phabricator, it would be really really nice and helpful if you >> > would copy >> > them into commit message=2E >> >=20 >>=20 >> I think it's a fair point that if I included this info in the review >> it >> should make it's way into the commit message=2E >>=20 > >When I open a new phab review, I specifically write the one-line >summary and text that follows with the idea that I'm going to cut and >paste that exact text as the commit message (mostly because it's easier >to just write all that stuff once)=2E If there are things I want to say >there that don't make sense for the commit I typically add them as a >separate comment right after I open the initial review=2E > >-- Ian I like to start out with a one line summary if possible, subsequently prov= iding more detail=2E The first paragraph or two of a phab review could/should be written to sim= ply cut and paste that into the commit message=2E I try to aim for this=2E I suppose when a person has been working on some code for a while what app= ears obvious may not be so obvious to others at first=2E It's an easy trap = to fall into=2E Something I catch myself at times=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Sat Aug 31 06:24:09 2019 Return-Path: Delivered-To: svn-src-head@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 D6866E59FC; Sat, 31 Aug 2019 06:24:09 +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 46L5sP5P5jz4516; Sat, 31 Aug 2019 06:24:09 +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 9AF1BCB63; Sat, 31 Aug 2019 06:24:09 +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 x7V6O9up046187; Sat, 31 Aug 2019 06:24:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7V6O987046186; Sat, 31 Aug 2019 06:24:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908310624.x7V6O987046186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 31 Aug 2019 06:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351637 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 351637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 06:24:09 -0000 Author: tsoome Date: Sat Aug 31 06:24:09 2019 New Revision: 351637 URL: https://svnweb.freebsd.org/changeset/base/351637 Log: loader.efi: use shift 16 in efipart as it is max ashift supported by zfs Modified: head/stand/efi/libefi/efipart.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Sat Aug 31 04:28:22 2019 (r351636) +++ head/stand/efi/libefi/efipart.c Sat Aug 31 06:24:09 2019 (r351637) @@ -255,12 +255,13 @@ efipart_inithandles(void) /* * We assume the block size 512 or greater power of 2. - * Also skip devices with block size > 32k. + * Also skip devices with block size > 64k (16 is max + * ashift supported by zfs). * iPXE is known to insert stub BLOCK IO device with * BlockSize 1. */ if (blkio->Media->BlockSize < 512 || - blkio->Media->BlockSize > (1 << 15) || + blkio->Media->BlockSize > (1 << 16) || !powerof2(blkio->Media->BlockSize)) { continue; } From owner-svn-src-head@freebsd.org Sat Aug 31 08:18:50 2019 Return-Path: Delivered-To: svn-src-head@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 42422C9FEF; Sat, 31 Aug 2019 08:18:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46L8Pk1016z4DhB; Sat, 31 Aug 2019 08:18:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFC62DF8F; Sat, 31 Aug 2019 08:18:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7V8Inch014822; Sat, 31 Aug 2019 08:18:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7V8InOR014821; Sat, 31 Aug 2019 08:18:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908310818.x7V8InOR014821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 31 Aug 2019 08:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351638 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 351638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 08:18:50 -0000 Author: tuexen Date: Sat Aug 31 08:18:49 2019 New Revision: 351638 URL: https://svnweb.freebsd.org/changeset/base/351638 Log: Improve the handling of illegal sequence number combinations in received data chunks. Abort the association if there are data chunks with larger fragement sequence numbers than the fragement sequence of the last fragment. Thanks to Mark Wodrich from Google who found this issue by fuzz testing the userland stack and reporting this issue in https://github.com/sctplab/usrsctp/issues/355 MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Aug 31 06:24:09 2019 (r351637) +++ head/sys/netinet/sctp_indata.c Sat Aug 31 08:18:49 2019 (r351638) @@ -1479,6 +1479,16 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc "The last fsn is now in place fsn: %u\n", chk->rec.data.fsn); control->last_frag_seen = 1; + if (SCTP_TSN_GT(control->top_fsn, chk->rec.data.fsn)) { + SCTPDBG(SCTP_DEBUG_XXX, + "New fsn: %u is not at top_fsn: %u -- abort\n", + chk->rec.data.fsn, + control->top_fsn); + sctp_abort_in_reasm(stcb, control, chk, + abort_flag, + SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); + return; + } } if (asoc->idata_supported || control->first_frag_seen) { /* @@ -1494,7 +1504,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc */ sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); return; } } @@ -1506,7 +1516,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc chk->rec.data.fsn, control->top_fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); return; } if (asoc->idata_supported || control->first_frag_seen) { @@ -1527,7 +1537,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc chk->rec.data.fsn, control->fsn_included); sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_12); return; } } @@ -1542,7 +1552,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc control->top_fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_12); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); return; } } @@ -1585,7 +1595,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc at->rec.data.fsn); sctp_abort_in_reasm(stcb, control, chk, abort_flag, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); + SCTP_FROM_SCTP_INDATA + SCTP_LOC_14); return; } } From owner-svn-src-head@freebsd.org Sat Aug 31 13:13:41 2019 Return-Path: Delivered-To: svn-src-head@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 4C497D1DCF; Sat, 31 Aug 2019 13:13:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 46LGxx11FKz4Tfx; Sat, 31 Aug 2019 13:13:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07A6219670; Sat, 31 Aug 2019 13:13:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7VDDecA093322; Sat, 31 Aug 2019 13:13:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VDDebb093321; Sat, 31 Aug 2019 13:13:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908311313.x7VDDebb093321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 31 Aug 2019 13:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351641 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 351641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 13:13:41 -0000 Author: tuexen Date: Sat Aug 31 13:13:40 2019 New Revision: 351641 URL: https://svnweb.freebsd.org/changeset/base/351641 Log: Improve function definition. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Aug 31 08:52:57 2019 (r351640) +++ head/sys/netinet/sctp_pcb.c Sat Aug 31 13:13:40 2019 (r351641) @@ -5771,7 +5771,7 @@ sctp_startup_mcore_threads(void) #endif void -sctp_pcb_init() +sctp_pcb_init(void) { /* * SCTP initialization for the PCB structures should be called by From owner-svn-src-head@freebsd.org Sat Aug 31 13:24:23 2019 Return-Path: Delivered-To: svn-src-head@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 190FAD2129; Sat, 31 Aug 2019 13:24:23 +0000 (UTC) (envelope-from mjg@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 46LHBG70Mhz4V65; Sat, 31 Aug 2019 13:24:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D36A319837; Sat, 31 Aug 2019 13:24:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7VDOMnR099487; Sat, 31 Aug 2019 13:24:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VDOM9p099486; Sat, 31 Aug 2019 13:24:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201908311324.x7VDOM9p099486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 31 Aug 2019 13:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351642 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 351642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 13:24:23 -0000 Author: mjg Date: Sat Aug 31 13:24:22 2019 New Revision: 351642 URL: https://svnweb.freebsd.org/changeset/base/351642 Log: zfs: fix snapshot dir destruction after introducion of VOP_NEED_INACTIVE Reported by: lwhsu PR: 240221 Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Aug 31 13:13:40 2019 (r351641) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Aug 31 13:24:22 2019 (r351642) @@ -1247,6 +1247,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap) static struct vop_vector zfsctl_ops_snapshot = { .vop_default = NULL, /* ensure very restricted access */ .vop_inactive = zfsctl_snapshot_inactive, + .vop_need_inactive = vop_stdneed_inactive, .vop_reclaim = zfsctl_snapshot_reclaim, .vop_vptocnp = zfsctl_snapshot_vptocnp, .vop_lock1 = vop_stdlock, From owner-svn-src-head@freebsd.org Sat Aug 31 14:41:59 2019 Return-Path: Delivered-To: svn-src-head@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 6C8B3D3923; Sat, 31 Aug 2019 14:41:59 +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 46LJvq2KnNz4Y3l; Sat, 31 Aug 2019 14:41:59 +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 32AB11A553; Sat, 31 Aug 2019 14:41:59 +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 x7VEfxpD045984; Sat, 31 Aug 2019 14:41:59 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VEfwZ3045957; Sat, 31 Aug 2019 14:41:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201908311441.x7VEfwZ3045957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 31 Aug 2019 14:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation X-SVN-Commit-Revision: 351643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 14:41:59 -0000 Author: lwhsu Date: Sat Aug 31 14:41:58 2019 New Revision: 351643 URL: https://svnweb.freebsd.org/changeset/base/351643 Log: Fix tests use /etc/motd after r350184 by using an always existing file Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 13:24:22 2019 (r351642) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 14:41:58 2019 (r351643) @@ -43,7 +43,7 @@ reader() while true do sleep 0.1 - cat /etc/motd > /dev/null + cat /COPYRIGHT > /dev/null done } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 13:24:22 2019 (r351642) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 14:41:58 2019 (r351643) @@ -44,7 +44,7 @@ reader() while true do sleep 0.1 - cat /etc/motd > /dev/null + cat /COPYRIGHT > /dev/null done } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 13:24:22 2019 (r351642) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 14:41:58 2019 (r351643) @@ -26,5 +26,5 @@ while true do sleep 0.1 - cat /etc/motd > /dev/null + cat /COPYRIGHT > /dev/null done From owner-svn-src-head@freebsd.org Sat Aug 31 15:10:28 2019 Return-Path: Delivered-To: svn-src-head@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 04706D44C6; Sat, 31 Aug 2019 15:10:28 +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 46LKXg6K0zz4Zjt; Sat, 31 Aug 2019 15:10:27 +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 BD0B81AA41; Sat, 31 Aug 2019 15:10:27 +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 x7VFARSV059852; Sat, 31 Aug 2019 15:10:27 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VFARwa059851; Sat, 31 Aug 2019 15:10:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201908311510.x7VFARwa059851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 31 Aug 2019 15:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351644 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 351644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 15:10:28 -0000 Author: lwhsu Date: Sat Aug 31 15:10:27 2019 New Revision: 351644 URL: https://svnweb.freebsd.org/changeset/base/351644 Log: Fix dtrace test case after r351423 due to ping6(8) options changed Failure test case: cddl.usr.sbin.dtrace.common.ip.t_dtrace_contrib.tst_ipv6localicmp_ksh Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh Sat Aug 31 14:41:58 2019 (r351643) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh Sat Aug 31 15:10:27 2019 (r351644) @@ -55,7 +55,7 @@ else removeinet6=0 fi -$dtrace -c "/sbin/ping6 -q -c 1 -X 3 $local" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && From owner-svn-src-head@freebsd.org Sat Aug 31 16:14:27 2019 Return-Path: Delivered-To: svn-src-head@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 97E47D5AC8; Sat, 31 Aug 2019 16:14:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46LLyW0k9Kz4dbK; Sat, 31 Aug 2019 16:14:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7VGEHwO000362; Sat, 31 Aug 2019 09:14:17 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7VGEHFl000361; Sat, 31 Aug 2019 09:14:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201908311614.x7VGEHFl000361@gndrsh.dnsmgr.net> Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation In-Reply-To: <201908311441.x7VEfwZ3045957@repo.freebsd.org> To: Li-Wen Hsu Date: Sat, 31 Aug 2019 09:14:17 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46LLyW0k9Kz4dbK X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 16:14:27 -0000 > Author: lwhsu > Date: Sat Aug 31 14:41:58 2019 > New Revision: 351643 > URL: https://svnweb.freebsd.org/changeset/base/351643 > > Log: > Fix tests use /etc/motd after r350184 by using an always existing file If the tests is dependent on "always existing" shouldnt the test insure that itself by actually creating the file? > Sponsored by: The FreeBSD Foundation > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 14:41:58 2019 (r351643) > @@ -43,7 +43,7 @@ reader() > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > } > > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 14:41:58 2019 (r351643) > @@ -44,7 +44,7 @@ reader() > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > } > > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 14:41:58 2019 (r351643) > @@ -26,5 +26,5 @@ > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Aug 31 20:45:46 2019 Return-Path: Delivered-To: svn-src-head@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 C081DDB9A0; Sat, 31 Aug 2019 20:45:46 +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 46LSzZ4QJDz3NZb; Sat, 31 Aug 2019 20:45:46 +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 7BCFF1E828; Sat, 31 Aug 2019 20:45:46 +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 x7VKjkVQ062518; Sat, 31 Aug 2019 20:45:46 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VKjk4c062516; Sat, 31 Aug 2019 20:45:46 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201908312045.x7VKjk4c062516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 31 Aug 2019 20:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351648 - in head/lib: libc/tests/stdlib msun/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/lib: libc/tests/stdlib msun/tests X-SVN-Commit-Revision: 351648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 20:45:46 -0000 Author: lwhsu Date: Sat Aug 31 20:45:45 2019 New Revision: 351648 URL: https://svnweb.freebsd.org/changeset/base/351648 Log: Unskip test cases from netbsd-tests by defining __HAVE_FENV This unskips: - lib.libc.stdlib.strtod_test.strtod_round - lib.msun.fe_round_test.t_nofe_round In lib/msun/tests/Makefile only define on fe_round_test.c because lib.msun.ilogb_test.ilogb will get wrong results and needs more examination. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/tests/stdlib/Makefile head/lib/msun/tests/Makefile Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Sat Aug 31 18:04:33 2019 (r351647) +++ head/lib/libc/tests/stdlib/Makefile Sat Aug 31 20:45:45 2019 (r351648) @@ -14,6 +14,9 @@ ATF_TESTS_CXX+= cxa_thread_atexit_test ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test .endif +# All architectures on FreeBSD have fenv.h +CFLAGS+= -D__HAVE_FENV + # Not sure why this isn't defined for all architectures, since most # have long double. .if ${MACHINE_CPUARCH} == "aarch64" || \ Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Sat Aug 31 18:04:33 2019 (r351647) +++ head/lib/msun/tests/Makefile Sat Aug 31 20:45:45 2019 (r351648) @@ -99,6 +99,8 @@ ARCH_SUBDIR= ${MACHINE_CPUARCH} # precision is. CFLAGS+= -DLDBL_PREC=${LDBL_PREC} +CFLAGS.fe_round_test+= -D__HAVE_FENV + .include .include From owner-svn-src-head@freebsd.org Sat Aug 31 21:28:07 2019 Return-Path: Delivered-To: svn-src-head@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 8FEDDDC894; Sat, 31 Aug 2019 21:28:07 +0000 (UTC) (envelope-from ray@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 46LTwR2Nwvz3QRl; Sat, 31 Aug 2019 21:28:07 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 353E31EF7E; Sat, 31 Aug 2019 21:28:07 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7VLS7iQ086675; Sat, 31 Aug 2019 21:28:07 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7VLS73b086674; Sat, 31 Aug 2019 21:28:07 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201908312128.x7VLS73b086674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Sat, 31 Aug 2019 21:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351649 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ray X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 351649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 21:28:07 -0000 Author: ray Date: Sat Aug 31 21:28:06 2019 New Revision: 351649 URL: https://svnweb.freebsd.org/changeset/base/351649 Log: ARM kernel can get RAM regions three ways: o from FDT; o from EFI; o from Linux Boot API (ATAG). U-Boot may pass RAM info all that 3 ways simultaneously. We do select between FDT and EFI, but not for ATAG. So this is not problem fix, but correctness check. MFC after: 2 weeks Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Sat Aug 31 20:45:45 2019 (r351648) +++ head/sys/arm/arm/physmem.c Sat Aug 31 21:28:06 2019 (r351649) @@ -264,6 +264,8 @@ insert_region(struct region *regions, size_t rcnt, vm_ ep = regions + rcnt; for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { + if (rp->addr == addr && rp->size == size) /* Pure dup. */ + return (rcnt); if (flags == rp->flags) { if (addr + size == rp->addr) { rp->addr = addr; From owner-svn-src-head@freebsd.org Sat Aug 31 23:28:52 2019 Return-Path: Delivered-To: svn-src-head@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 CB368E24D0; Sat, 31 Aug 2019 23:28:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 46LXbm51nnz4PFs; Sat, 31 Aug 2019 23:28:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f47.google.com with SMTP id d25so19418314iob.6; Sat, 31 Aug 2019 16:28:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=EEcKzJO7KoEbW0gO6ktFs132/4F638h7Tq9/24XE8bM=; b=UGaJ6GUmfKOaK0WXSdVZPzpFLvlITFyq+1ByA0nssxHfLBWMzz0eZq6PDq9500Wl4F k4VrwvCeiJCiAa6LSXkXlLW3KhtWRUH46kqB2gkOeTG+W4rR+p2U+jZFEXgRARF/bN02 VfYd3UBTDPuhoVfaIg8HCSUfhYUwoB+SpTykZTZjXkSLZwEQCz4VapCmB137+DdDlvuD cWyMZhKS3B+G3ZCAYygTtmJIVGzXoPN9cGUQwKMSQMG04dexdj3IHo04iJYtyJQKPZB5 7zC48NJV6Va0AIuI2Kj6hPW9cT5oU0TnX0IAsYgszg6UFw79TqzposBhcTUhsfYknYpG jfdw== X-Gm-Message-State: APjAAAXJANjeY5IPj69uh1fvqOLPnDEH7r72YNJOLtSyFjxGkS2O/2Jk ioUBb3yulWuXfx0GzL1RpmIEWBvC X-Google-Smtp-Source: APXvYqypZ438RghmTOyLRSqwqyLPcg8961/CqNzhmm74nBKZLVlYnWtoSD0YCFGFNxVVzQBhtR1ERQ== X-Received: by 2002:a6b:f717:: with SMTP id k23mr13188198iog.210.1567294131400; Sat, 31 Aug 2019 16:28:51 -0700 (PDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id r2sm7337963ioh.61.2019.08.31.16.28.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Aug 2019 16:28:50 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id f12so4430518iog.12; Sat, 31 Aug 2019 16:28:50 -0700 (PDT) X-Received: by 2002:a5e:a80f:: with SMTP id c15mr8992974ioa.270.1567294130667; Sat, 31 Aug 2019 16:28:50 -0700 (PDT) MIME-Version: 1.0 References: <201908311441.x7VEfwZ3045957@repo.freebsd.org> In-Reply-To: <201908311441.x7VEfwZ3045957@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 31 Aug 2019 16:28:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46LXbm51nnz4PFs X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 23:28:52 -0000 Thanks Li-Wen! Might it be less fragile to have the test fixture create a file, if the test(s) will expect one to be present to read? On Sat, Aug 31, 2019 at 7:42 AM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Sat Aug 31 14:41:58 2019 > New Revision: 351643 > URL: https://svnweb.freebsd.org/changeset/base/351643 > > Log: > Fix tests use /etc/motd after r350184 by using an always existing file > > Sponsored by: The FreeBSD Foundation > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh Sat Aug 31 14:41:58 2019 (r351643) > @@ -43,7 +43,7 @@ reader() > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > } > > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh Sat Aug 31 14:41:58 2019 (r351643) > @@ -44,7 +44,7 @@ reader() > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > } > > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 13:24:22 2019 (r351642) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe Sat Aug 31 14:41:58 2019 (r351643) > @@ -26,5 +26,5 @@ > while true > do > sleep 0.1 > - cat /etc/motd > /dev/null > + cat /COPYRIGHT > /dev/null > done > From owner-svn-src-head@freebsd.org Sat Aug 31 23:30:07 2019 Return-Path: Delivered-To: svn-src-head@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 E5E5EE26E9 for ; Sat, 31 Aug 2019 23:30:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 46LXdB5T0Wz4PyV for ; Sat, 31 Aug 2019 23:30:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id g4so11803762qtq.7 for ; Sat, 31 Aug 2019 16:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3QinbwSc7vA1ZhxJ87RviyLt6uLNXfmmtrDJtyP0Ff4=; b=BvB3AplxTY79/3sTKwewvIhmJYXLkmmF7XcUrHoDoBMsNzqgK11BDzBwEB7SYnEV3G wUsmuxztpjmMBbxtx+s24dMnzTiTeDSHuC1PLilwsJnmYTv0csYp/rvVIBssyMEqTEyM J2MdLpl+KDhjJgyBmK8qL5SBWJFaGpH+Vt8pXH7Yg7Ti3ZpVUUxn6E58VNXC5Xe/0T2O d+Bhu4LOXEfFoxJvuacpyFExKLCXK1p3GICD3L9xNvkypTrBo7QUxnQvU066Nh0XrREa khwGt8xMKM9UXkXYKD7fuCFglI6laWnTq5cZdvCw86KsBPntKx0vuGaVJg1AxKrxczpU QbOQ== 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=3QinbwSc7vA1ZhxJ87RviyLt6uLNXfmmtrDJtyP0Ff4=; b=UPdGMTA2X/MmCMLmhjuTBo7GtjXDhBApnHzhi1iPOnzqhi2W5Ih7KYZohKSHGssjzW 7wH7MGjTCzl6C91YIZ8GijKCTWR4BsUN9GKWmCdMuMyb8GybhJfhM/2jS4AKL2BCbkC7 azGdgIkv1lO3z1U8erGBhyI7mEOHRCVISC/lKeNQqutzSPLE2GuKmvPavCfGW3pXyBIg ypUd4N+szvzw3xGN6F/Ul92IkT0yJ2EFru93cJuAfbS4IrPbTiaFAMid+NFSbn2PvhUj ad1FxLVRrOFQrILaBv5fNZe7P51a+FslnfyALl6qMiwozd+AeffKx2a/PhXiFTbjBNV7 ja7A== X-Gm-Message-State: APjAAAU61K4v5o8YI5mivN+ixXkeEwyNW8GUZaBOATDKOtoqLaCreXcU 17te2J2zJScqYsl9IJKRPMkKdxBqfKIEceCGBN92Pw== X-Google-Smtp-Source: APXvYqz38Dq7XzWBsIouQkP3W3XrGvHLSGVhTFaZ5kH3ufPE/JStT3yqB2bq9BwDjTzxZ2cjIlBLRMfVuBMgEZukSyE= X-Received: by 2002:ac8:3364:: with SMTP id u33mr4352147qta.187.1567294205397; Sat, 31 Aug 2019 16:30:05 -0700 (PDT) MIME-Version: 1.0 References: <201908311441.x7VEfwZ3045957@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sat, 31 Aug 2019 17:29:54 -0600 Message-ID: Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation To: "Conrad E. Meyer" Cc: Li-Wen Hsu , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46LXdB5T0Wz4PyV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=BvB3Aplx; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; RCVD_IN_DNSWL_NONE(0.00)[b.2.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)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.92)[ip: (-9.40), ipnet: 2607:f8b0::/32(-2.83), asn: 15169(-2.31), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2019 23:30:08 -0000 On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: > Thanks Li-Wen! Might it be less fragile to have the test fixture > create a file, if the test(s) will expect one to be present to read? > Or just use the realpath $0, which you know has to exist :) Warner > On Sat, Aug 31, 2019 at 7:42 AM Li-Wen Hsu wrote: > > > > Author: lwhsu > > Date: Sat Aug 31 14:41:58 2019 > > New Revision: 351643 > > URL: https://svnweb.freebsd.org/changeset/base/351643 > > > > Log: > > Fix tests use /etc/motd after r350184 by using an always existing file > > > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > > > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > > > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > > > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > > > ============================================================================== > > --- > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > Sat Aug 31 13:24:22 2019 (r351642) > > +++ > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh > Sat Aug 31 14:41:58 2019 (r351643) > > @@ -43,7 +43,7 @@ reader() > > while true > > do > > sleep 0.1 > > - cat /etc/motd > /dev/null > > + cat /COPYRIGHT > /dev/null > > done > > } > > > > > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > > > ============================================================================== > > --- > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > Sat Aug 31 13:24:22 2019 (r351642) > > +++ > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh > Sat Aug 31 14:41:58 2019 (r351643) > > @@ -44,7 +44,7 @@ reader() > > while true > > do > > sleep 0.1 > > - cat /etc/motd > /dev/null > > + cat /COPYRIGHT > /dev/null > > done > > } > > > > > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > > > ============================================================================== > > --- > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > Sat Aug 31 13:24:22 2019 (r351642) > > +++ > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe > Sat Aug 31 14:41:58 2019 (r351643) > > @@ -26,5 +26,5 @@ > > while true > > do > > sleep 0.1 > > - cat /etc/motd > /dev/null > > + cat /COPYRIGHT > /dev/null > > done > > > >