From owner-svn-src-all@freebsd.org Sun Jan 26 00:34:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FA6322956B; Sun, 26 Jan 2020 00:34:58 +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 484v696JDBz4L4P; Sun, 26 Jan 2020 00:34: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 D39FB18CF4; Sun, 26 Jan 2020 00:34: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 00Q0Yvg4099424; Sun, 26 Jan 2020 00:34:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q0Yv0H099423; Sun, 26 Jan 2020 00:34:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260034.00Q0Yv0H099423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 00:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357128 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 00:34:58 -0000 Author: mjg Date: Sun Jan 26 00:34:57 2020 New Revision: 357128 URL: https://svnweb.freebsd.org/changeset/base/357128 Log: vfs: predict vn_lock failure as unlikely in vget Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 26 00:21:30 2020 (r357127) +++ head/sys/kern/vfs_subr.c Sun Jan 26 00:34:57 2020 (r357128) @@ -2911,7 +2911,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat __func__)); } - if ((error = vn_lock(vp, flags)) != 0) { + error = vn_lock(vp, flags); + if (__predict_false(error != 0)) { if (vs == VGET_USECOUNT) vrele(vp); else From owner-svn-src-all@freebsd.org Sun Jan 26 00:38:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CE9B229757; Sun, 26 Jan 2020 00:38:07 +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 484v9q0rh4z4LD1; Sun, 26 Jan 2020 00:38:07 +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 1830D18CF8; Sun, 26 Jan 2020 00:38:07 +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 00Q0c6g2099617; Sun, 26 Jan 2020 00:38:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q0c6Dk099615; Sun, 26 Jan 2020 00:38:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260038.00Q0c6Dk099615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 00:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357129 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 357129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 00:38:07 -0000 Author: mjg Date: Sun Jan 26 00:38:06 2020 New Revision: 357129 URL: https://svnweb.freebsd.org/changeset/base/357129 Log: ufs: add vgone calls for unconstructed vnodes in the error path This mostly eliminates the requirement that vput never unlocks the vnode before calling VOP_INACTIVE. Note it may still be present for other filesystems. See r356126 for an example bug. Note vput stopped doing early unlock in r357070 thus this change does not affect correctness as it is. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23215 Modified: head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Jan 26 00:34:57 2020 (r357128) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Jan 26 00:38:06 2020 (r357129) @@ -1787,6 +1787,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) * still zero, it will be unlinked and returned to the free * list by vput(). */ + vgone(vp); vput(vp); *vpp = NULL; return (error); @@ -1797,6 +1798,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) ip->i_din2 = uma_zalloc(uma_ufs2, M_WAITOK); if ((error = ffs_load_inode(bp, ip, fs, ino)) != 0) { bqrelse(bp); + vgone(vp); vput(vp); *vpp = NULL; return (error); @@ -1814,6 +1816,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) error = ufs_vinit(mp, I_IS_UFS1(ip) ? &ffs_fifoops1 : &ffs_fifoops2, &vp); if (error) { + vgone(vp); vput(vp); *vpp = NULL; return (error); @@ -1849,6 +1852,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) error = mac_vnode_associate_extattr(mp, vp); if (error) { /* ufs_inactive will release ip->i_devvp ref. */ + vgone(vp); vput(vp); *vpp = NULL; return (error); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sun Jan 26 00:34:57 2020 (r357128) +++ head/sys/ufs/ufs/ufs_vnops.c Sun Jan 26 00:38:06 2020 (r357129) @@ -1839,6 +1839,7 @@ ufs_mkdir(ap) if (DOINGSOFTDEP(tvp)) softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); + vgone(tvp); vput(tvp); return (error); } @@ -1853,6 +1854,7 @@ ufs_mkdir(ap) if (DOINGSOFTDEP(tvp)) softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); + vgone(tvp); vput(tvp); return (error); } @@ -1980,7 +1982,7 @@ bad: UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_mkdir(dp, ip); - + vgone(tvp); vput(tvp); } out: @@ -2607,6 +2609,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) if (DOINGSOFTDEP(tvp)) softdep_revert_link(pdir, ip); UFS_VFREE(tvp, ip->i_number, mode); + vgone(tvp); vput(tvp); return (error); } @@ -2621,6 +2624,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) if (DOINGSOFTDEP(tvp)) softdep_revert_link(pdir, ip); UFS_VFREE(tvp, ip->i_number, mode); + vgone(tvp); vput(tvp); return (error); } @@ -2691,6 +2695,7 @@ bad: UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_create(VTOI(dvp), ip); + vgone(tvp); vput(tvp); return (error); } From owner-svn-src-all@freebsd.org Sun Jan 26 00:40:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17B54229886; Sun, 26 Jan 2020 00:40: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 484vDW4yWxz4LMd; Sun, 26 Jan 2020 00:40:27 +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 A5A9A18D01; Sun, 26 Jan 2020 00:40:27 +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 00Q0eRaR099788; Sun, 26 Jan 2020 00:40:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q0eR2s099787; Sun, 26 Jan 2020 00:40:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260040.00Q0eR2s099787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357130 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 00:40:28 -0000 Author: mjg Date: Sun Jan 26 00:40:27 2020 New Revision: 357130 URL: https://svnweb.freebsd.org/changeset/base/357130 Log: vfs: fix freevnodes count update race against preemption vdbatch_process leaves the critical section too early, openign a time window where another thread can get scheduled and modify vd->freevnodes. Once it the preempted thread gets back it overrides the value with 0. Just move critical_exit to the end of the function. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 26 00:38:06 2020 (r357129) +++ head/sys/kern/vfs_subr.c Sun Jan 26 00:40:27 2020 (r357130) @@ -3324,10 +3324,10 @@ vdbatch_process(struct vdbatch *vd) vp->v_dbatchcpu = NOCPU; } mtx_unlock(&vnode_list_mtx); - critical_exit(); vd->freevnodes = 0; bzero(vd->tab, sizeof(vd->tab)); vd->index = 0; + critical_exit(); } static void From owner-svn-src-all@freebsd.org Sun Jan 26 00:41:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D9C9229986; Sun, 26 Jan 2020 00:41:39 +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 484vFv3Frtz4Lh4; Sun, 26 Jan 2020 00:41:39 +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 6B00818E67; Sun, 26 Jan 2020 00:41:39 +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 00Q0fdAK004510; Sun, 26 Jan 2020 00:41:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q0fd2P004509; Sun, 26 Jan 2020 00:41:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260041.00Q0fd2P004509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 00:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357131 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 357131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 00:41:39 -0000 Author: mjg Date: Sun Jan 26 00:41:38 2020 New Revision: 357131 URL: https://svnweb.freebsd.org/changeset/base/357131 Log: vfs: stop null checking routines in vop wrappers Calls to vop_bypass pass the same argument, but type casted to something else. Thus by replacing NULL routines with vop_bypass we avoid a runtime check. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23357 Modified: head/sys/tools/vnode_if.awk Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Sun Jan 26 00:40:27 2020 (r357130) +++ head/sys/tools/vnode_if.awk Sun Jan 26 00:41:38 2020 (r357131) @@ -367,14 +367,11 @@ while ((getline < srcfile) > 0) { add_pre(name); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); - printc("\tif (__predict_true(!SDT_PROBES_ENABLED() && vop->"name" != NULL)) {"); + printc("\tif (!SDT_PROBES_ENABLED()) {"); printc("\t\trc = vop->"name"(a);") printc("\t} else {") printc("\t\tSDT_PROBE2(vfs, vop, " name ", entry, a->a_" args[0] ", a);"); - printc("\t\tif (vop->"name" != NULL)") - printc("\t\t\trc = vop->"name"(a);") - printc("\t\telse") - printc("\t\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\t\trc = vop->"name"(a);") printc("\t\tSDT_PROBE3(vfs, vop, " name ", return, a->a_" args[0] ", a, rc);"); printc("\t}") printc("\tif (rc == 0) {"); @@ -449,6 +446,11 @@ if (cfile) { printc("\t\tvop = vop->vop_default;") printc("\tif (vop != NULL)"); printc("\t\torig_vop->vop_bypass = vop->vop_bypass;"); + printc(""); + for (name in funcarr) { + printc("\tif (orig_vop->"name" == NULL)"); + printc("\t\torig_vop->"name" = (void *)orig_vop->vop_bypass;"); + } printc(""); printc("\torig_vop->registered = true;"); printc("}") From owner-svn-src-all@freebsd.org Sun Jan 26 01:42:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B8D122AD48; Sun, 26 Jan 2020 01:42:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484wcS37b0z4P4Z; Sun, 26 Jan 2020 01:42:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66C85199AA; Sun, 26 Jan 2020 01:42:48 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00Q1gmZO040864; Sun, 26 Jan 2020 01:42:48 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q1gmcG040863; Sun, 26 Jan 2020 01:42:48 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <202001260142.00Q1gmcG040863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 26 Jan 2020 01:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357132 - stable/12/sbin/swapon X-SVN-Group: stable-12 X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: stable/12/sbin/swapon X-SVN-Commit-Revision: 357132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 01:42:48 -0000 Author: truckman Date: Sun Jan 26 01:42:47 2020 New Revision: 357132 URL: https://svnweb.freebsd.org/changeset/base/357132 Log: MFC r355553 Fix a logic bug in error handling code. It is an error if p == NULL. The linelen tests are only meaningful when p != NULL. Reported by: Coverity Coverity CID: 1368655 Modified: stable/12/sbin/swapon/swapon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/swapon/swapon.c ============================================================================== --- stable/12/sbin/swapon/swapon.c Sun Jan 26 00:41:38 2020 (r357131) +++ stable/12/sbin/swapon/swapon.c Sun Jan 26 01:42:47 2020 (r357132) @@ -542,7 +542,7 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && + if (p == NULL || (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (attach) unexpected output"); ret = NULL; From owner-svn-src-all@freebsd.org Sun Jan 26 01:45:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19A8022AE78; Sun, 26 Jan 2020 01:45:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484wgQ6xwsz4PCw; Sun, 26 Jan 2020 01:45:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9CF8199AC; Sun, 26 Jan 2020 01:45:22 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00Q1jMwA041059; Sun, 26 Jan 2020 01:45:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q1jMXs041058; Sun, 26 Jan 2020 01:45:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <202001260145.00Q1jMXs041058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 26 Jan 2020 01:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357133 - stable/11/sbin/swapon X-SVN-Group: stable-11 X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: stable/11/sbin/swapon X-SVN-Commit-Revision: 357133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 01:45:23 -0000 Author: truckman Date: Sun Jan 26 01:45:22 2020 New Revision: 357133 URL: https://svnweb.freebsd.org/changeset/base/357133 Log: MFC r355553 Fix a logic bug in error handling code. It is an error if p == NULL. The linelen tests are only meaningful when p != NULL. Reported by: Coverity Coverity CID: 1368655 Modified: stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/swapon/swapon.c ============================================================================== --- stable/11/sbin/swapon/swapon.c Sun Jan 26 01:42:47 2020 (r357132) +++ stable/11/sbin/swapon/swapon.c Sun Jan 26 01:45:22 2020 (r357133) @@ -521,7 +521,7 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && + if (p == NULL || (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (attach) unexpected output"); ret = NULL; From owner-svn-src-all@freebsd.org Sun Jan 26 04:42:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBFA722F033 for ; Sun, 26 Jan 2020 04:42:15 +0000 (UTC) (envelope-from susi@miguelito.website) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 4850bW0B6Mz4X7G for ; Sun, 26 Jan 2020 04:42:14 +0000 (UTC) (envelope-from susi@miguelito.website) Received: by mail-lf1-x142.google.com with SMTP id y19so3939334lfl.9 for ; Sat, 25 Jan 2020 20:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miguelito-website.20150623.gappssmtp.com; s=20150623; h=date:from:to:message-id:subject:mime-version; bh=yRZnrBnIwsN6cUiZjEogawCU430hSOPoF/hPCILco/c=; b=ClWZWNNQLuPTYz6hZWsY140l+r6X2TRRRXpHe4fcGsHkILAvUtf+bWpxjEIw8HGDRK XZ/+wfez43AQwjHCEgkIdlyqfN8Q/fwD4kcxkTsTqoNI7APEf9ZIsppcIvG6uerRCnMy yhjMFZr4GBx2zDQyvrE//TSwWd5rU0b6DWdrMg2iT8tkbu1LeidCs3RN2ISSAwpsM2Lw md6HzLqNYAsGJ0qX0eIbI5VFmNLE+LqtIu4NCt1AC+KxB9bGNCQPEqPQKKH+I4ZGZebo XJJ4k6aN/X/dGdY+xcnbEmPF4van+25qhmhvc6QWqI0TNu6Kyk+RUi2MZsdBKyTKrBDm 34ag== 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:message-id:subject:mime-version; bh=yRZnrBnIwsN6cUiZjEogawCU430hSOPoF/hPCILco/c=; b=fgLGPjh9+4T3WLRMlFuIU/cGoBsoCX7yp1emMBC+qnsJPjbU3balwW5DRp5+zU7Mtk sJ5ICwGqEgq3BftF5e/StMABkxJ1Kn0Wh8cEd3ZBxU8NzUOoQd3Wk43xC469s280hy3x RuCtUMFaRX3Zi84Uu1o5xtF7YaaT/UJkSU3iCKENbD1nGQZUo5YYRn1Hbo4v8BLYRyzB XoE46hdqGmx146dUFzCmWf4e/hjngFbUq7rqTru/IzJ8E0pDnHvtC0BSxyxkC7nDqZFa b22M/i7uXv5J+vsyqi4aQKX4pLdUBwKNSSGTGJZ5StydrR3b7xtcRjFq9Ae9t5ywLz2P XjWw== X-Gm-Message-State: APjAAAW0ltBpgETNGXVwdrMRXn2oGpQmMMC25Dft5yxmrZCtNmEth9pJ 0dO78dKcDZnDiWK15TIkiuIETWNiuMA= X-Google-Smtp-Source: APXvYqx2aYroH/IQRAmCa/9I9k9dluBQMFl3oSxZgKVHnp2lScDOVUTDWlBZnQipBN5eaH7gj+ZlEw== X-Received: by 2002:ac2:47ec:: with SMTP id b12mr4981301lfp.162.1580013733166; Sat, 25 Jan 2020 20:42:13 -0800 (PST) Received: from b3.cedeliverynet.com (b3.cedeliverynet.com. [149.56.250.122]) by smtp.gmail.com with ESMTPSA id x23sm5736571lff.24.2020.01.25.20.42.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jan 2020 20:42:12 -0800 (PST) Date: Sun, 26 Jan 2020 05:42:09 +0100 (CET) From: Susi Miguelito To: "svn-src-all@freebsd.org" Message-ID: <720903372.401171.1580013732628@cea0f62d0c75> Subject: A question from Susi (for gcu-squad.org) MIME-Version: 1.0 X-Rspamd-Queue-Id: 4850bW0B6Mz4X7G X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=miguelito-website.20150623.gappssmtp.com header.s=20150623 header.b=ClWZWNNQ; dmarc=none; spf=none (mx1.freebsd.org: domain of susi@miguelito.website has no SPF policy when checking 2a00:1450:4864:20::142) smtp.mailfrom=susi@miguelito.website X-Spamd-Result: default: False [-2.16 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[miguelito-website.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[miguelito.website]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.36)[ip: (2.59), ipnet: 2a00:1450::/32(-2.54), asn: 15169(-1.79), country: US(-0.05)]; DKIM_TRACE(0.00)[miguelito-website.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; R_SPF_NA(0.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:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 04:42:15 -0000 Greetings! I=E2=80=99m Susi, editor at one of the internet=E2=80=99s best-l= oved adult review sites. I=E2=80=99ve been reading through your site, and I= =E2=80=99d love to work with you =E2=80=93 ideally by buying a guest post. = In return, I can guarantee: A well-written, engaging post, created by indus= try-leading copywriters.=C2=A0 A flexible approach; if you=E2=80=99ve got a= topic in mind, we can work with it. Otherwise, we=E2=80=99re happy to come= up with the goods. SEO optimisation, with explicit or non-explicit keyword= s covered. If this sounds like something you=E2=80=99d be up for, let me kn= ow. I look forward to discussing things further. =3D=3D=3D Thank you, Susi = Miguelito=20 From owner-svn-src-all@freebsd.org Sun Jan 26 04:54:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65BBD22F451; Sun, 26 Jan 2020 04:54:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4850sQ22gfz4Xgq; Sun, 26 Jan 2020 04:54:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 415131BD1A; Sun, 26 Jan 2020 04:54:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00Q4sIt2054536; Sun, 26 Jan 2020 04:54:18 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q4sIcO054535; Sun, 26 Jan 2020 04:54:18 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <202001260454.00Q4sIcO054535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 26 Jan 2020 04:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357134 - stable/11/usr.bin/vmstat X-SVN-Group: stable-11 X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: stable/11/usr.bin/vmstat X-SVN-Commit-Revision: 357134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 04:54:18 -0000 Author: nyan Date: Sun Jan 26 04:54:17 2020 New Revision: 357134 URL: https://svnweb.freebsd.org/changeset/base/357134 Log: MFC r322252 by manu: vmstat: Always emit a space after the free-memory column > When displaying in non-human form, if the free-memory number > is large (more than 7 digits), there is no space between it and > the page fault column. PR: 242350 Modified: stable/11/usr.bin/vmstat/vmstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/11/usr.bin/vmstat/vmstat.c Sun Jan 26 01:45:22 2020 (r357133) +++ stable/11/usr.bin/vmstat/vmstat.c Sun Jan 26 04:54:17 2020 (r357134) @@ -793,6 +793,7 @@ dovmstat(unsigned int interval, int reps) xo_emit(" "); xo_emit("{:free-memory/%7d}", vmstat_pgtok(total.t_free)); + xo_emit(" "); } xo_emit("{:total-page-faults/%5lu} ", (unsigned long)rate(sum.v_vm_faults - From owner-svn-src-all@freebsd.org Sun Jan 26 07:05:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6706823227D; Sun, 26 Jan 2020 07:05:07 +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 4853mM24xzz4dVw; Sun, 26 Jan 2020 07:05:07 +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 42D371D4F0; Sun, 26 Jan 2020 07:05:07 +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 00Q7575k032201; Sun, 26 Jan 2020 07:05:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q757DD032200; Sun, 26 Jan 2020 07:05:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260705.00Q757DD032200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 07:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357135 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 07:05:07 -0000 Author: mjg Date: Sun Jan 26 07:05:06 2020 New Revision: 357135 URL: https://svnweb.freebsd.org/changeset/base/357135 Log: vfs: remove vop loop from vop_sigdefer All ops are guaranteed to be present since r357131. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun Jan 26 04:54:17 2020 (r357134) +++ head/sys/kern/vfs_default.c Sun Jan 26 07:05:06 2020 (r357135) @@ -1450,20 +1450,7 @@ vop_sigdefer(struct vop_vector *vop, struct vop_generi vop_bypass_t *bp; int prev_stops, rc; - for (; vop != NULL; vop = vop->vop_default) { - bp = bp_by_off(vop, a); - if (bp != NULL) - break; - - /* - * Bypass is not really supported. It is done for - * fallback to unimplemented vops in the default - * vector. - */ - bp = vop->vop_bypass; - if (bp != NULL) - break; - } + bp = bp_by_off(vop, a); MPASS(bp != NULL); prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); From owner-svn-src-all@freebsd.org Sun Jan 26 07:06:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 070792323C8; Sun, 26 Jan 2020 07:06: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 4853nk6PWTz4dgR; Sun, 26 Jan 2020 07:06: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 D721E1D4F7; Sun, 26 Jan 2020 07:06: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 00Q76I8v032297; Sun, 26 Jan 2020 07:06:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q76ITq032296; Sun, 26 Jan 2020 07:06:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001260706.00Q76ITq032296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jan 2020 07:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357136 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 07:06:19 -0000 Author: mjg Date: Sun Jan 26 07:06:18 2020 New Revision: 357136 URL: https://svnweb.freebsd.org/changeset/base/357136 Log: vfs: do an unlocked check before iterating the lazy list For most filesystems it is expected to be empty most of the time. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 26 07:05:06 2020 (r357135) +++ head/sys/kern/vfs_subr.c Sun Jan 26 07:06:18 2020 (r357136) @@ -6368,6 +6368,9 @@ __mnt_vnode_first_lazy(struct vnode **mvp, struct moun { struct vnode *vp; + if (TAILQ_EMPTY(&mp->mnt_lazyvnodelist)) + return (NULL); + *mvp = vn_alloc_marker(mp); MNT_ILOCK(mp); MNT_REF(mp); From owner-svn-src-all@freebsd.org Sun Jan 26 07:24:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A258232CF1; Sun, 26 Jan 2020 07:24:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4854C61k3mz4fmr; Sun, 26 Jan 2020 07:24:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 363601D8D0; Sun, 26 Jan 2020 07:24:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00Q7OokL044149; Sun, 26 Jan 2020 07:24:50 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q7OoWT044148; Sun, 26 Jan 2020 07:24:50 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202001260724.00Q7OoWT044148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 26 Jan 2020 07:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357137 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 357137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 07:24:50 -0000 Author: lwhsu Date: Sun Jan 26 07:24:49 2020 New Revision: 357137 URL: https://svnweb.freebsd.org/changeset/base/357137 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__procdesc_reparent_wait_child PR: 243605 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Sun Jan 26 07:06:18 2020 (r357136) +++ head/tests/sys/kern/ptrace_test.c Sun Jan 26 07:24:49 2020 (r357137) @@ -4189,6 +4189,9 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc) pid_t traced, debuger, wpid; int pd, status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/243605"); + traced = pdfork(&pd, 0); ATF_REQUIRE(traced >= 0); if (traced == 0) { From owner-svn-src-all@freebsd.org Sun Jan 26 09:13:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 867E7236634; Sun, 26 Jan 2020 09:13:36 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501o.mail.yandex.net (forward501o.mail.yandex.net [37.140.190.203]) (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 4856cc2kQWz3H0l; Sun, 26 Jan 2020 09:13:35 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback6q.mail.yandex.net (mxback6q.mail.yandex.net [IPv6:2a02:6b8:c0e:42:0:640:9de5:975f]) by forward501o.mail.yandex.net (Yandex) with ESMTP id DDD131E80474; Sun, 26 Jan 2020 12:13:32 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback6q.mail.yandex.net (mxback/Yandex) with ESMTP id CWx9KCLpih-DWaiFvt9; Sun, 26 Jan 2020 12:13:32 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1580030012; bh=ay8cRI4qkyEeLuCD70saiNTJe3U1zOJkhiTzu8dyCwE=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=THOMbdyWxB2RzBnziKFmmYES+GsX6axRxP+JGQG2pBY+TjQuoaIrlO8KF5h9dgrhf kMK7QtSXvCSFS0FrH5GyysD+NLzuduIr6ubXcZfKi88qD6qtqkvcX4zOf5D8/OcJLM jJ2phdirO4XeLwT9jSKCGEG4zscem1iW7KpylwZw= Received: by vla5-5336eea6ea62.qloud-c.yandex.net with HTTP; Sun, 26 Jan 2020 12:13:32 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <202001251051.00PApqbc095652@repo.freebsd.org> References: <202001251051.00PApqbc095652@repo.freebsd.org> Subject: Re: svn commit: r357113 - head/tests/sys/net/routing MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 26 Jan 2020 09:13:32 +0000 Message-Id: <2186251580030012@vla5-5336eea6ea62.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4856cc2kQWz3H0l X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 09:13:36 -0000 25.01.2020, 10:51, "Kristof Provost" : > Author: kp > Date: Sat Jan 25 10:51:51 2020 > New Revision: 357113 > URL: https://svnweb.freebsd.org/changeset/base/357113 > > Log: >   tests: Routing tests overwrote net tests > >   The routing subdirectory installed into the same directory as the test tests, >   which caused them to overwrite the net Kyuafile. As a result these tests were >   not executed. Missed that one, thank you! > >   X-MFC-With: r356146 > > Modified: >   head/tests/sys/net/routing/Makefile > > Modified: head/tests/sys/net/routing/Makefile > ============================================================================== > --- head/tests/sys/net/routing/Makefile Sat Jan 25 09:22:28 2020 (r357112) > +++ head/tests/sys/net/routing/Makefile Sat Jan 25 10:51:51 2020 (r357113) > @@ -2,7 +2,7 @@ > >  PACKAGE= tests > > -TESTSDIR= ${TESTSBASE}/sys/net > +TESTSDIR= ${TESTSBASE}/sys/net/routing > >  ATF_TESTS_C += test_rtsock_l3 >  ATF_TESTS_C += test_rtsock_lladdr From owner-svn-src-all@freebsd.org Sun Jan 26 09:43:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03BD0237363; Sun, 26 Jan 2020 09:43:02 +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 4857GY685Rz3JSC; Sun, 26 Jan 2020 09:43:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from dhcp-10-248-114-204.eduroam.wireless.private.cam.ac.uk (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) (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 3EFC04A16; Sun, 26 Jan 2020 09:43:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357051 - head/sys/dev/bge To: Gleb Smirnoff , Jeff Roberson Cc: Ryan Stone , src-committers , svn-src-all , svn-src-head References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> <20200124051503.GM1268@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <4b0e1292-070f-4335-0253-99ae399d68a0@FreeBSD.org> Date: Sun, 26 Jan 2020 09:42:59 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200124051503.GM1268@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 09:43:02 -0000 On 1/23/20 9:15 PM, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 06:18:15PM -1000, Jeff Roberson wrote: > J> > That was https://reviews.freebsd.org/D23242 > J> > J> Ok thank you. Can you tag commits so people can see the discussion? Was > J> it in one I missed? When I'm committing a long patch series I include the > J> link in all of them. > > I probably now on will also include in every patch in a serie. I just > dislike that first one (usually a preparation change) closes the review. You can also add additional commits to a review via 'Edit related revisions' in the web ui if you forget to tag a commit. -- John Baldwin From owner-svn-src-all@freebsd.org Sun Jan 26 09:48:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 842E4237536; Sun, 26 Jan 2020 09:48:44 +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 4857P830N4z3JjR; Sun, 26 Jan 2020 09:48:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from dhcp-10-248-114-204.eduroam.wireless.private.cam.ac.uk (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) (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 CB5154A17; Sun, 26 Jan 2020 09:48:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357051 - head/sys/dev/bge To: Gleb Smirnoff , Jeff Roberson Cc: Ryan Stone , src-committers , svn-src-all , svn-src-head References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <6a5485eb-8623-3316-0385-b0cda1624b05@FreeBSD.org> Date: Sun, 26 Jan 2020 09:48:42 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200124033243.GL1268@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 09:48:44 -0000 On 1/23/20 7:32 PM, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 05:09:14PM -1000, Jeff Roberson wrote: > J> While we don't have a policy strictly requiring reviews it is the norm to > J> have substantial changes socialized and reviewed. I appreciate the work > J> that you are doing but it likely should've been discussed somewhere > J> more publicly. I apologized if I missed it but I don't see reference to > J> anything. > > That was https://reviews.freebsd.org/D23242 A review alone isn't sufficient for large, sweeping changes in my mind. For major changes, a thread on arch@ or net@ or the like is probably more appropriate. You can include a link to a review or git branch, etc. in that e-mail, but phabricator aren't as well suited to higher-level design-review type discussion, more for implementation-review. > J> Architecturally I am more concerned with the coarseness of net_epoch and > J> the duration of hold becoming a resource utilization problem in high > J> turn-over workloads. Like short connection tcp. Has anyone done > J> substantial testing here? epoch as it is today will hold every free > J> callback for a minimum of several clock ticks and a maximum of 2x the > J> duration of the longest epoch section time. With preemption, etc. this > J> could be 100s of ms of PCBs held. > > We also are concerned about that theoretically. Haven't yet seen effect > in practice, but our sessions are mostly longer living. First we have the > tunable to limit batching. Second, there are some ideas on how to improve > the garbage collector performance if it becomes an issue. There are other workloads than Netflix. ;) Verisign has incredibly short-lived connections with very high turnover. I think though that they have already abandoned the in-tree network stack for a userland stack built on netmap. Still, I think that there are probably other FreeBSD users that are probably somewhere in the middle that shouldn't be ignored. Packet batching would not be impossible by simply using m_nextpkt chains in mbufs passed up to ether_input and having ether_input pass them in a loop to the next higher loop (as a first step). That would reduce unlock/lock operations in drivers (for those still using locks on receive) as well as permitting ether_input to process batches under a single epoch invocation. -- John Baldwin From owner-svn-src-all@freebsd.org Sun Jan 26 10:49:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC9A8238BA8; Sun, 26 Jan 2020 10:49:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4858l85T8nz3MZm; Sun, 26 Jan 2020 10:49:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B71311FDF7; Sun, 26 Jan 2020 10:49:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QAnOTJ063682; Sun, 26 Jan 2020 10:49:24 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QAnORw063681; Sun, 26 Jan 2020 10:49:24 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261049.00QAnORw063681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 10:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357138 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 10:49:24 -0000 Author: pjd Date: Sun Jan 26 10:49:24 2020 New Revision: 357138 URL: https://svnweb.freebsd.org/changeset/base/357138 Log: - Be consistent with using sysexits(3) codes. - Turn fprintf()+exit() into errx(). Sponsored by: Fudo Security Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Jan 26 07:24:49 2020 (r357137) +++ head/bin/pwait/pwait.c Sun Jan 26 10:49:24 2020 (r357138) @@ -53,8 +53,7 @@ static void usage(void) { - fprintf(stderr, "usage: pwait [-t timeout] [-v] pid ...\n"); - exit(EX_USAGE); + errx(EX_USAGE, "usage: pwait [-t timeout] [-v] pid ..."); } /* @@ -120,11 +119,11 @@ main(int argc, char *argv[]) kq = kqueue(); if (kq == -1) - err(1, "kqueue"); + err(EX_OSERR, "kqueue"); e = malloc((argc + tflag) * sizeof(struct kevent)); if (e == NULL) - err(1, "malloc"); + err(EX_OSERR, "malloc"); nleft = 0; for (n = 0; n < argc; n++) { s = argv[n]; @@ -166,12 +165,12 @@ main(int argc, char *argv[]) while (nleft > 0) { n = kevent(kq, NULL, 0, e, nleft + tflag, NULL); if (n == -1) - err(1, "kevent"); + err(EX_OSERR, "kevent"); for (i = 0; i < n; i++) { if (e[i].filter == EVFILT_SIGNAL) { if (verbose) printf("timeout\n"); - return (124); + exit(124); } if (verbose) { status = e[i].data; From owner-svn-src-all@freebsd.org Sun Jan 26 10:51:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A13F8238DCE; Sun, 26 Jan 2020 10:51:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4858p53tdkz3MwR; Sun, 26 Jan 2020 10:51:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80B1B1FF7F; Sun, 26 Jan 2020 10:51:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QApvvD068816; Sun, 26 Jan 2020 10:51:57 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QApvvg068815; Sun, 26 Jan 2020 10:51:57 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261051.00QApvvg068815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 10:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357139 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 10:51:57 -0000 Author: pjd Date: Sun Jan 26 10:51:57 2020 New Revision: 357139 URL: https://svnweb.freebsd.org/changeset/base/357139 Log: Check for duplicated PID without using additional variable. Sponsored by: Fudo Security Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Jan 26 10:49:24 2020 (r357138) +++ head/bin/pwait/pwait.c Sun Jan 26 10:51:57 2020 (r357139) @@ -66,7 +66,7 @@ main(int argc, char *argv[]) int kq; struct kevent *e; int tflag, verbose; - int opt, nleft, n, i, duplicate, status; + int opt, nleft, n, i, status; long pid; char *s, *end; double timeout; @@ -135,18 +135,19 @@ main(int argc, char *argv[]) warnx("%s: bad process id", s); continue; } - duplicate = 0; - for (i = 0; i < nleft; i++) + for (i = 0; i < nleft; i++) { if (e[i].ident == (uintptr_t)pid) - duplicate = 1; - if (!duplicate) { - EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, - 0, NULL); - if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) - warn("%ld", pid); - else - nleft++; + break; } + if (i < nleft) { + /* Duplicate. */ + continue; + } + EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); + if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) + warn("%ld", pid); + else + nleft++; } if (tflag) { From owner-svn-src-all@freebsd.org Sun Jan 26 10:54:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD043238F04; Sun, 26 Jan 2020 10:54:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4858rm48DBz3N7y; Sun, 26 Jan 2020 10:54:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899F11FFC8; Sun, 26 Jan 2020 10:54:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QAsGPN069678; Sun, 26 Jan 2020 10:54:16 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QAsG5A069677; Sun, 26 Jan 2020 10:54:16 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261054.00QAsG5A069677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 10:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357140 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 10:54:16 -0000 Author: pjd Date: Sun Jan 26 10:54:16 2020 New Revision: 357140 URL: https://svnweb.freebsd.org/changeset/base/357140 Log: Don't setup a timeout if we are exiting. Sponsored by: Fudo Security Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Jan 26 10:51:57 2020 (r357139) +++ head/bin/pwait/pwait.c Sun Jan 26 10:54:16 2020 (r357140) @@ -150,7 +150,7 @@ main(int argc, char *argv[]) nleft++; } - if (tflag) { + if (nleft > 0 && tflag) { /* * Explicitly detect SIGALRM so that an exit status of 124 * can be returned rather than 142. From owner-svn-src-all@freebsd.org Sun Jan 26 11:02:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8789A239328; Sun, 26 Jan 2020 11:02:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48592h32TZz3NjB; Sun, 26 Jan 2020 11:02:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 634112019D; Sun, 26 Jan 2020 11:02:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QB2qFa075668; Sun, 26 Jan 2020 11:02:52 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QB2qlE075666; Sun, 26 Jan 2020 11:02:52 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261102.00QB2qlE075666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 11:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357141 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 11:02:52 -0000 Author: pjd Date: Sun Jan 26 11:02:51 2020 New Revision: 357141 URL: https://svnweb.freebsd.org/changeset/base/357141 Log: Implement -o flag which tells pwait(1) to exit if any of the given processes has terminated. Sponsored by: Fudo Security Modified: head/bin/pwait/pwait.1 head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.1 ============================================================================== --- head/bin/pwait/pwait.1 Sun Jan 26 10:54:16 2020 (r357140) +++ head/bin/pwait/pwait.1 Sun Jan 26 11:02:51 2020 (r357141) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2017 +.Dd January 26, 2020 .Dt PWAIT 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl t Ar duration -.Op Fl v +.Op Fl ov .Ar pid \&... .Sh DESCRIPTION @@ -51,6 +51,8 @@ utility will wait until each of the given processes ha .Pp The following option is available: .Bl -tag -width indent +.It Fl o +Exit when any of the given processes has terminated. .It Fl t Ar duration If any process is still running after .Ar duration , Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Jan 26 10:54:16 2020 (r357140) +++ head/bin/pwait/pwait.c Sun Jan 26 11:02:51 2020 (r357141) @@ -53,7 +53,7 @@ static void usage(void) { - errx(EX_USAGE, "usage: pwait [-t timeout] [-v] pid ..."); + errx(EX_USAGE, "usage: pwait [-t timeout] [-ov] pid ..."); } /* @@ -65,16 +65,22 @@ main(int argc, char *argv[]) struct itimerval itv; int kq; struct kevent *e; - int tflag, verbose; + int oflag, tflag, verbose; int opt, nleft, n, i, status; long pid; char *s, *end; double timeout; - tflag = verbose = 0; + oflag = 0; + tflag = 0; + verbose = 0; memset(&itv, 0, sizeof(itv)); - while ((opt = getopt(argc, argv, "t:v")) != -1) { + + while ((opt = getopt(argc, argv, "t:ov")) != -1) { switch (opt) { + case 'o': + oflag = 1; + break; case 't': tflag = 1; errno = 0; @@ -144,10 +150,13 @@ main(int argc, char *argv[]) continue; } EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); - if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) + if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) { warn("%ld", pid); - else + if (oflag) + exit(EX_OK); + } else { nleft++; + } } if (nleft > 0 && tflag) { @@ -187,6 +196,8 @@ main(int argc, char *argv[]) printf("%ld: terminated.\n", (long)e[i].ident); } + if (oflag) + exit(EX_OK); --nleft; } } From owner-svn-src-all@freebsd.org Sun Jan 26 11:03:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9918D2393CC; Sun, 26 Jan 2020 11:03:45 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48593j3d18z3NrL; Sun, 26 Jan 2020 11:03:45 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778DB201A0; Sun, 26 Jan 2020 11:03:45 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QB3jYP075757; Sun, 26 Jan 2020 11:03:45 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QB3jkG075756; Sun, 26 Jan 2020 11:03:45 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261103.00QB3jkG075756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 11:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357142 - head/bin/pwait/tests X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait/tests X-SVN-Commit-Revision: 357142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 11:03:45 -0000 Author: pjd Date: Sun Jan 26 11:03:45 2020 New Revision: 357142 URL: https://svnweb.freebsd.org/changeset/base/357142 Log: Implement tests for the newly added -o flag. Sponsored by: Fudo Security Modified: head/bin/pwait/tests/pwait_test.sh Modified: head/bin/pwait/tests/pwait_test.sh ============================================================================== --- head/bin/pwait/tests/pwait_test.sh Sun Jan 26 11:02:51 2020 (r357141) +++ head/bin/pwait/tests/pwait_test.sh Sun Jan 26 11:03:45 2020 (r357142) @@ -232,6 +232,85 @@ timeout_many_cleanup() wait $p1 $p5 $p10 >/dev/null 2>&1 } +atf_test_case or_flag +or_flag_head() +{ + atf_set "descr" "Test OR flag" +} + +or_flag_body() +{ + sleep 2 & + p2=$! + + sleep 4 & + p4=$! + + sleep 6 & + p6=$! + + atf_check \ + -o inline:"$p2: exited with status 0.\n" \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o -v $p2 $p4 $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p2: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p2 $p4 $p6 + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p4 $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p4: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p4 $p6 + + atf_check \ + -o inline:"$p6: exited with status 0.\n" \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o -v $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p6: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p6 + + atf_check \ + -o empty \ + -e inline:"kill: $p2: No such process\n" \ + -s exit:1 \ + kill -0 $p2 + + atf_check \ + -o empty \ + -e inline:"kill: $p4: No such process\n" \ + -s exit:1 \ + kill -0 $p4 + + atf_check \ + -o empty \ + -e inline:"kill: $p6: No such process\n" \ + -s exit:1 \ + kill -0 $p6 + +} + +or_flag_cleanup() +{ + kill $p2 $p4 $p6 >/dev/null 2>&1 + wait $p2 $p4 $p6 >/dev/null 2>&1 +} + atf_init_test_cases() { atf_add_test_case basic @@ -239,4 +318,5 @@ atf_init_test_cases() atf_add_test_case timeout_trigger_timeout atf_add_test_case timeout_no_timeout atf_add_test_case timeout_many + atf_add_test_case or_flag } From owner-svn-src-all@freebsd.org Sun Jan 26 11:13:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80C252397E7; Sun, 26 Jan 2020 11:13:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4859H32vtvz3PQC; Sun, 26 Jan 2020 11:13:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 436F02039A; Sun, 26 Jan 2020 11:13:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QBDZYU081494; Sun, 26 Jan 2020 11:13:35 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QBDZhj081493; Sun, 26 Jan 2020 11:13:35 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001261113.00QBDZhj081493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 26 Jan 2020 11:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357143 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 11:13:35 -0000 Author: pjd Date: Sun Jan 26 11:13:34 2020 New Revision: 357143 URL: https://svnweb.freebsd.org/changeset/base/357143 Log: Style changes, mostly usage of braces around single line statements - it is safer and allowed for some time now by style(9). Sponsored by: Fudo Security Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sun Jan 26 11:03:45 2020 (r357142) +++ head/bin/pwait/pwait.c Sun Jan 26 11:13:34 2020 (r357143) @@ -63,12 +63,11 @@ int main(int argc, char *argv[]) { struct itimerval itv; - int kq; struct kevent *e; int oflag, tflag, verbose; - int opt, nleft, n, i, status; + int i, kq, n, nleft, opt, status; long pid; - char *s, *end; + char *end, *s; double timeout; oflag = 0; @@ -76,7 +75,7 @@ main(int argc, char *argv[]) verbose = 0; memset(&itv, 0, sizeof(itv)); - while ((opt = getopt(argc, argv, "t:ov")) != -1) { + while ((opt = getopt(argc, argv, "ot:v")) != -1) { switch (opt) { case 'o': oflag = 1; @@ -85,9 +84,9 @@ main(int argc, char *argv[]) tflag = 1; errno = 0; timeout = strtod(optarg, &end); - if (end == optarg || errno == ERANGE || - timeout < 0) + if (end == optarg || errno == ERANGE || timeout < 0) { errx(EX_DATAERR, "timeout value"); + } switch(*end) { case 0: case 's': @@ -101,8 +100,9 @@ main(int argc, char *argv[]) default: errx(EX_DATAERR, "timeout unit"); } - if (timeout > 100000000L) + if (timeout > 100000000L) { errx(EX_DATAERR, "timeout value"); + } itv.it_value.tv_sec = (time_t)timeout; timeout -= (time_t)timeout; itv.it_value.tv_usec = @@ -120,21 +120,26 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc == 0) + if (argc == 0) { usage(); + } kq = kqueue(); - if (kq == -1) + if (kq == -1) { err(EX_OSERR, "kqueue"); + } e = malloc((argc + tflag) * sizeof(struct kevent)); - if (e == NULL) + if (e == NULL) { err(EX_OSERR, "malloc"); + } nleft = 0; for (n = 0; n < argc; n++) { s = argv[n]; - if (!strncmp(s, "/proc/", 6)) /* Undocumented Solaris compat */ + /* Undocumented Solaris compat */ + if (!strncmp(s, "/proc/", 6)) { s += 6; + } errno = 0; pid = strtol(s, &end, 10); if (pid < 0 || *end != '\0' || errno != 0) { @@ -142,8 +147,9 @@ main(int argc, char *argv[]) continue; } for (i = 0; i < nleft; i++) { - if (e[i].ident == (uintptr_t)pid) + if (e[i].ident == (uintptr_t)pid) { break; + } } if (i < nleft) { /* Duplicate. */ @@ -152,8 +158,9 @@ main(int argc, char *argv[]) EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) { warn("%ld", pid); - if (oflag) + if (oflag) { exit(EX_OK); + } } else { nleft++; } @@ -165,39 +172,45 @@ main(int argc, char *argv[]) * can be returned rather than 142. */ EV_SET(e + nleft, SIGALRM, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); - if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) + if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) { err(EX_OSERR, "kevent"); + } /* Ignore SIGALRM to not interrupt kevent(2). */ signal(SIGALRM, SIG_IGN); - if (setitimer(ITIMER_REAL, &itv, NULL) == -1) + if (setitimer(ITIMER_REAL, &itv, NULL) == -1) { err(EX_OSERR, "setitimer"); + } } while (nleft > 0) { n = kevent(kq, NULL, 0, e, nleft + tflag, NULL); - if (n == -1) + if (n == -1) { err(EX_OSERR, "kevent"); + } for (i = 0; i < n; i++) { if (e[i].filter == EVFILT_SIGNAL) { - if (verbose) + if (verbose) { printf("timeout\n"); + } exit(124); } if (verbose) { status = e[i].data; - if (WIFEXITED(status)) + if (WIFEXITED(status)) { printf("%ld: exited with status %d.\n", (long)e[i].ident, WEXITSTATUS(status)); - else if (WIFSIGNALED(status)) + } else if (WIFSIGNALED(status)) { printf("%ld: killed by signal %d.\n", (long)e[i].ident, WTERMSIG(status)); - else + } else { printf("%ld: terminated.\n", (long)e[i].ident); + } } - if (oflag) + if (oflag) { exit(EX_OK); + } --nleft; } } From owner-svn-src-all@freebsd.org Sun Jan 26 11:54:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C86323A84B; Sun, 26 Jan 2020 11:54:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485BB62HSnz3RLy; Sun, 26 Jan 2020 11:54:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4916D20AF8; Sun, 26 Jan 2020 11:54:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QBsM3D006098; Sun, 26 Jan 2020 11:54:22 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QBsMwj006097; Sun, 26 Jan 2020 11:54:22 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001261154.00QBsMwj006097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 26 Jan 2020 11:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357144 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 11:54:22 -0000 Author: melifaro Date: Sun Jan 26 11:54:21 2020 New Revision: 357144 URL: https://svnweb.freebsd.org/changeset/base/357144 Log: Fix NOINET6 build after r357038. Reported by: AN Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Sun Jan 26 11:13:34 2020 (r357143) +++ head/sys/netinet/ip_divert.c Sun Jan 26 11:54:21 2020 (r357144) @@ -371,9 +371,11 @@ div_output(struct socket *so, struct mbuf *m, struct s case IPVERSION: family = AF_INET; break; +#ifdef INET6 case IPV6_VERSION >> 4: family = AF_INET6; break; +#endif default: m_freem(m); return (EAFNOSUPPORT); From owner-svn-src-all@freebsd.org Sun Jan 26 14:19:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AA7723F676; Sun, 26 Jan 2020 14:19: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 485FP90XtVz44M8; Sun, 26 Jan 2020 14:19: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 0DDD8224AE; Sun, 26 Jan 2020 14:19: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 00QEJ8ia089919; Sun, 26 Jan 2020 14:19:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QEJ8pS089916; Sun, 26 Jan 2020 14:19:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001261419.00QEJ8pS089916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 26 Jan 2020 14:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357145 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 14:19:09 -0000 Author: jhb Date: Sun Jan 26 14:19:08 2020 New Revision: 357145 URL: https://svnweb.freebsd.org/changeset/base/357145 Log: Compile hack.c with normal CFLAGS + -shared -nostdlib. Originally, hack.c was compiled into a shard object with just -shared -nostdlib. This assumed that ${CC} did not require any additional flags for ABIs, cross-building, etc. When kern.post.mk was created in r89509 by reducing duplication in kernel Makefile. files, the -shared flag was moved into a HACK_EXTRA_FLAGS variable so that sparc64 could override it with -Wl,-shared. The sparc64 hack was removed in r111650, but HACK_EXTRA_FLAGS was left in place. Over time, we have started support toolchains that require flags to support alternate ABIs on MIPS and PowerPC and started (ab)using HACK_EXTRA_FLAGS to set only those flags. I need to fix risc-v to pass -mno-relax to the hack.c build for lld in llvm 10, and the patches to support cross-build from non-FreeBSD hosts need to include -target for clang in CFLAGS for hack.c. Rather than adding more hacks into HACK_EXTRA_FLAGS, just use the full set of CFLAGS with hack.c. Reviewed by: kib, arichardson MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23362 Modified: head/sys/conf/Makefile.mips head/sys/conf/Makefile.powerpc head/sys/conf/kern.post.mk Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Sun Jan 26 11:54:21 2020 (r357144) +++ head/sys/conf/Makefile.mips Sun Jan 26 14:19:08 2020 (r357145) @@ -50,12 +50,9 @@ ARCH_FLAGS+=-mabi=${MIPS_ABI} EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 -DKERNLOADADDR=${KERNLOADADDR} EXTRA_FLAGS+=-${MIPS_ENDIAN} -HACK_EXTRA_FLAGS=-shared - # We add the -fno-pic flag to kernels because otherwise performance # is extremely poor, as well as -mno-abicalls to force no ABI usage. CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) -HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) TRAMP_ARCH_FLAGS?=$(ARCH_FLAGS) TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} ${TRAMP_ARCH_FLAGS} # Kernel code is always compiled with soft-float on MIPS Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Sun Jan 26 11:54:21 2020 (r357144) +++ head/sys/conf/Makefile.powerpc Sun Jan 26 14:19:08 2020 (r357145) @@ -39,7 +39,6 @@ INCLUDES+= -I$S/contrib/libfdt # Force __SPE__, since the builtin will be removed later with -mno-spe CFLAGS.gcc+= -mabi=spe -D__SPE__ CFLAGS.clang+= -mspe -D__SPE__ -m32 -HACK_EXTRA_FLAGS= -shared -m32 -mspe -D__SPE__ .endif CFLAGS+= -msoft-float CFLAGS.gcc+= -Wa,-many Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sun Jan 26 11:54:21 2020 (r357144) +++ head/sys/conf/kern.post.mk Sun Jan 26 14:19:08 2020 (r357145) @@ -226,10 +226,9 @@ kernel-clean: # This is a hack. BFD "optimizes" away dynamic mode if there are no # dynamic references. We could probably do a '-Bforcedynamic' mode like # in the a.out ld. For now, this works. -HACK_EXTRA_FLAGS?= -shared hack.pico: Makefile :> hack.c - ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico + ${CC} -shared ${CFLAGS} -nostdlib hack.c -o hack.pico rm -f hack.c offset.inc: $S/kern/genoffset.sh genoffset.o From owner-svn-src-all@freebsd.org Sun Jan 26 14:20:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D4AF23F858; Sun, 26 Jan 2020 14:20: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 485FRG2MRsz44WY; Sun, 26 Jan 2020 14:20: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 4B2E3225E0; Sun, 26 Jan 2020 14:20: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 00QEKwbh090083; Sun, 26 Jan 2020 14:20:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QEKv23090078; Sun, 26 Jan 2020 14:20:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001261420.00QEKv23090078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 26 Jan 2020 14:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357146 - in head/sys: dev/mrsas dev/sound/pci kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: dev/mrsas dev/sound/pci kern X-SVN-Commit-Revision: 357146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 14:20:58 -0000 Author: jhb Date: Sun Jan 26 14:20:57 2020 New Revision: 357146 URL: https://svnweb.freebsd.org/changeset/base/357146 Log: Fix some misleading indentation warnings reported by recent clang. These should not be any functional change. While the change in emul10kx-pcm.c looks like a real bug fix (as opposed to inconsistent whitespace), the extra statements were not harmful. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23363 Modified: head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/sound/pci/emu10k1.c head/sys/dev/sound/pci/emu10kx-pcm.c head/sys/kern/subr_stats.c Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Sun Jan 26 14:19:08 2020 (r357145) +++ head/sys/dev/mrsas/mrsas_cam.c Sun Jan 26 14:20:57 2020 (r357146) @@ -1908,13 +1908,14 @@ mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t for (i = 0 ; i < sc->max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; - /* - * Check if the target_id and bus_id is same as the timeout IO - */ - if (mpt_cmd->ccb_ptr) { - /* bus_id = 1 denotes a VD */ - if (bus_id == 1) - tgt_id = (mpt_cmd->ccb_ptr->ccb_h.target_id - (MRSAS_MAX_PD - 1)); + /* + * Check if the target_id and bus_id is same as the timeout IO + */ + if (mpt_cmd->ccb_ptr) { + /* bus_id = 1 denotes a VD */ + if (bus_id == 1) + tgt_id = + (mpt_cmd->ccb_ptr->ccb_h.target_id - (MRSAS_MAX_PD - 1)); if (mpt_cmd->ccb_ptr->cpi.bus_id == bus_id && mpt_cmd->ccb_ptr->ccb_h.target_id == tgt_id) { Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Sun Jan 26 14:19:08 2020 (r357145) +++ head/sys/dev/sound/pci/emu10k1.c Sun Jan 26 14:20:57 2020 (r357146) @@ -1257,11 +1257,12 @@ emu_intr(void *data) #endif } - if (stat & EMU_IPR_MIDIRECVBUFE) - if (sc->mpu_intr) { - (sc->mpu_intr)(sc->mpu); - ack |= EMU_IPR_MIDIRECVBUFE | EMU_IPR_MIDITRANSBUFE; - } + if (stat & EMU_IPR_MIDIRECVBUFE) { + if (sc->mpu_intr) { + (sc->mpu_intr)(sc->mpu); + ack |= EMU_IPR_MIDIRECVBUFE | EMU_IPR_MIDITRANSBUFE; + } + } if (stat & ~ack) device_printf(sc->dev, "dodgy irq: %x (harmless)\n", stat & ~ack); Modified: head/sys/dev/sound/pci/emu10kx-pcm.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx-pcm.c Sun Jan 26 14:19:08 2020 (r357145) +++ head/sys/dev/sound/pci/emu10kx-pcm.c Sun Jan 26 14:20:57 2020 (r357146) @@ -263,11 +263,12 @@ emu_dspmixer_uninit(struct snd_mixer *m) /* drop submixer for AC97 codec */ sc = mix_getdevinfo(m); - if (sc->sm != NULL) + if (sc->sm != NULL) { err = mixer_delete(sc->sm); if (err) return (err); sc->sm = NULL; + } return (0); } Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Sun Jan 26 14:19:08 2020 (r357145) +++ head/sys/kern/subr_stats.c Sun Jan 26 14:20:57 2020 (r357146) @@ -1583,9 +1583,7 @@ stats_v1_blob_iter(struct statsblobv1 *sb, stats_v1_bl int i, j, firstvoi; ctx.usrctx = usrctx; - ctx.flags |= SB_IT_FIRST_CB; - ctx.flags &= ~(SB_IT_FIRST_VOI | SB_IT_LAST_VOI | SB_IT_FIRST_VOISTAT | - SB_IT_LAST_VOISTAT); + ctx.flags = SB_IT_FIRST_CB; firstvoi = 1; for (i = 0; i < NVOIS(sb); i++) { From owner-svn-src-all@freebsd.org Sun Jan 26 14:23:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A097423F9AA; Sun, 26 Jan 2020 14:23:28 +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 485FV83sZDz44y8; Sun, 26 Jan 2020 14:23:28 +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 7FF8B22682; Sun, 26 Jan 2020 14:23:28 +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 00QENS7E095878; Sun, 26 Jan 2020 14:23:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QENSPG095877; Sun, 26 Jan 2020 14:23:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001261423.00QENSPG095877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 26 Jan 2020 14:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357147 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 14:23:28 -0000 Author: jhb Date: Sun Jan 26 14:23:27 2020 New Revision: 357147 URL: https://svnweb.freebsd.org/changeset/base/357147 Log: Revert accidental change from r357146. Modified: head/sys/kern/subr_stats.c Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Sun Jan 26 14:20:57 2020 (r357146) +++ head/sys/kern/subr_stats.c Sun Jan 26 14:23:27 2020 (r357147) @@ -1583,7 +1583,9 @@ stats_v1_blob_iter(struct statsblobv1 *sb, stats_v1_bl int i, j, firstvoi; ctx.usrctx = usrctx; - ctx.flags = SB_IT_FIRST_CB; + ctx.flags |= SB_IT_FIRST_CB; + ctx.flags &= ~(SB_IT_FIRST_VOI | SB_IT_LAST_VOI | SB_IT_FIRST_VOISTAT | + SB_IT_LAST_VOISTAT); firstvoi = 1; for (i = 0; i < NVOIS(sb); i++) { From owner-svn-src-all@freebsd.org Sun Jan 26 14:32:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 686E523FF62; Sun, 26 Jan 2020 14:32:57 +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 485Fj527xpz45gY; Sun, 26 Jan 2020 14:32:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from dhcp-10-248-114-204.eduroam.wireless.private.cam.ac.uk (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) (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 D132D6C69; Sun, 26 Jan 2020 14:32:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357147 - head/sys/kern From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001261423.00QENSPG095877@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: <3ad7c653-043c-1825-64f6-5a9bc2acad9b@FreeBSD.org> Date: Sun, 26 Jan 2020 14:32:54 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <202001261423.00QENSPG095877@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 14:32:57 -0000 On 1/26/20 6:23 AM, John Baldwin wrote: > Author: jhb > Date: Sun Jan 26 14:23:27 2020 > New Revision: 357147 > URL: https://svnweb.freebsd.org/changeset/base/357147 > > Log: > Revert accidental change from r357146. Oops, this was a different warning fix which I've opened a separate review for (this one was found by gcc 9 instead of clang 10). -- John Baldwin From owner-svn-src-all@freebsd.org Sun Jan 26 17:59:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A60DC1F5E54; Sun, 26 Jan 2020 17:59:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485LGy3lgCz4KQC; Sun, 26 Jan 2020 17:59:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A9924D62; Sun, 26 Jan 2020 17:59:06 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QHx6Zc031816; Sun, 26 Jan 2020 17:59:06 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QHx6iK031815; Sun, 26 Jan 2020 17:59:06 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261759.00QHx6iK031815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 17:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357149 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 357149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 17:59:06 -0000 Author: rmacklem Date: Sun Jan 26 17:59:05 2020 New Revision: 357149 URL: https://svnweb.freebsd.org/changeset/base/357149 Log: Fix a crash in the NFSv4 server. The PR reported a crash that occurred when a file was removed while client(s) were actively doing lock operations on it. Since nfsvno_getvp() will return NULL when the file does not exist, the bug was obvious and easy to fix via this patch. It is a little surprising that this wasn't found sooner, but I guess the above case rarely occurs. Tested by: iron.udjin@gmail.com PR: 242768 Reported by: iron.udjin@gmail.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 26 17:22:05 2020 (r357148) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 26 17:59:05 2020 (r357149) @@ -1554,7 +1554,8 @@ nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp tvp = NULL; else if (vp == NULL && cansleep != 0) { tvp = nfsvno_getvp(&lfp->lf_fh); - NFSVOPUNLOCK(tvp); + if (tvp != NULL) + NFSVOPUNLOCK(tvp); } else tvp = vp; gottvp = 1; From owner-svn-src-all@freebsd.org Sun Jan 26 18:45:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF8901F7741 for ; Sun, 26 Jan 2020 18:45:04 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (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 485MHz68Lpz4N2W for ; Sun, 26 Jan 2020 18:45:03 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pj1-x1042.google.com with SMTP id gv17so2190711pjb.1 for ; Sun, 26 Jan 2020 10:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=XNu/ssFXMbOE/CMfDR9xJEQcXIATni4dw2ediEV7/M4=; b=ctrm0F64PIhLKbDsPtN7sZJ+i5xCRK9fxoY3h3xa3MAVg7Y5iMnLH+HK6CwePYZTSi KTJoJE6ZI10z5L5jdrJ16MIKd8iGK7vTYugjp5HlpfJXv16c3SrVjm7nnhLKpOVdAf0U A1KbjKkE1yQaKxxj+wVDGHYgP9Oj7PrybZLQt6eA7rmjNh4dR9R9bHZX17HD+c+TXceR IqKGjgtzqsVdEYvA6UJMjE6U2xWzZfvPHEsQI1E5Gw9F5pXWofdF+aeDThf7ddkCht9v 9RkoiWhq5/WapdC4YhyUH1ApBiatbRNWbUzwYS5BrLHxfCVruVEp5+moZzQkiUZcsEl8 oG7Q== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=XNu/ssFXMbOE/CMfDR9xJEQcXIATni4dw2ediEV7/M4=; b=mbis9CPfSXTbAJEk6wzd5UH5pT+Y1/w2jx87zwTxNd41bOkamWMc5iIWEFQWSnklk8 KZ8SpHibDD0NTakY7gozEA5rI/SPxKdKBDg2Nc1yLorOJEeYLUhWlDy7z1nCPU+pDMrJ czQmMAaEMFna4GFpPk4OGhdIhYhn5pmf1GmovYmP55JH3uHNzkUWV7DM0RzhURuQUvq6 SL78tjOVUcy8Snmlm4mjTOJ2RXj33nceaXytTArX0D3d7XFxxb9dkQdzT9zpw01Vxm80 40lVBpPWVwBP/B7+LKfxzdLaXAJCA609EombeyieKfJwLDjJaYYZk2YwNVHtAB6bNCkA N0tA== X-Gm-Message-State: APjAAAU0OncghZWdwYMR4ssP41h32WAuMYuzU5nxirFyAFJztO90Kdty qG/873oudSnB3NdkaNpz7n2JBA== X-Google-Smtp-Source: APXvYqyYRefMaAXjXom2RXow2LY8pcfBjEaf37UdU+JkPRUt+vw/l7E6eDSnyV9uQY8Vip5rQKlD6A== X-Received: by 2002:a17:90a:7187:: with SMTP id i7mr6110005pjk.6.1580064296530; Sun, 26 Jan 2020 10:44:56 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id b185sm13360033pfa.102.2020.01.26.10.44.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2020 10:44:56 -0800 (PST) Date: Sun, 26 Jan 2020 08:44:53 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: John Baldwin cc: Gleb Smirnoff , Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge In-Reply-To: <6a5485eb-8623-3316-0385-b0cda1624b05@FreeBSD.org> Message-ID: References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> <6a5485eb-8623-3316-0385-b0cda1624b05@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 485MHz68Lpz4N2W X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=ctrm0F64; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::1042) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.94)[ip: (-0.82), ipnet: 2607:f8b0::/32(-2.05), asn: 15169(-1.79), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:45:05 -0000 On Sun, 26 Jan 2020, John Baldwin wrote: > On 1/23/20 7:32 PM, Gleb Smirnoff wrote: >> On Thu, Jan 23, 2020 at 05:09:14PM -1000, Jeff Roberson wrote: >> J> While we don't have a policy strictly requiring reviews it is the norm to >> J> have substantial changes socialized and reviewed. I appreciate the work >> J> that you are doing but it likely should've been discussed somewhere >> J> more publicly. I apologized if I missed it but I don't see reference to >> J> anything. >> >> That was https://reviews.freebsd.org/D23242 > > A review alone isn't sufficient for large, sweeping changes in my mind. > For major changes, a thread on arch@ or net@ or the like is probably more > appropriate. You can include a link to a review or git branch, etc. in > that e-mail, but phabricator aren't as well suited to higher-level > design-review type discussion, more for implementation-review. >> J> Architecturally I am more concerned with the coarseness of net_epoch and >> J> the duration of hold becoming a resource utilization problem in high >> J> turn-over workloads. Like short connection tcp. Has anyone done >> J> substantial testing here? epoch as it is today will hold every free >> J> callback for a minimum of several clock ticks and a maximum of 2x the >> J> duration of the longest epoch section time. With preemption, etc. this >> J> could be 100s of ms of PCBs held. >> >> We also are concerned about that theoretically. Haven't yet seen effect >> in practice, but our sessions are mostly longer living. First we have the >> tunable to limit batching. Second, there are some ideas on how to improve >> the garbage collector performance if it becomes an issue. > > There are other workloads than Netflix. ;) Verisign has incredibly short-lived > connections with very high turnover. I think though that they have already > abandoned the in-tree network stack for a userland stack built on netmap. Still, > I think that there are probably other FreeBSD users that are probably somewhere > in the middle that shouldn't be ignored. > > Packet batching would not be impossible by simply using m_nextpkt chains in > mbufs passed up to ether_input and having ether_input pass them in a loop to > the next higher loop (as a first step). That would reduce unlock/lock operations > in drivers (for those still using locks on receive) as well as permitting > ether_input to process batches under a single epoch invocation. This is actually the approach that I took for nokia. You could prefetch m->m_nextpkt at the top of the loop iteration. It was very effective there. Seeing how many drivers and unexpected entry points had to have the NET_EPOCH added I would want to review again once it's stable and see if there is a way to simplify through API changes. It seems like more than expected slipped through the cracks and I worry about long-term maintenance. Thanks, Jeff > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Sun Jan 26 21:34:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 611091FCF56; Sun, 26 Jan 2020 21:34:47 +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 485R3q0xcsz4XSg; Sun, 26 Jan 2020 21:34:47 +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 1B6A5276EF; Sun, 26 Jan 2020 21:34:47 +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 00QLYkWH063354; Sun, 26 Jan 2020 21:34:46 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QLYkSI063353; Sun, 26 Jan 2020 21:34:46 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001262134.00QLYkSI063353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 26 Jan 2020 21:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357159 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 357159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 21:34:47 -0000 Author: vmaffione Date: Sun Jan 26 21:34:46 2020 New Revision: 357159 URL: https://svnweb.freebsd.org/changeset/base/357159 Log: netmap_mem_unmap: fix NULL pointer dereference MFC after: 3 days Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Sun Jan 26 20:57:29 2020 (r357158) +++ head/sys/dev/netmap/netmap_mem2.c Sun Jan 26 21:34:46 2020 (r357159) @@ -1523,11 +1523,12 @@ static int netmap_mem_unmap(struct netmap_obj_pool *p, struct netmap_adapter *na) { int i, lim = p->objtotal; - struct netmap_lut *lut = &na->na_lut; + struct netmap_lut *lut; if (na == NULL || na->pdev == NULL) return 0; + lut = &na->na_lut; #if defined(__FreeBSD__) /* On FreeBSD mapping and unmapping is performed by the txsync * and rxsync routine, packet by packet. */ From owner-svn-src-all@freebsd.org Mon Jan 27 00:14:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6628B22915A; Mon, 27 Jan 2020 00:14:52 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485VcX1x7rz4fmH; Mon, 27 Jan 2020 00:14:52 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3919115E1; Mon, 27 Jan 2020 00:14:52 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R0Ep1h058269; Mon, 27 Jan 2020 00:14:51 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R0EpWb058268; Mon, 27 Jan 2020 00:14:51 GMT (envelope-from kan@FreeBSD.org) Message-Id: <202001270014.00R0EpWb058268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Mon, 27 Jan 2020 00:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357161 - head/sys/dev/msk X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/dev/msk X-SVN-Commit-Revision: 357161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 00:14:52 -0000 Author: kan Date: Mon Jan 27 00:14:51 2020 New Revision: 357161 URL: https://svnweb.freebsd.org/changeset/base/357161 Log: Enter net epoch in msk_tick. One more instance of if_input being called outside of interrupt, by means of msk_handle_events. Differential Revision: https://reviews.freebsd.org/D23379 Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Sun Jan 26 21:55:17 2020 (r357160) +++ head/sys/dev/msk/if_msk.c Mon Jan 27 00:14:51 2020 (r357161) @@ -3374,6 +3374,7 @@ msk_txeof(struct msk_if_softc *sc_if, int idx) static void msk_tick(void *xsc_if) { + struct epoch_tracker et; struct msk_if_softc *sc_if; struct mii_data *mii; @@ -3386,7 +3387,9 @@ msk_tick(void *xsc_if) mii_tick(mii); if ((sc_if->msk_flags & MSK_FLAG_LINK) == 0) msk_miibus_statchg(sc_if->msk_if_dev); + NET_EPOCH_ENTER(et); msk_handle_events(sc_if->msk_softc); + NET_EPOCH_EXIT(et); msk_watchdog(sc_if); callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if); } From owner-svn-src-all@freebsd.org Mon Jan 27 05:56:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A220F23286B; Mon, 27 Jan 2020 05:56:47 +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 485fC33v1Nz3y4v; Mon, 27 Jan 2020 05:56:47 +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 803F157AD; Mon, 27 Jan 2020 05:56:47 +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 00R5ullC061795; Mon, 27 Jan 2020 05:56:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R5ul5U061794; Mon, 27 Jan 2020 05:56:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001270556.00R5ul5U061794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 Jan 2020 05:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r357162 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 357162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 05:56:47 -0000 Author: cy Date: Mon Jan 27 05:56:47 2020 New Revision: 357162 URL: https://svnweb.freebsd.org/changeset/base/357162 Log: Sizelimit for sqlite3-3.31.0 (3310000). Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jan 27 00:14:51 2020 (r357161) +++ svnadmin/conf/sizelimit.conf Mon Jan 27 05:56:47 2020 (r357162) @@ -16,6 +16,7 @@ # First field is username, second field is the raised limit required. achim bapt +cy davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Mon Jan 27 05:57:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABEA423291F; Mon, 27 Jan 2020 05:57:39 +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 485fD34vQnz3yC4; Mon, 27 Jan 2020 05:57:39 +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 A304757AF; Mon, 27 Jan 2020 05:57:39 +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 00R5vdMF061879; Mon, 27 Jan 2020 05:57:39 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R5vNYD061864; Mon, 27 Jan 2020 05:57:23 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001270557.00R5vNYD061864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 Jan 2020 05:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357163 - in vendor/sqlite3/dist: . tea tea/generic tea/win X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/sqlite3/dist: . tea tea/generic tea/win X-SVN-Commit-Revision: 357163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 05:57:39 -0000 Author: cy Date: Mon Jan 27 05:57:23 2020 New Revision: 357163 URL: https://svnweb.freebsd.org/changeset/base/357163 Log: Import sqlite3-3.31.0 (3310000) Modified: vendor/sqlite3/dist/Makefile.msc vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/sqlite3ext.h vendor/sqlite3/dist/tea/configure vendor/sqlite3/dist/tea/configure.ac vendor/sqlite3/dist/tea/generic/tclsqlite3.c vendor/sqlite3/dist/tea/win/makefile.vc Modified: vendor/sqlite3/dist/Makefile.msc ============================================================================== --- vendor/sqlite3/dist/Makefile.msc Mon Jan 27 05:56:47 2020 (r357162) +++ vendor/sqlite3/dist/Makefile.msc Mon Jan 27 05:57:23 2020 (r357163) @@ -210,6 +210,12 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF +# Set this to non-0 to enable support for the rbu extension. +# +!IFNDEF RBU +RBU = 0 +!ENDIF + # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -282,7 +288,6 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -296,6 +301,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Should the rbu extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(RBU)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 +!ENDIF + # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -978,7 +990,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: vendor/sqlite3/dist/configure ============================================================================== --- vendor/sqlite3/dist/configure Mon Jan 27 05:56:47 2020 (r357162) +++ vendor/sqlite3/dist/configure Mon Jan 27 05:57:23 2020 (r357163) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.31.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.30.1' -PACKAGE_STRING='sqlite 3.30.1' +PACKAGE_VERSION='3.31.0' +PACKAGE_STRING='sqlite 3.31.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.31.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.30.1:";; + short | recursive ) echo "Configuration of sqlite 3.31.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.30.1 +sqlite configure 3.31.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.30.1, which was +It was created by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.30.1' + VERSION='3.31.0' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.30.1, which was +This file was extended by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.30.1 +sqlite config.status 3.31.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/configure.ac ============================================================================== --- vendor/sqlite3/dist/configure.ac Mon Jan 27 05:56:47 2020 (r357162) +++ vendor/sqlite3/dist/configure.ac Mon Jan 27 05:57:23 2020 (r357163) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.31.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- Modified: vendor/sqlite3/dist/shell.c ============================================================================== --- vendor/sqlite3/dist/shell.c Mon Jan 27 05:56:47 2020 (r357162) +++ vendor/sqlite3/dist/shell.c Mon Jan 27 05:57:23 2020 (r357163) @@ -2007,19 +2007,23 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } return rc; } @@ -2613,6 +2617,7 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3006,10 +3011,12 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "readfile", 1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "writefile", -1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3144,6 +3151,7 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -4578,6 +4586,7 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5190,25 +5199,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - sqlite3_int64 nAlloc = compressBound(nIn); - u8 *aOut; int rc = SQLITE_OK; + sqlite3_int64 nAlloc; + z_stream str; + u8 *aOut; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + + nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; - z_stream str; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; - - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); - if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5517,10 +5526,10 @@ static int zipfileBestIndex( idx = i; } } + pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; - pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5642,8 +5651,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( zA[nA-1]=='/' ) nA--; - if( zB[nB-1]=='/' ) nB--; + if( nA>0 && zA[nA-1]=='/' ) nA--; + if( nB>0 && zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5653,6 +5662,10 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); + if( pTab->zFile==0 || pTab->zFile[0]==0 ){ + pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); + return SQLITE_ERROR; + } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5827,6 +5840,7 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); + if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5836,11 +5850,15 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( zPath[nPath-1]!='/' ){ + if( nPath<=0 || zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); - if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - nPath++; + if( zFree==0 ){ + rc = SQLITE_NOMEM; + nPath = 0; + }else{ + nPath = (int)strlen(zPath); + } } } @@ -6233,19 +6251,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( zName[nName-1]=='/' ){ + if( nName>0 && zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( zName[nName-1]!='/' ){ + if( nName==0 || zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); - nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } + nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6501,10 +6519,12 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6525,8 +6545,8 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ - - +#if !defined(SQLITEEXPERT_H) +#define SQLITEEXPERT_H 1 /* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6680,8 +6700,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); +#endif /* !defined(SQLITEEXPERT_H) */ - /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -9566,6 +9586,7 @@ struct ShellState { int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ + int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ FILE *out; /* Write results here */ FILE *traceOut; /* Output for sqlite3_trace() */ @@ -10400,19 +10421,22 @@ static int shell_callback( const int *colWidth; int showHdr; char *rowSep; + int nWidth; if( p->cMode==MODE_Column ){ colWidth = p->colWidth; + nWidth = ArraySize(p->colWidth); showHdr = p->showHeader; rowSep = p->rowSeparator; }else{ colWidth = aExplainWidths; + nWidth = ArraySize(aExplainWidths); showHdr = 1; rowSep = SEP_Row; } if( p->cnt++==0 ){ for(i=0; icolWidth) ){ + if( idb, SQLITE_DBCONFIG_DEFENSIVE, -1, &defensiveMode); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, @@ -11311,6 +11338,7 @@ static void bind_table_init(ShellState *p){ ") WITHOUT ROWID;", 0, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, defensiveMode, 0); } /* @@ -12053,9 +12081,7 @@ static const char *(azHelp[]) = { ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", ".expert EXPERIMENTAL. Suggest indexes for queries", -/* Because explain mode comes on automatically now, the ".explain" mode -** is removed from the help screen. It is still supported for legacy, however */ -/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ + ".explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto", ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12106,6 +12132,7 @@ static const char *(azHelp[]) = { " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", + " --nofollow Do not follow symbolic links", " --readonly Open FILE readonly", " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", @@ -12670,7 +12697,7 @@ static void open_db(ShellState *p, int openFlags){ switch( p->openMode ){ case SHELL_OPEN_APPENDVFS: { sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs"); + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, "apndvfs"); break; } case SHELL_OPEN_HEXDB: @@ -12683,12 +12710,14 @@ static void open_db(ShellState *p, int openFlags){ break; } case SHELL_OPEN_READONLY: { - sqlite3_open_v2(p->zDbFilename, &p->db, SQLITE_OPEN_READONLY, 0); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READONLY|p->openFlags, 0); break; } case SHELL_OPEN_UNSPEC: case SHELL_OPEN_NORMAL: { - sqlite3_open(p->zDbFilename, &p->db); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, 0); break; } } @@ -13462,7 +13491,7 @@ static unsigned int get4byteInt(unsigned char *a){ } /* -** Implementation of the ".info" command. +** Implementation of the ".dbinfo" command. ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ @@ -15699,20 +15728,22 @@ static int do_meta_command(char *zLine, ShellState *p) const char *zName; int op; } aDbConfig[] = { + { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, + { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, { "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY }, + { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, { "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER }, { "enable_view", SQLITE_DBCONFIG_ENABLE_VIEW }, { "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER }, + { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, + { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT }, { "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION }, { "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE }, - { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, - { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, { "reset_database", SQLITE_DBCONFIG_RESET_DATABASE }, - { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, + { "trusted_schema", SQLITE_DBCONFIG_TRUSTED_SCHEMA }, { "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA }, - { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, - { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, - { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, }; int ii, v; open_db(p, 0); @@ -15722,7 +15753,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_db_config(p->db, aDbConfig[ii].op, booleanValue(azArg[2]), 0); } sqlite3_db_config(p->db, aDbConfig[ii].op, -1, &v); - utf8_printf(p->out, "%18s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); + utf8_printf(p->out, "%19s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); if( nArg>1 ) break; } if( nArg>1 && ii==ArraySize(aDbConfig) ){ @@ -16303,10 +16334,19 @@ static int do_meta_command(char *zLine, ShellState *p) char *zCollist = 0; sqlite3_stmt *pStmt; int tnum = 0; + int isWO = 0; /* True if making an imposter of a WITHOUT ROWID table */ + int lenPK = 0; /* Length of the PRIMARY KEY string for isWO tables */ int i; if( !(nArg==3 || (nArg==2 && sqlite3_stricmp(azArg[1],"off")==0)) ){ utf8_printf(stderr, "Usage: .imposter INDEX IMPOSTER\n" " .imposter off\n"); + /* Also allowed, but not documented: + ** + ** .imposter TABLE IMPOSTER + ** + ** where TABLE is a WITHOUT ROWID table. In that case, the + ** imposter is another WITHOUT ROWID table with the columns in + ** storage order. */ rc = 1; goto meta_command_exit; } @@ -16315,19 +16355,22 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 0, 1); goto meta_command_exit; } - zSql = sqlite3_mprintf("SELECT rootpage FROM sqlite_master" - " WHERE name='%q' AND type='index'", azArg[1]); + zSql = sqlite3_mprintf( + "SELECT rootpage, 0 FROM sqlite_master" + " WHERE name='%q' AND type='index'" + "UNION ALL " + "SELECT rootpage, 1 FROM sqlite_master" + " WHERE name='%q' AND type='table'" + " AND sql LIKE '%%without%%rowid%%'", + azArg[1], azArg[1] + ); sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( sqlite3_step(pStmt)==SQLITE_ROW ){ tnum = sqlite3_column_int(pStmt, 0); + isWO = sqlite3_column_int(pStmt, 1); } sqlite3_finalize(pStmt); - if( tnum==0 ){ - utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); - rc = 1; - goto meta_command_exit; - } zSql = sqlite3_mprintf("PRAGMA index_xinfo='%q'", azArg[1]); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); @@ -16344,6 +16387,9 @@ static int do_meta_command(char *zLine, ShellState *p) zCol = zLabel; } } + if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){ + lenPK = (int)strlen(zCollist); + } if( zCollist==0 ){ zCollist = sqlite3_mprintf("\"%w\"", zCol); }else{ @@ -16351,9 +16397,16 @@ static int do_meta_command(char *zLine, ShellState *p) } } sqlite3_finalize(pStmt); + if( i==0 || tnum==0 ){ + utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); + rc = 1; + sqlite3_free(zCollist); + goto meta_command_exit; + } + if( lenPK==0 ) lenPK = 100000; zSql = sqlite3_mprintf( - "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%s))WITHOUT ROWID", - azArg[2], zCollist, zCollist); + "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%.*s))WITHOUT ROWID", + azArg[2], zCollist, lenPK, zCollist); sqlite3_free(zCollist); rc = sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 1, tnum); if( rc==SQLITE_OK ){ @@ -16364,7 +16417,8 @@ static int do_meta_command(char *zLine, ShellState *p) }else{ utf8_printf(stdout, "%s;\n", zSql); raw_printf(stdout, - "WARNING: writing to an imposter table will corrupt the index!\n" + "WARNING: writing to an imposter table will corrupt the \"%s\" %s!\n", + azArg[1], isWO ? "table" : "index" ); } }else{ @@ -16562,6 +16616,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_free(p->zFreeOnClose); p->zFreeOnClose = 0; p->openMode = SHELL_OPEN_UNSPEC; + p->openFlags = 0; p->szMax = 0; /* Check for command-line arguments */ for(iName=1; iNameopenMode = SHELL_OPEN_APPENDVFS; }else if( optionMatch(z, "readonly") ){ p->openMode = SHELL_OPEN_READONLY; + }else if( optionMatch(z, "nofollow") ){ + p->openFlags |= SQLITE_OPEN_NOFOLLOW; #ifdef SQLITE_ENABLE_DESERIALIZE }else if( optionMatch(z, "deserialize") ){ p->openMode = SHELL_OPEN_DESERIALIZE; @@ -17732,7 +17789,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "" }, { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, @@ -17848,7 +17905,6 @@ static int do_meta_command(char *zLine, ShellState *p) /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: - case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: if( nArg==3 ){ int opt = booleanValue(azArg[2]); rc2 = sqlite3_test_control(testctrl, opt); @@ -17866,6 +17922,12 @@ static int do_meta_command(char *zLine, ShellState *p) } break; + /* sqlite3_test_control(sqlite3*) */ + case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: + rc2 = sqlite3_test_control(testctrl, p->db); + isOk = 3; + break; + case SQLITE_TESTCTRL_IMPOSTER: if( nArg==5 ){ rc2 = sqlite3_test_control(testctrl, p->db, @@ -18496,6 +18558,7 @@ static const char zOptions[] = " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" + " -nofollow refuse to open symbolic links to database files\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" @@ -18806,6 +18869,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags = SQLITE_OPEN_NOFOLLOW; #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) }else if( strncmp(z, "-A",2)==0 ){ /* All remaining command-line arguments are passed to the ".archive" @@ -18909,6 +18974,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags |= SQLITE_OPEN_NOFOLLOW; }else if( strcmp(z,"-ascii")==0 ){ data.mode = MODE_Ascii; sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, Modified: vendor/sqlite3/dist/sqlite3.c ============================================================================== --- vendor/sqlite3/dist/sqlite3.c Mon Jan 27 05:56:47 2020 (r357162) +++ vendor/sqlite3/dist/sqlite3.c Mon Jan 27 05:57:23 2020 (r357163) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.30.1. By combining all the individual C code files into this +** version 3.31.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1165,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.30.1" -#define SQLITE_VERSION_NUMBER 3030001 -#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" +#define SQLITE_VERSION "3.31.0" +#define SQLITE_VERSION_NUMBER 3031000 +#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1558,6 +1558,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) #define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ +#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) @@ -1577,11 +1578,13 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) +#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) +#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations @@ -1610,6 +1613,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ +#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ /* Reserved: 0x00F00000 */ @@ -2021,16 +2025,16 @@ struct sqlite3_io_methods { ** ^The [SQLITE_FCNTL_BUSYHANDLER] ** file-control may be invoked by SQLite on the database file handle ** shortly after it is opened in order to provide a custom VFS with access -** to the connections busy-handler callback. The argument is of type (void **) +** to the connection's busy-handler callback. The argument is of type (void**) ** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connections +** to a function of type (int (*)(void *)). In order to invoke the connection's ** busy-handler, this function should be invoked with the second (void *) in ** the array as the only argument. If it returns non-zero, then the operation ** should be retried. If it returns zero, the custom VFS should abandon the ** current operation. ** **
  • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control ** to have SQLite generate a ** temporary filename using the same algorithm that is followed to generate ** temporary filenames for TEMP tables and other internal uses. The @@ -2143,12 +2147,18 @@ struct sqlite3_io_methods { ** not provide a mechanism to detect changes to MAIN only. Also, the ** [sqlite3_total_changes()] interface responds to internal changes only and ** omits changes made by other database connections. The -** [PRAGMA data_version] command provide a mechanism to detect changes to +** [PRAGMA data_version] command provides a mechanism to detect changes to ** a single attached database that occur due to other database connections, ** but omits changes implemented by the database connection on which it is ** called. This file control is the only mechanism to detect changes that ** happen either internally or externally and that are associated with ** a particular attached database. +** +**
  • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -2186,6 +2196,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_LOCK_TIMEOUT 34 #define SQLITE_FCNTL_DATA_VERSION 35 #define SQLITE_FCNTL_SIZE_LIMIT 36 +#define SQLITE_FCNTL_CKPT_DONE 37 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -2231,10 +2242,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields ** may be appended to the sqlite3_vfs object and the iVersion value ** may increase again in future versions of SQLite. -** Note that the structure -** of the sqlite3_vfs object changes in the transition from +** Note that due to an oversight, the structure +** of the sqlite3_vfs object changed in the transition from ** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] -** and yet the iVersion field was not modified. +** and yet the iVersion field was not increased. ** ** The szOsFile field is the size of the subclassed [sqlite3_file] ** structure used by this VFS. mxPathname is the maximum length of @@ -2325,7 +2336,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite -** to hold the [sqlite3_file] structure passed as the third +** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that ** the xOpen method must set the sqlite3_file.pMethods to either @@ -2662,7 +2673,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ... ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, -** it might allocate any require mutexes or initialize internal data +** it might allocate any required mutexes or initialize internal data ** structures. The xShutdown method is invoked (indirectly) by ** [sqlite3_shutdown()] and should deallocate any resources acquired ** by xInit. The pAppData pointer is used as the only parameter to @@ -2784,6 +2795,7 @@ struct sqlite3_mem_methods { ** memory allocation statistics. ^(When memory allocation statistics are ** disabled, the following SQLite interfaces become non-operational: **
      +**
    • [sqlite3_hard_heap_limit64()] **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] **
    • [sqlite3_soft_heap_limit64()] @@ -2802,7 +2814,7 @@ struct sqlite3_mem_methods { **
      ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page ** cache implementation. -** This configuration option is a no-op if an application-define page +** This configuration option is a no-op if an application-defined page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to ** 8-byte aligned memory (pMem), the size of each page cache line (sz), @@ -3287,7 +3299,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_DQS_DML]] **
      SQLITE_DBCONFIG_DQS_DML **
      The SQLITE_DBCONFIG_DQS_DML option activates or deactivates -** the legacy [double-quoted string literal] misfeature for DML statement +** the legacy [double-quoted string literal] misfeature for DML statements ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. @@ -3301,6 +3313,49 @@ struct sqlite3_mem_methods { ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. **
      +** +** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] +**
      SQLITE_DBCONFIG_TRUSTED_SCHEMA +**
      The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to +** assume that database schemas (the contents of the [sqlite_master] tables) +** are untainted by malicious content. +** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite +** takes additional defensive steps to protect the application from harm +** including: +**
        +**
      • Prohibit the use of SQL functions inside triggers, views, +** CHECK constraints, DEFAULT clauses, expression indexes, +** partial indexes, or generated columns +** unless those functions are tagged with [SQLITE_INNOCUOUS]. +**
      • Prohibit the use of virtual tables inside of triggers or views +** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS]. +**
      +** This setting defaults to "on" for legacy compatibility, however +** all applications are advised to turn it off if possible. This setting +** can also be controlled using the [PRAGMA trusted_schema] statement. +**
      +** +** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] +**
      SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +**
      The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates +** the legacy file format flag. When activated, this flag causes all newly +** created database file to have a schema format version number (the 4-byte +** integer found at offset 44 into the database header) of 1. This in turn +** means that the resulting database file will be readable and writable by +** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, +** newly created databases are generally not understandable by SQLite versions +** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there +** is now scarcely any need to generated database files that are compatible +** all the way back to version 3.0.0, and so this setting is of little +** practical use, but is provided so that SQLite can continue to claim the +** ability to generate new database files that are compatible with version +** 3.0.0. +**

      Note that when the SQLITE_DBCONFIG_LEGACY_FILE_FORMAT setting is on, +** the [VACUUM] command will fail with an obscure error when attempting to +** process a table with generated columns and a descending index. This is +** not considered a bug since SQLite versions 3.3.0 and earlier do not support +** either generated columns or decending indexes. +**

      ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3319,7 +3374,9 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ #define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ +#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -3525,7 +3582,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the -** running statements reaches zero are interrupted as if they had been +** running statement count reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). @@ -3693,9 +3750,9 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** Cindy | 21 ** ** -** There are two column (M==2) and three rows (N==3). Thus the +** There are two columns (M==2) and three rows (N==3). Thus the ** result table has 8 entries. Suppose the result table is stored -** in an array names azResult. Then azResult holds this content: +** in an array named azResult. Then azResult holds this content: ** **
       **        azResult[0] = "Name";
      @@ -3788,7 +3845,7 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       **
       ** The SQLite core uses these three routines for all of its own
       ** internal memory allocation needs. "Core" in the previous sentence
      -** does not include operating-system specific VFS implementation.  The
      +** does not include operating-system specific [VFS] implementation.  The
       ** Windows VFS uses native malloc() and free() for some operations.
       **
       ** ^The sqlite3_malloc() routine returns a pointer to a block
      @@ -3849,19 +3906,6 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       ** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
       ** option is used.
       **
      -** In SQLite version 3.5.0 and 3.5.1, it was possible to define
      -** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
      -** implementation of these routines to be omitted.  That capability
      -** is no longer provided.  Only built-in memory allocators can be used.
      -**
      -** Prior to SQLite version 3.7.10, the Windows OS interface layer called
      -** the system malloc() and free() directly when converting
      -** filenames between the UTF-8 encoding used by SQLite
      -** and whatever filename encoding is used by the particular Windows
      -** installation.  Memory allocation errors were detected, but
      -** they were reported back as [SQLITE_CANTOPEN] or
      -** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
      -**
       ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
       ** must be either NULL or else pointers obtained from a prior
       ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
      @@ -3910,7 +3954,7 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int 
       ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
       ** select random [ROWID | ROWIDs] when inserting new records into a table that
       ** already uses the largest possible [ROWID].  The PRNG is also used for
      -** the build-in random() and randomblob() SQL functions.  This interface allows
      +** the built-in random() and randomblob() SQL functions.  This interface allows
       ** applications to access the same PRNG for other purposes.
       **
       ** ^A call to this routine stores N bytes of randomness into buffer P.
      @@ -4284,10 +4328,8 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int
       ** The sqlite3_open_v2() interface works like sqlite3_open()
       ** except that it accepts two additional parameters for additional control
       ** over the new database connection.  ^(The flags parameter to
      -** sqlite3_open_v2() can take one of
      -** the following three values, optionally combined with the 
      -** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
      -** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^
      +** sqlite3_open_v2() must include, at a minimum, one of the following
      +** three flag combinations:)^
       **
       ** 
      ** ^(
      [SQLITE_OPEN_READONLY]
      @@ -4305,23 +4347,51 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int ** sqlite3_open() and sqlite3_open16().)^ **
      ** +** In addition to the required flags, the following optional flags are +** also supported: +** +**
      +** ^(
      [SQLITE_OPEN_URI]
      +**
      The filename can be interpreted as a URI if this flag is set.
      )^ +** +** ^(
      [SQLITE_OPEN_MEMORY]
      +**
      The database will be opened as an in-memory database. The database +** is named by the "filename" argument for the purposes of cache-sharing, +** if shared cache mode is enabled, but the "filename" is otherwise ignored. +**
      )^ +** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 27 06:03:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19A89232C2F; Mon, 27 Jan 2020 06:03:37 +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 485fLw72Klz3yft; Mon, 27 Jan 2020 06:03:36 +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 D3A7D5975; Mon, 27 Jan 2020 06:03:36 +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 00R63a2j067610; Mon, 27 Jan 2020 06:03:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R63aLF067609; Mon, 27 Jan 2020 06:03:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001270603.00R63aLF067609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 Jan 2020 06:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357164 - vendor/sqlite3/sqlite-3310000 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-3310000 X-SVN-Commit-Revision: 357164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 06:03:37 -0000 Author: cy Date: Mon Jan 27 06:03:36 2020 New Revision: 357164 URL: https://svnweb.freebsd.org/changeset/base/357164 Log: Tag import of sqlite3-3.31.0 (3310000). Added: vendor/sqlite3/sqlite-3310000/ - copied from r357163, vendor/sqlite3/dist/ From owner-svn-src-all@freebsd.org Mon Jan 27 06:04:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82A12232CAA; Mon, 27 Jan 2020 06:04:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485fN12sklz3ymq; Mon, 27 Jan 2020 06:04:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DA0B5976; Mon, 27 Jan 2020 06:04:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R64XQc067693; Mon, 27 Jan 2020 06:04:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R64Xqj067692; Mon, 27 Jan 2020 06:04:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001270604.00R64Xqj067692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 Jan 2020 06:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357165 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 06:04:33 -0000 Author: cem Date: Mon Jan 27 06:04:32 2020 New Revision: 357165 URL: https://svnweb.freebsd.org/changeset/base/357165 Log: hwpstate(4): Log a debug line when throttled If we're going to throttle user requested P-states, we should at least produce a debug log line indicating the surprising behavior. PR: inspired by 234733 Modified: head/sys/x86/cpufreq/hwpstate_amd.c Modified: head/sys/x86/cpufreq/hwpstate_amd.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_amd.c Mon Jan 27 06:03:36 2020 (r357164) +++ head/sys/x86/cpufreq/hwpstate_amd.c Mon Jan 27 06:04:32 2020 (r357165) @@ -173,8 +173,12 @@ hwpstate_goto_pstate(device_t dev, int id) /* get the current pstate limit */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); - if (limit > id) + if (limit > id) { + HWPSTATE_DEBUG(dev, + "Restricting requested P%d to P%d due to HW limit\n", id, + limit); id = limit; + } cpu = curcpu; HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n", id, cpu); From owner-svn-src-all@freebsd.org Mon Jan 27 06:05:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53EEF232DA9; Mon, 27 Jan 2020 06:05:44 +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 485fPN1bQ3z3yxZ; Mon, 27 Jan 2020 06:05:44 +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 30AFA5980; Mon, 27 Jan 2020 06:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R65hMa067813; Mon, 27 Jan 2020 06:05:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R65hOc067812; Mon, 27 Jan 2020 06:05:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001270605.00R65hOc067812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 Jan 2020 06:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r357166 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 357166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 06:05:44 -0000 Author: cy Date: Mon Jan 27 06:05:43 2020 New Revision: 357166 URL: https://svnweb.freebsd.org/changeset/base/357166 Log: sqlite3 3.33.0 import into the vendor branch is now complete. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Mon Jan 27 06:04:32 2020 (r357165) +++ svnadmin/conf/sizelimit.conf Mon Jan 27 06:05:43 2020 (r357166) @@ -16,7 +16,6 @@ # First field is username, second field is the raised limit required. achim bapt -cy davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Mon Jan 27 07:02:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C040234372; Mon, 27 Jan 2020 07:02:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485ggK1C3Wz42bv; Mon, 27 Jan 2020 07:02:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2490F6452; Mon, 27 Jan 2020 07:02:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R72rDO003728; Mon, 27 Jan 2020 07:02:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R72qbe003726; Mon, 27 Jan 2020 07:02:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001270702.00R72qbe003726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 07:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357167 - in stable/12/contrib/llvm-project/llvm/lib: MC Object Target/Mips X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12/contrib/llvm-project/llvm/lib: MC Object Target/Mips X-SVN-Commit-Revision: 357167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 07:02:53 -0000 Author: dim Date: Mon Jan 27 07:02:52 2020 New Revision: 357167 URL: https://svnweb.freebsd.org/changeset/base/357167 Log: MFC r356789 (by arichardson): Merge commit 894f742acb from llvm git (by me): [MIPS][ELF] Use PC-relative relocations in .eh_frame when possible When compiling position-independent executables, we now use DW_EH_PE_pcrel | DW_EH_PE_sdata4. However, the MIPS ABI does not define a 64-bit PC-relative ELF relocation so we cannot use sdata8 for the large code model case. When using the large code model, we fall back to the previous behaviour of generating absolute relocations. With this change clang-generated .o files can be linked by LLD without having to pass -Wl,-z,notext (which creates text relocations). This is simpler than the approach used by ld.bfd, which rewrites the .eh_frame section to convert absolute relocations into relative references. I saw in D13104 that apparently ld.bfd did not accept pc-relative relocations for MIPS ouput at some point. However, I also checked that recent ld.bfd can process the clang-generated .o files so this no longer seems true. Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D72228 Merge commit 8e8ccf47 from llvm git (by me) [MIPS] Don't emit R_(MICRO)MIPS_JALR relocations against data symbols The R_(MICRO)MIPS_JALR optimization only works when used against functions. Using the relocation against a data symbol (e.g. function pointer) will cause some linkers that don't ignore the hint in this case (e.g. LLD prior to commit 5bab291) to generate a relative branch to the data symbol which crashes at run time. Before this patch, LLVM was erroneously emitting these relocations against local-dynamic TLS function pointers and global function pointers with internal visibility. Reviewers: atanasyan, jrtc27, vstefanovic Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D72571 These two changes should allow using lld for MIPS64 (and maybe also MIPS32) by default. The second commit is not strictly necessary for clang+lld since LLD9 will not perform the R_MIPS_JALR optimization (it was only added for 10) but it is probably required in order to use recent ld.bfd. Reviewed By: dim, emaste Differential Revision: https://reviews.freebsd.org/D23203 Modified: stable/12/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp stable/12/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp Directory Properties: stable/12/ (props changed) stable/12/contrib/llvm-project/llvm/ (props changed) Modified: stable/12/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp Mon Jan 27 06:05:43 2020 (r357166) +++ stable/12/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp Mon Jan 27 07:02:52 2020 (r357167) @@ -303,9 +303,14 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const T case Triple::mipsel: case Triple::mips64: case Triple::mips64el: - FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4 - ? dwarf::DW_EH_PE_sdata4 - : dwarf::DW_EH_PE_sdata8; + // We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case + // since there is no R_MIPS_PC64 relocation (only a 32-bit version). + if (PositionIndependent && !Large) + FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + else + FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4 + ? dwarf::DW_EH_PE_sdata4 + : dwarf::DW_EH_PE_sdata8; break; case Triple::ppc64: case Triple::ppc64le: Modified: stable/12/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp Mon Jan 27 06:05:43 2020 (r357166) +++ stable/12/contrib/llvm-project/llvm/lib/Object/RelocationResolver.cpp Mon Jan 27 07:02:52 2020 (r357167) @@ -103,6 +103,7 @@ static bool supportsMips64(uint64_t Type) { case ELF::R_MIPS_32: case ELF::R_MIPS_64: case ELF::R_MIPS_TLS_DTPREL64: + case ELF::R_MIPS_PC32: return true; default: return false; @@ -117,6 +118,8 @@ static uint64_t resolveMips64(RelocationRef R, uint64_ return S + getELFAddend(R); case ELF::R_MIPS_TLS_DTPREL64: return S + getELFAddend(R) - 0x8000; + case ELF::R_MIPS_PC32: + return S + getELFAddend(R) - R.getOffset(); default: llvm_unreachable("Invalid relocation type"); } Modified: stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp Mon Jan 27 06:05:43 2020 (r357166) +++ stable/12/contrib/llvm-project/llvm/lib/Target/Mips/MipsISelLowering.cpp Mon Jan 27 07:02:52 2020 (r357167) @@ -2995,6 +2995,14 @@ void MipsTargetLowering::AdjustInstrPostInstrSelection StringRef Sym; if (const GlobalAddressSDNode *G = dyn_cast_or_null(TargetAddr)) { + // We must not emit the R_MIPS_JALR relocation against data symbols + // since this will cause run-time crashes if the linker replaces the + // call instruction with a relative branch to the data symbol. + if (!isa(G->getGlobal())) { + LLVM_DEBUG(dbgs() << "Not adding R_MIPS_JALR against data symbol " + << G->getGlobal()->getName() << "\n"); + return; + } Sym = G->getGlobal()->getName(); } else if (const ExternalSymbolSDNode *ES = @@ -3007,6 +3015,7 @@ void MipsTargetLowering::AdjustInstrPostInstrSelection MachineFunction *MF = MI.getParent()->getParent(); MCSymbol *S = MF->getContext().getOrCreateSymbol(Sym); + LLVM_DEBUG(dbgs() << "Adding R_MIPS_JALR against " << Sym << "\n"); MI.addOperand(MachineOperand::CreateMCSymbol(S, MipsII::MO_JALR)); } } From owner-svn-src-all@freebsd.org Mon Jan 27 07:03:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 517EB2343F7; Mon, 27 Jan 2020 07:03:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485ghb1Qj5z42k5; Mon, 27 Jan 2020 07:03:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C1D96455; Mon, 27 Jan 2020 07:03:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R73xuP003841; Mon, 27 Jan 2020 07:03:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00R73vVo003834; Mon, 27 Jan 2020 07:03:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001270703.00R73vVo003834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 07:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357168 - in stable/12/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 357168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 07:03:59 -0000 Author: dim Date: Mon Jan 27 07:03:57 2020 New Revision: 357168 URL: https://svnweb.freebsd.org/changeset/base/357168 Log: MFC r356929: Merge commit bc4bc5aa0 from llvm git (by Justin Hibbits): Add 8548 CPU definition and attributes 8548 CPU is GCC's name for the e500v2, so accept this in clang. The e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well, as GCC does. Differential Revision: https://reviews.llvm.org/D67787 Merge commit ff0311c4b from llvm git (by Justin Hibbits): [PowerPC]: Add powerpcspe target triple subarch component Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014 Merge commit ba91dffaf from llvm git (by Fangrui Song): [Driver][PowerPC] Move powerpcspe logic from cc1 to Driver Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433 commit 36eedfcb3 from llvm git (by Justin Hibbits): [PowerPC] Fix powerpcspe subtarget enablement in llvm backend Summary: As currently written, -target powerpcspe will enable SPE regardless of disabling the feature later on in the command line. Instead, change this to just set a default CPU to 'e500' instead of a generic CPU. As part of this, add FeatureSPE to the e500 definition. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D72673 These are needed to unbreak the build for powerpcspe. Requested by: jhibbits Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp stable/12/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h stable/12/contrib/llvm-project/llvm/lib/Support/Triple.cpp stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Directory Properties: stable/12/ (props changed) stable/12/contrib/llvm-project/clang/ (props changed) stable/12/contrib/llvm-project/llvm/ (props changed) Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 27 07:03:57 2020 (r357168) @@ -157,6 +157,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions Builder.defineMacro("_ARCH_A2Q"); Builder.defineMacro("_ARCH_QP"); } + if (ArchDefs & ArchDefineE500) + Builder.defineMacro("__NO_LWSYNC__"); if (getTriple().getVendor() == llvm::Triple::BGQ) { Builder.defineMacro("__bg__"); @@ -312,6 +314,11 @@ bool PPCTargetInfo::initFeatureMap( .Case("pwr8", true) .Default(false); + Features["spe"] = llvm::StringSwitch(CPU) + .Case("8548", true) + .Case("e500", true) + .Default(false); + if (!ppcUserFeaturesCheck(Diags, FeaturesVec)) return false; @@ -449,16 +456,16 @@ ArrayRef PPCTargetInfo::getGC } static constexpr llvm::StringLiteral ValidCPUNames[] = { - {"generic"}, {"440"}, {"450"}, {"601"}, {"602"}, - {"603"}, {"603e"}, {"603ev"}, {"604"}, {"604e"}, - {"620"}, {"630"}, {"g3"}, {"7400"}, {"g4"}, - {"7450"}, {"g4+"}, {"750"}, {"970"}, {"g5"}, - {"a2"}, {"a2q"}, {"e500mc"}, {"e5500"}, {"power3"}, - {"pwr3"}, {"power4"}, {"pwr4"}, {"power5"}, {"pwr5"}, - {"power5x"}, {"pwr5x"}, {"power6"}, {"pwr6"}, {"power6x"}, - {"pwr6x"}, {"power7"}, {"pwr7"}, {"power8"}, {"pwr8"}, - {"power9"}, {"pwr9"}, {"powerpc"}, {"ppc"}, {"powerpc64"}, - {"ppc64"}, {"powerpc64le"}, {"ppc64le"}, + {"generic"}, {"440"}, {"450"}, {"601"}, {"602"}, + {"603"}, {"603e"}, {"603ev"}, {"604"}, {"604e"}, + {"620"}, {"630"}, {"g3"}, {"7400"}, {"g4"}, + {"7450"}, {"g4+"}, {"750"}, {"8548"}, {"970"}, + {"g5"}, {"a2"}, {"a2q"}, {"e500"}, {"e500mc"}, + {"e5500"}, {"power3"}, {"pwr3"}, {"power4"}, {"pwr4"}, + {"power5"}, {"pwr5"}, {"power5x"}, {"pwr5x"}, {"power6"}, + {"pwr6"}, {"power6x"}, {"pwr6x"}, {"power7"}, {"pwr7"}, + {"power8"}, {"pwr8"}, {"power9"}, {"pwr9"}, {"powerpc"}, + {"ppc"}, {"powerpc64"}, {"ppc64"}, {"powerpc64le"}, {"ppc64le"}, }; bool PPCTargetInfo::isValidCPUName(StringRef Name) const { Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Jan 27 07:03:57 2020 (r357168) @@ -44,7 +44,8 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T ArchDefinePwr8 = 1 << 12, ArchDefinePwr9 = 1 << 13, ArchDefineA2 = 1 << 14, - ArchDefineA2q = 1 << 15 + ArchDefineA2q = 1 << 15, + ArchDefineE500 = 1 << 16 } ArchDefineTypes; @@ -85,8 +86,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T // Note: GCC recognizes the following additional cpus: // 401, 403, 405, 405fp, 440fp, 464, 464fp, 476, 476fp, 505, 740, 801, - // 821, 823, 8540, 8548, e300c2, e300c3, e500mc64, e6500, 860, cell, - // titan, rs64. + // 821, 823, 8540, e300c2, e300c3, e500mc64, e6500, 860, cell, titan, rs64. bool isValidCPUName(StringRef Name) const override; void fillValidCPUList(SmallVectorImpl &Values) const override; @@ -145,6 +145,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) + .Cases("8548", "e500", ArchDefineE500) .Default(ArchDefineNone); } return CPUKnown; Modified: stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp Mon Jan 27 07:03:57 2020 (r357168) @@ -52,10 +52,12 @@ std::string ppc::getPPCTargetCPU(const ArgList &Args) .Case("7450", "7450") .Case("G4+", "g4+") .Case("750", "750") + .Case("8548", "e500") .Case("970", "970") .Case("G5", "g5") .Case("a2", "a2") .Case("a2q", "a2q") + .Case("e500", "e500") .Case("e500mc", "e500mc") .Case("e5500", "e5500") .Case("power3", "pwr3") @@ -100,6 +102,9 @@ const char *ppc::getPPCAsmModeForCPU(StringRef Name) { void ppc::getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple, const ArgList &Args, std::vector &Features) { + if (Triple.getSubArch() == llvm::Triple::PPCSubArch_spe) + Features.push_back("+spe"); + handleTargetFeaturesGroup(Args, Features, options::OPT_m_ppc_Features_Group); ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args); Modified: stable/12/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h ============================================================================== --- stable/12/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h Mon Jan 27 07:03:57 2020 (r357168) @@ -128,7 +128,9 @@ class Triple { (public) KalimbaSubArch_v4, KalimbaSubArch_v5, - MipsSubArch_r6 + MipsSubArch_r6, + + PPCSubArch_spe }; enum VendorType { UnknownVendor, Modified: stable/12/contrib/llvm-project/llvm/lib/Support/Triple.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Support/Triple.cpp Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/llvm/lib/Support/Triple.cpp Mon Jan 27 07:03:57 2020 (r357168) @@ -389,7 +389,7 @@ static Triple::ArchType parseArch(StringRef ArchName) // FIXME: Do we need to support these? .Cases("i786", "i886", "i986", Triple::x86) .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64) - .Cases("powerpc", "ppc", "ppc32", Triple::ppc) + .Cases("powerpc", "powerpcspe", "ppc", "ppc32", Triple::ppc) .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64) .Cases("powerpc64le", "ppc64le", Triple::ppc64le) .Case("xscale", Triple::arm) @@ -562,6 +562,9 @@ static Triple::SubArchType parseSubArch(StringRef SubA if (SubArchName.startswith("mips") && (SubArchName.endswith("r6el") || SubArchName.endswith("r6"))) return Triple::MipsSubArch_r6; + + if (SubArchName == "powerpcspe") + return Triple::PPCSubArch_spe; StringRef ARMSubArch = ARM::getCanonicalArchName(SubArchName); Modified: stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td Mon Jan 27 07:03:57 2020 (r357168) @@ -378,7 +378,7 @@ def : ProcessorModel<"g5", G5Model, def : ProcessorModel<"e500", PPCE500Model, [DirectiveE500, FeatureICBT, FeatureBookE, - FeatureISEL, FeatureMFTB]>; + FeatureISEL, FeatureMFTB, FeatureSPE]>; def : ProcessorModel<"e500mc", PPCE500mcModel, [DirectiveE500mc, FeatureSTFIWX, FeatureICBT, FeatureBookE, Modified: stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Mon Jan 27 07:02:52 2020 (r357167) +++ stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Mon Jan 27 07:03:57 2020 (r357168) @@ -126,6 +126,8 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU // If cross-compiling with -march=ppc64le without -mcpu if (TargetTriple.getArch() == Triple::ppc64le) CPUName = "ppc64le"; + else if (TargetTriple.getSubArch() == Triple::PPCSubArch_spe) + CPUName = "e500"; else CPUName = "generic"; } From owner-svn-src-all@freebsd.org Mon Jan 27 12:02:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 441D51F4838; Mon, 27 Jan 2020 12:02:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485pKH0x5Xz4JXd; Mon, 27 Jan 2020 12:02:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4269A98; Mon, 27 Jan 2020 12:02:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RC2gkW082571; Mon, 27 Jan 2020 12:02:42 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RC2gcv082566; Mon, 27 Jan 2020 12:02:42 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202001271202.00RC2gcv082566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 27 Jan 2020 12:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357169 - in head: sbin/newfs_msdos sys/fs/msdosfs tools/build usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: sbin/newfs_msdos sys/fs/msdosfs tools/build usr.sbin/makefs/msdos X-SVN-Commit-Revision: 357169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 12:02:43 -0000 Author: arichardson Date: Mon Jan 27 12:02:41 2020 New Revision: 357169 URL: https://svnweb.freebsd.org/changeset/base/357169 Log: Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOS In order to do so we need to install the msdosfs headers to the bootstrap sysroot and avoid includes of kernel headers that may not exist on every host (e.g. sys/lockmgr.h). This change should allow bootstrapping of makefs on FreeBSD 11+ as well as Linux and macOS. We also have to avoid using the IO_SYNC macro since that may not be available. In makefs it is only used to switch between calling bwrite() and bdwrite() which both call the same function. Therefore we can simply always call bwrite(). For our CheriBSD builds we always bootstrap makefs by setting LOCAL_XTOOL_DIRS='lib/libnetbsd usr.sbin/makefs' and use the makefs binary from the build tree to create a bootable disk image. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D23201 Modified: head/sbin/newfs_msdos/mkfs_msdos.c head/sys/fs/msdosfs/msdosfsmount.h head/tools/build/Makefile head/usr.sbin/makefs/msdos/msdosfs_denode.c head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Mon Jan 27 07:03:57 2020 (r357168) +++ head/sbin/newfs_msdos/mkfs_msdos.c Mon Jan 27 12:02:41 2020 (r357169) @@ -31,10 +31,15 @@ static const char rcsid[] = #endif /* not lint */ #include +#ifdef MAKEFS +/* In the makefs case we only want struct disklabel */ +#include +#else #include #include #include #include +#endif #include #include @@ -285,14 +290,18 @@ mkfs_msdos(const char *fname, const char *dtype, const if (!S_ISREG(sb.st_mode)) warnx("warning, %s is not a regular file", fname); } else { -#ifndef MAKEFS +#ifdef MAKEFS + errx(1, "o.create_size must be set!"); +#else if (!S_ISCHR(sb.st_mode)) warnx("warning, %s is not a character device", fname); #endif } +#ifndef MAKEFS if (!o.no_create) if (check_mounted(fname, sb.st_mode) == -1) goto done; +#endif if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) { warnx("cannot seek to %jd", (intmax_t)o.offset); goto done; @@ -621,10 +630,12 @@ mkfs_msdos(const char *fname, const char *dtype, const bpb.bpbBigFATsecs) * bpb.bpbFATs; memset(&si_sa, 0, sizeof(si_sa)); si_sa.sa_handler = infohandler; +#ifdef SIGINFO if (sigaction(SIGINFO, &si_sa, NULL) == -1) { warn("sigaction SIGINFO"); goto done; } +#endif for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) { if (got_siginfo) { fprintf(stderr,"%s: writing sector %u of %u (%u%%)\n", @@ -766,6 +777,11 @@ done: static int check_mounted(const char *fname, mode_t mode) { +/* + * If getmntinfo() is not available (e.g. Linux) don't check. This should + * not be a problem since we will only be using makefs to create images. + */ +#if !defined(MAKEFS) struct statfs *mp; const char *s1, *s2; size_t len; @@ -790,6 +806,7 @@ check_mounted(const char *fname, mode_t mode) return -1; } } +#endif return 0; } @@ -811,6 +828,23 @@ getstdfmt(const char *fmt, struct bpb *bpb) return 0; } +static void +compute_geometry_from_file(int fd, const char *fname, struct disklabel *lp) +{ + struct stat st; + off_t ms; + + if (fstat(fd, &st)) + err(1, "cannot get disk size"); + if (!S_ISREG(st.st_mode)) + errx(1, "%s is not a regular file", fname); + ms = st.st_size; + lp->d_secsize = 512; + lp->d_nsectors = 63; + lp->d_ntracks = 255; + lp->d_secperunit = ms / lp->d_secsize; +} + /* * Get disk slice, partition, and geometry information. */ @@ -819,8 +853,10 @@ getdiskinfo(int fd, const char *fname, const char *dty struct bpb *bpb) { struct disklabel *lp, dlp; + off_t hs = 0; +#ifndef MAKEFS + off_t ms; struct fd_type type; - off_t ms, hs = 0; lp = NULL; @@ -832,16 +868,8 @@ getdiskinfo(int fd, const char *fname, const char *dty /* Maybe it's a floppy drive */ if (lp == NULL) { if (ioctl(fd, DIOCGMEDIASIZE, &ms) == -1) { - struct stat st; - - if (fstat(fd, &st)) - err(1, "cannot get disk size"); /* create a fake geometry for a file image */ - ms = st.st_size; - dlp.d_secsize = 512; - dlp.d_nsectors = 63; - dlp.d_ntracks = 255; - dlp.d_secperunit = ms / dlp.d_secsize; + compute_geometry_from_file(fd, fname, &dlp); lp = &dlp; } else if (ioctl(fd, FD_GTYPE, &type) != -1) { dlp.d_secsize = 128 << type.secsize; @@ -881,6 +909,11 @@ getdiskinfo(int fd, const char *fname, const char *dty hs = (ms / dlp.d_secsize) - dlp.d_secperunit; lp = &dlp; } +#else + /* In the makefs case we only support image files: */ + compute_geometry_from_file(fd, fname, &dlp); + lp = &dlp; +#endif if (bpb->bpbBytesPerSec == 0) { if (ckgeom(fname, lp->d_secsize, "bytes/sector") == -1) Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Mon Jan 27 07:03:57 2020 (r357168) +++ head/sys/fs/msdosfs/msdosfsmount.h Mon Jan 27 12:02:41 2020 (r357169) @@ -56,8 +56,10 @@ #if defined (_KERNEL) || defined(MAKEFS) #include +#ifndef MAKEFS #include #include +#endif #include #ifdef MALLOC_DECLARE @@ -110,7 +112,9 @@ struct msdosfsmount { void *pm_w2u; /* Unicode->Local iconv handle */ void *pm_u2d; /* Unicode->DOS iconv handle */ void *pm_d2u; /* DOS->Local iconv handle */ +#ifndef MAKEFS struct lock pm_fatlock; /* lockmgr protecting allocations */ +#endif }; /* Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Jan 27 07:03:57 2020 (r357168) +++ head/tools/build/Makefile Mon Jan 27 12:02:41 2020 (r357169) @@ -4,11 +4,16 @@ LIB= egacy SRC= -INCSGROUPS= INCS SYSINCS CASPERINC +INCSGROUPS= INCS SYSINCS CASPERINC UFSINCS FFSINCS MSDOSFSINCS DISKINCS INCS= SYSINCSDIR= ${INCLUDEDIR}/sys CASPERINCDIR= ${INCLUDEDIR}/casper +# Also add ufs/ffs/msdosfs/disk headers to allow building makefs as a bootstrap tool +UFSINCSDIR= ${INCLUDEDIR}/ufs/ufs +FFSINCSDIR= ${INCLUDEDIR}/ufs/ffs +MSDOSFSINCSDIR= ${INCLUDEDIR}/fs/msdosfs +DISKINCSDIR= ${INCLUDEDIR}/sys/disk BOOTSTRAPPING?= 0 @@ -69,6 +74,19 @@ SRCS= dummy.c .if defined(CROSS_BUILD_TESTING) SUBDIR= cross-build .endif + +# To allow bootstrapping makefs on FreeBSD 11 or non-FreeBSD systems: +UFSINCS+= ${SRCTOP}/sys/ufs/ufs/dinode.h +UFSINCS+= ${SRCTOP}/sys/ufs/ufs/dir.h +FFSINCS+= ${SRCTOP}/sys/ufs/ffs/fs.h + +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/bootsect.h +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/bpb.h +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/denode.h +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/direntry.h +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/fat.h +MSDOSFSINCS+= ${SRCTOP}/sys/fs/msdosfs/msdosfsmount.h +DISKINCS+= ${SRCTOP}/sys/sys/disk/bsd.h # Needed to build config (since it uses libnv) SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \ Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Mon Jan 27 07:03:57 2020 (r357168) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Mon Jan 27 12:02:41 2020 (r357169) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -288,10 +287,7 @@ detrunc(struct denode *dep, u_long length, int flags, return (error); } memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); - if (flags & IO_SYNC) bwrite(bp); - else - bdwrite(bp); } } Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Jan 27 07:03:57 2020 (r357168) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Jan 27 12:02:41 2020 (r357169) @@ -103,7 +103,11 @@ msdosfs_times(struct denode *dep, const struct stat *s if (stampst.st_ino) st = &stampst; +#ifdef HAVE_STRUCT_STAT_BIRTHTIME unix2fattime(&st->st_birthtim, &dep->de_CDate, &dep->de_CTime); +#else + unix2fattime(&st->st_ctim, &dep->de_CDate, &dep->de_CTime); +#endif unix2fattime(&st->st_atim, &dep->de_ADate, NULL); unix2fattime(&st->st_mtim, &dep->de_MDate, &dep->de_MTime); } From owner-svn-src-all@freebsd.org Mon Jan 27 12:02:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A3D1F485F; Mon, 27 Jan 2020 12:02:48 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485pKM6vdDz4JbC; Mon, 27 Jan 2020 12:02:47 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4C999A99; Mon, 27 Jan 2020 12:02:47 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RC2l0w082625; Mon, 27 Jan 2020 12:02:47 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RC2lee082624; Mon, 27 Jan 2020 12:02:47 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202001271202.00RC2lee082624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 27 Jan 2020 12:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357170 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 357170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 12:02:48 -0000 Author: arichardson Date: Mon Jan 27 12:02:47 2020 New Revision: 357170 URL: https://svnweb.freebsd.org/changeset/base/357170 Log: Build hard-float lib32 for mips64hf/mips64elhf This should fix linker errors when building with clang+lld. After this change the lib32 compat libraries are now buildt with -mhard-float instead of -msoft-float Reviewed By: brooks, jhb Differential Revision: https://reviews.freebsd.org/D23229 Modified: head/share/mk/bsd.compat.mk Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Mon Jan 27 12:02:41 2020 (r357169) +++ head/share/mk/bsd.compat.mk Mon Jan 27 12:02:47 2020 (r357170) @@ -79,11 +79,10 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -mabi=32 LIB32_MACHINE= mips +LIB32_MACHINE_ARCH:= ${COMPAT_ARCH:S/64//} .if ${COMPAT_ARCH:Mmips64el*} != "" -LIB32_MACHINE_ARCH= mipsel _EMULATION= elf32ltsmip_fbsd .else -LIB32_MACHINE_ARCH= mips _EMULATION= elf32btsmip_fbsd .endif LIB32WMAKEFLAGS= LD="${XLD} -m ${_EMULATION}" From owner-svn-src-all@freebsd.org Mon Jan 27 13:12:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71BAF1F6125; Mon, 27 Jan 2020 13:12: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 485qt12Plmz4Mcg; Mon, 27 Jan 2020 13:12:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D171A760; Mon, 27 Jan 2020 13:12:41 +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 00RDCfuG027398; Mon, 27 Jan 2020 13:12:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RDCfk1027397; Mon, 27 Jan 2020 13:12:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001271312.00RDCfk1027397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Jan 2020 13:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357171 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 357171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 13:12:41 -0000 Author: kib Date: Mon Jan 27 13:12:40 2020 New Revision: 357171 URL: https://svnweb.freebsd.org/changeset/base/357171 Log: MFC r356919,r357054: x86: Wait for curpcb to be set up as an indicator that the boot stack is no longer used. Modified: stable/12/sys/x86/x86/mp_x86.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/mp_x86.c ============================================================================== --- stable/12/sys/x86/x86/mp_x86.c Mon Jan 27 12:02:47 2020 (r357170) +++ stable/12/sys/x86/x86/mp_x86.c Mon Jan 27 13:12:40 2020 (r357171) @@ -1074,6 +1074,11 @@ init_secondary_tail(void) cpu_initclocks_ap(); #endif + /* + * Assert that smp_after_idle_runnable condition is reasonable. + */ + MPASS(PCPU_GET(curpcb) == NULL); + sched_throw(NULL); panic("scheduler returned us to %s", __func__); @@ -1083,13 +1088,12 @@ init_secondary_tail(void) static void smp_after_idle_runnable(void *arg __unused) { - struct thread *idle_td; + struct pcpu *pc; int cpu; for (cpu = 1; cpu < mp_ncpus; cpu++) { - idle_td = pcpu_find(cpu)->pc_idlethread; - while (idle_td->td_lastcpu == NOCPU && - idle_td->td_oncpu == NOCPU) + pc = pcpu_find(cpu); + while (atomic_load_ptr(&pc->pc_curpcb) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); From owner-svn-src-all@freebsd.org Mon Jan 27 13:15:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F3DA1F6207; Mon, 27 Jan 2020 13:15:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485qx06hxVz4Mmk; Mon, 27 Jan 2020 13:15:16 +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 E12E9A787; Mon, 27 Jan 2020 13:15:16 +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 00RDFGP5027850; Mon, 27 Jan 2020 13:15:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RDFGcZ027848; Mon, 27 Jan 2020 13:15:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001271315.00RDFGcZ027848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Jan 2020 13:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357172 - in head/sys/geom: . stripe X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/geom: . stripe X-SVN-Commit-Revision: 357172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 13:15:17 -0000 Author: kib Date: Mon Jan 27 13:15:16 2020 New Revision: 357172 URL: https://svnweb.freebsd.org/changeset/base/357172 Log: Fix aggregating geoms for BIO_SPEEDUP. If the bio was split into several bios going down, completion computes bio_completed of the original bio as sum of the bio_completes of the splits. For BIO_SETUP, bio_length means something different than the length. it is the requested speedup amount, and is duplicated into the splits, which is in fact reasonable, since we cannot know how the previous activity was distributed among subordinate geoms. Obviously, the sum of n bio_length is greater than bio_length for n > 1, which triggers assert that bio_length >= bio_completed for e.g. geom_stripe and geom_raid3. Fix this by reassigning bio_completed from bio_length for completed BIO_SPEEDED, I do not think it really mattters what we return in bio_completed. Reported and tested by: pho Reviewed by: imp MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23380 Modified: head/sys/geom/geom_subr.c head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Jan 27 13:12:40 2020 (r357171) +++ head/sys/geom/geom_subr.c Mon Jan 27 13:15:16 2020 (r357172) @@ -1134,8 +1134,11 @@ g_std_done(struct bio *bp) bp2->bio_completed += bp->bio_completed; g_destroy_bio(bp); bp2->bio_inbed++; - if (bp2->bio_children == bp2->bio_inbed) + if (bp2->bio_children == bp2->bio_inbed) { + if (bp2->bio_cmd == BIO_SPEEDUP) + bp2->bio_completed = bp2->bio_length; g_io_deliver(bp2, bp2->bio_error); + } } /* XXX: maybe this is only g_slice_spoiled */ Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Mon Jan 27 13:12:40 2020 (r357171) +++ head/sys/geom/stripe/g_stripe.c Mon Jan 27 13:15:16 2020 (r357172) @@ -298,6 +298,8 @@ g_stripe_done(struct bio *bp) mtx_unlock(&sc->sc_lock); if (pbp->bio_driver1 != NULL) uma_zfree(g_stripe_zone, pbp->bio_driver1); + if (bp->bio_cmd == BIO_SPEEDUP) + pbp->bio_completed = pbp->bio_length; g_io_deliver(pbp, pbp->bio_error); } else mtx_unlock(&sc->sc_lock); From owner-svn-src-all@freebsd.org Mon Jan 27 15:09:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8796E1F8A66; Mon, 27 Jan 2020 15:09:14 +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 485tSV3qSvz4SyQ; Mon, 27 Jan 2020 15:09:14 +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 64356BE03; Mon, 27 Jan 2020 15:09:14 +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 00RF9ER9098042; Mon, 27 Jan 2020 15:09:14 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RF9DsQ098039; Mon, 27 Jan 2020 15:09:13 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202001271509.00RF9DsQ098039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Mon, 27 Jan 2020 15:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357173 - in head/sys: sys x86/iommu X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: sys x86/iommu X-SVN-Commit-Revision: 357173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 15:09:14 -0000 Author: dougm Date: Mon Jan 27 15:09:13 2020 New Revision: 357173 URL: https://svnweb.freebsd.org/changeset/base/357173 Log: Correct the use of RB_AUGMENT in the RB_TREE macros so that is invoked at the root of every subtree that changes in an insert or delete, and only once, and ordered from the bottom of the tree to the top. For intel_gas.c, the only user of RB_AUGMENT I can find, change the augmenting routine so that it does not climb from entry to tree root on every call, and remove a 'tree correcting' function that can be supplanted by proper tree augmentation. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D23189 Modified: head/sys/sys/tree.h head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_gas.c Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Mon Jan 27 13:15:16 2020 (r357172) +++ head/sys/sys/tree.h Mon Jan 27 15:09:13 2020 (r357173) @@ -335,8 +335,12 @@ struct { \ RB_COLOR(red, field) = RB_RED; \ } while (/*CONSTCOND*/ 0) +/* + * Something to be invoked in a loop at the root of every modified subtree, + * from the bottom up to the root, to update augmented node data. + */ #ifndef RB_AUGMENT -#define RB_AUGMENT(x) do {} while (0) +#define RB_AUGMENT(x) break #endif #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ @@ -344,7 +348,6 @@ struct { \ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ } \ - RB_AUGMENT(elm); \ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ @@ -354,9 +357,7 @@ struct { \ (head)->rbh_root = (tmp); \ RB_LEFT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ + RB_AUGMENT(elm); \ } while (/*CONSTCOND*/ 0) #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ @@ -364,7 +365,6 @@ struct { \ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ } \ - RB_AUGMENT(elm); \ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ @@ -374,9 +374,7 @@ struct { \ (head)->rbh_root = (tmp); \ RB_RIGHT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp, field))) \ - RB_AUGMENT(RB_PARENT(tmp, field)); \ + RB_AUGMENT(elm); \ } while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ @@ -571,62 +569,49 @@ name##_RB_REMOVE(struct name *head, struct type *elm) else if (RB_RIGHT(elm, field) == NULL) \ child = RB_LEFT(elm, field); \ else { \ - struct type *left; \ - elm = RB_RIGHT(elm, field); \ - while ((left = RB_LEFT(elm, field)) != NULL) \ - elm = left; \ - child = RB_RIGHT(elm, field); \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child) \ - RB_PARENT(child, field) = parent; \ - if (parent) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ + elm = RB_RIGHT(old, field); \ + if ((child = RB_LEFT(elm, field)) == NULL) { \ + child = RB_RIGHT(elm, field); \ + RB_RIGHT(old, field) = child; \ + RB_PARENT(elm, field) = elm; \ + } else { \ + do \ + elm = child; \ + while ((child = RB_LEFT(elm, field)) != NULL); \ + child = RB_RIGHT(elm, field); \ + RB_PARENT(RB_RIGHT(old, field), field) = elm; \ + } \ + RB_PARENT(RB_LEFT(old, field), field) = elm; \ + parent = RB_PARENT(old, field); \ + if (parent != NULL) { \ + if (RB_LEFT(parent, field) == old) \ + RB_LEFT(parent, field) = elm; \ else \ - RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ + RB_RIGHT(parent, field) = elm; \ } else \ - RB_ROOT(head) = child; \ - if (RB_PARENT(elm, field) == old) \ - parent = elm; \ - (elm)->field = (old)->field; \ - if (RB_PARENT(old, field)) { \ - if (RB_LEFT(RB_PARENT(old, field), field) == old)\ - RB_LEFT(RB_PARENT(old, field), field) = elm;\ - else \ - RB_RIGHT(RB_PARENT(old, field), field) = elm;\ - RB_AUGMENT(RB_PARENT(old, field)); \ - } else \ RB_ROOT(head) = elm; \ - RB_PARENT(RB_LEFT(old, field), field) = elm; \ - if (RB_RIGHT(old, field)) \ - RB_PARENT(RB_RIGHT(old, field), field) = elm; \ - if (parent) { \ - left = parent; \ - do { \ - RB_AUGMENT(left); \ - } while ((left = RB_PARENT(left, field)) != NULL); \ - } \ - goto color; \ } \ parent = RB_PARENT(elm, field); \ color = RB_COLOR(elm, field); \ - if (child) \ + if (child != NULL) \ RB_PARENT(child, field) = parent; \ - if (parent) { \ + if (parent != NULL) { \ if (RB_LEFT(parent, field) == elm) \ RB_LEFT(parent, field) = child; \ else \ RB_RIGHT(parent, field) = child; \ - RB_AUGMENT(parent); \ } else \ RB_ROOT(head) = child; \ -color: \ + if (elm != old) \ + (elm)->field = (old)->field; \ if (color == RB_BLACK) \ name##_RB_REMOVE_COLOR(head, parent, child); \ + while (parent != NULL) { \ + RB_AUGMENT(parent); \ + parent = RB_PARENT(parent, field); \ + } \ return (old); \ -} \ +} #define RB_GENERATE_INSERT(name, type, field, cmp, attr) \ /* Inserts a node into the RB tree */ \ @@ -653,10 +638,13 @@ name##_RB_INSERT(struct name *head, struct type *elm) RB_LEFT(parent, field) = elm; \ else \ RB_RIGHT(parent, field) = elm; \ - RB_AUGMENT(parent); \ } else \ RB_ROOT(head) = elm; \ name##_RB_INSERT_COLOR(head, elm); \ + while (elm != NULL) { \ + RB_AUGMENT(elm); \ + elm = RB_PARENT(elm, field); \ + } \ return (NULL); \ } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Mon Jan 27 13:15:16 2020 (r357172) +++ head/sys/x86/iommu/intel_dmar.h Mon Jan 27 15:09:13 2020 (r357173) @@ -47,7 +47,8 @@ struct dmar_qi_genseq { struct dmar_map_entry { dmar_gaddr_t start; dmar_gaddr_t end; - dmar_gaddr_t free_after; /* Free space after the entry */ + dmar_gaddr_t first; /* Least start in subtree */ + dmar_gaddr_t last; /* Greatest end in subtree */ dmar_gaddr_t free_down; /* Max free space below the current R/B tree node */ u_int flags; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Mon Jan 27 13:15:16 2020 (r357172) +++ head/sys/x86/iommu/intel_drv.c Mon Jan 27 15:09:13 2020 (r357173) @@ -1112,9 +1112,9 @@ dmar_print_domain_entry(const struct dmar_map_entry *e struct dmar_map_entry *l, *r; db_printf( - " start %jx end %jx free_after %jx free_down %jx flags %x ", - entry->start, entry->end, entry->free_after, entry->free_down, - entry->flags); + " start %jx end %jx first %jx last %jx free_down %jx flags %x ", + entry->start, entry->end, entry->first, entry->last, + entry->free_down, entry->flags); db_printf("left "); l = RB_LEFT(entry, rb_entry); if (l == NULL) Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Mon Jan 27 13:15:16 2020 (r357172) +++ head/sys/x86/iommu/intel_gas.c Mon Jan 27 15:09:13 2020 (r357173) @@ -139,71 +139,52 @@ dmar_gas_cmp_entries(struct dmar_map_entry *a, struct static void dmar_gas_augment_entry(struct dmar_map_entry *entry) { - struct dmar_map_entry *l, *r; + struct dmar_map_entry *child; + dmar_gaddr_t free_down; - for (; entry != NULL; entry = RB_PARENT(entry, rb_entry)) { - l = RB_LEFT(entry, rb_entry); - r = RB_RIGHT(entry, rb_entry); - if (l == NULL && r == NULL) { - entry->free_down = entry->free_after; - } else if (l == NULL && r != NULL) { - entry->free_down = MAX(entry->free_after, r->free_down); - } else if (/*l != NULL && */ r == NULL) { - entry->free_down = MAX(entry->free_after, l->free_down); - } else /* if (l != NULL && r != NULL) */ { - entry->free_down = MAX(entry->free_after, l->free_down); - entry->free_down = MAX(entry->free_down, r->free_down); - } - } + free_down = 0; + if ((child = RB_LEFT(entry, rb_entry)) != NULL) { + free_down = MAX(free_down, child->free_down); + free_down = MAX(free_down, entry->start - child->last); + entry->first = child->first; + } else + entry->first = entry->start; + + if ((child = RB_RIGHT(entry, rb_entry)) != NULL) { + free_down = MAX(free_down, child->free_down); + free_down = MAX(free_down, child->first - entry->end); + entry->last = child->last; + } else + entry->last = entry->end; + entry->free_down = free_down; } RB_GENERATE(dmar_gas_entries_tree, dmar_map_entry, rb_entry, dmar_gas_cmp_entries); -static void -dmar_gas_fix_free(struct dmar_domain *domain, struct dmar_map_entry *entry) -{ - struct dmar_map_entry *next; - - next = RB_NEXT(dmar_gas_entries_tree, &domain->rb_root, entry); - entry->free_after = (next != NULL ? next->start : domain->end) - - entry->end; - dmar_gas_augment_entry(entry); -} - #ifdef INVARIANTS static void dmar_gas_check_free(struct dmar_domain *domain) { - struct dmar_map_entry *entry, *next, *l, *r; + struct dmar_map_entry *entry, *l, *r; dmar_gaddr_t v; RB_FOREACH(entry, dmar_gas_entries_tree, &domain->rb_root) { KASSERT(domain == entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); - next = RB_NEXT(dmar_gas_entries_tree, &domain->rb_root, entry); - if (next == NULL) { - MPASS(entry->free_after == domain->end - entry->end); - } else { - MPASS(entry->free_after = next->start - entry->end); - MPASS(entry->end <= next->start); - } l = RB_LEFT(entry, rb_entry); r = RB_RIGHT(entry, rb_entry); - if (l == NULL && r == NULL) { - MPASS(entry->free_down == entry->free_after); - } else if (l == NULL && r != NULL) { - MPASS(entry->free_down = MAX(entry->free_after, - r->free_down)); - } else if (r == NULL) { - MPASS(entry->free_down = MAX(entry->free_after, - l->free_down)); - } else { - v = MAX(entry->free_after, l->free_down); + v = 0; + if (l != NULL) { + v = MAX(v, l->free_down); + v = MAX(v, entry->start - l->last); + } + if (r != NULL) { v = MAX(v, r->free_down); - MPASS(entry->free_down == v); + v = MAX(v, r->first - entry->end); } + MPASS(entry->free_down == v); } } #endif @@ -211,25 +192,17 @@ dmar_gas_check_free(struct dmar_domain *domain) static bool dmar_gas_rb_insert(struct dmar_domain *domain, struct dmar_map_entry *entry) { - struct dmar_map_entry *prev, *found; + struct dmar_map_entry *found; found = RB_INSERT(dmar_gas_entries_tree, &domain->rb_root, entry); - dmar_gas_fix_free(domain, entry); - prev = RB_PREV(dmar_gas_entries_tree, &domain->rb_root, entry); - if (prev != NULL) - dmar_gas_fix_free(domain, prev); return (found == NULL); } static void dmar_gas_rb_remove(struct dmar_domain *domain, struct dmar_map_entry *entry) { - struct dmar_map_entry *prev; - prev = RB_PREV(dmar_gas_entries_tree, &domain->rb_root, entry); RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); - if (prev != NULL) - dmar_gas_fix_free(domain, prev); } void @@ -246,13 +219,11 @@ dmar_gas_init_domain(struct dmar_domain *domain) begin->start = 0; begin->end = DMAR_PAGE_SIZE; - begin->free_after = domain->end - begin->end; begin->flags = DMAR_MAP_ENTRY_PLACE | DMAR_MAP_ENTRY_UNMAPPED; dmar_gas_rb_insert(domain, begin); end->start = domain->end; end->end = domain->end; - end->free_after = 0; end->flags = DMAR_MAP_ENTRY_PLACE | DMAR_MAP_ENTRY_UNMAPPED; dmar_gas_rb_insert(domain, end); @@ -281,7 +252,6 @@ dmar_gas_fini_domain(struct dmar_domain *domain) entry = RB_MAX(dmar_gas_entries_tree, &domain->rb_root); KASSERT(entry->start == domain->end, ("end entry start %p", domain)); KASSERT(entry->end == domain->end, ("end entry end %p", domain)); - KASSERT(entry->free_after == 0, ("end entry free_after %p", domain)); KASSERT(entry->flags == DMAR_MAP_ENTRY_PLACE, ("end entry flags %p", domain)); RB_REMOVE(dmar_gas_entries_tree, &domain->rb_root, entry); @@ -305,19 +275,26 @@ struct dmar_gas_match_args { struct dmar_map_entry *entry; }; +/* + * The interval [beg, end) is a free interval between two dmar_map_entries. + * maxaddr is an upper bound on addresses that can be allocated. Try to + * allocate space in the free interval, subject to the conditions expressed + * by a, and return 'true' if and only if the allocation attempt succeeds. + */ static bool -dmar_gas_match_one(struct dmar_gas_match_args *a, struct dmar_map_entry *prev, - dmar_gaddr_t end) +dmar_gas_match_one(struct dmar_gas_match_args *a, dmar_gaddr_t beg, + dmar_gaddr_t end, dmar_gaddr_t maxaddr) { dmar_gaddr_t bs, start; - if (a->entry->start + a->size > end) + a->entry->start = roundup2(beg + DMAR_PAGE_SIZE, + a->common->alignment); + if (a->entry->start + a->size > maxaddr) return (false); /* DMAR_PAGE_SIZE to create gap after new entry. */ - if (a->entry->start < prev->end + DMAR_PAGE_SIZE || - a->entry->start + a->size + a->offset + DMAR_PAGE_SIZE > - prev->end + prev->free_after) + if (a->entry->start < beg + DMAR_PAGE_SIZE || + a->entry->start + a->size + a->offset + DMAR_PAGE_SIZE > end) return (false); /* No boundary crossing. */ @@ -328,15 +305,14 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, stru /* * The start + offset to start + offset + size region crosses * the boundary. Check if there is enough space after the - * next boundary after the prev->end. + * next boundary after the beg. */ bs = rounddown2(a->entry->start + a->offset + a->common->boundary, a->common->boundary); start = roundup2(bs, a->common->alignment); /* DMAR_PAGE_SIZE to create gap after new entry. */ - if (start + a->offset + a->size + DMAR_PAGE_SIZE <= - prev->end + prev->free_after && - start + a->offset + a->size <= end && + if (start + a->offset + a->size + DMAR_PAGE_SIZE <= end && + start + a->offset + a->size <= maxaddr && dmar_test_boundary(start + a->offset, a->size, a->common->boundary)) { a->entry->start = start; @@ -346,7 +322,7 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, stru /* * Not enough space to align at the requested boundary, or * boundary is smaller than the size, but allowed to split. - * We already checked that start + size does not overlap end. + * We already checked that start + size does not overlap maxaddr. * * XXXKIB. It is possible that bs is exactly at the start of * the next entry, then we do not have gap. Ignore for now. @@ -360,10 +336,8 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, stru } static void -dmar_gas_match_insert(struct dmar_gas_match_args *a, - struct dmar_map_entry *prev) +dmar_gas_match_insert(struct dmar_gas_match_args *a) { - struct dmar_map_entry *next; bool found; /* @@ -376,102 +350,67 @@ dmar_gas_match_insert(struct dmar_gas_match_args *a, */ a->entry->end = a->entry->start + a->size; - next = RB_NEXT(dmar_gas_entries_tree, &a->domain->rb_root, prev); - KASSERT(next->start >= a->entry->end && - next->start - a->entry->start >= a->size && - prev->end <= a->entry->end, - ("dmar_gas_match_insert hole failed %p prev (%jx, %jx) " - "free_after %jx next (%jx, %jx) entry (%jx, %jx)", a->domain, - (uintmax_t)prev->start, (uintmax_t)prev->end, - (uintmax_t)prev->free_after, - (uintmax_t)next->start, (uintmax_t)next->end, - (uintmax_t)a->entry->start, (uintmax_t)a->entry->end)); - - prev->free_after = a->entry->start - prev->end; - a->entry->free_after = next->start - a->entry->end; - found = dmar_gas_rb_insert(a->domain, a->entry); KASSERT(found, ("found dup %p start %jx size %jx", a->domain, (uintmax_t)a->entry->start, (uintmax_t)a->size)); a->entry->flags = DMAR_MAP_ENTRY_MAP; - - KASSERT(RB_PREV(dmar_gas_entries_tree, &a->domain->rb_root, - a->entry) == prev, - ("entry %p prev %p inserted prev %p", a->entry, prev, - RB_PREV(dmar_gas_entries_tree, &a->domain->rb_root, a->entry))); - KASSERT(RB_NEXT(dmar_gas_entries_tree, &a->domain->rb_root, - a->entry) == next, - ("entry %p next %p inserted next %p", a->entry, next, - RB_NEXT(dmar_gas_entries_tree, &a->domain->rb_root, a->entry))); } static int -dmar_gas_lowermatch(struct dmar_gas_match_args *a, struct dmar_map_entry *prev) +dmar_gas_lowermatch(struct dmar_gas_match_args *a, struct dmar_map_entry *entry) { - struct dmar_map_entry *l; - int ret; + struct dmar_map_entry *child; - if (prev->end < a->common->lowaddr) { - a->entry->start = roundup2(prev->end + DMAR_PAGE_SIZE, - a->common->alignment); - if (dmar_gas_match_one(a, prev, a->common->lowaddr)) { - dmar_gas_match_insert(a, prev); - return (0); - } + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && entry->end < a->common->lowaddr && + dmar_gas_match_one(a, entry->end, child->first, + a->common->lowaddr)) { + dmar_gas_match_insert(a); + return (0); } - if (prev->free_down < a->size + a->offset + DMAR_PAGE_SIZE) + if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE) return (ENOMEM); - l = RB_LEFT(prev, rb_entry); - if (l != NULL) { - ret = dmar_gas_lowermatch(a, l); - if (ret == 0) - return (0); + child = RB_LEFT(entry, rb_entry); + if (child != NULL && 0 == dmar_gas_lowermatch(a, child)) + return (0); + if (child != NULL && child->last < a->common->lowaddr && + dmar_gas_match_one(a, child->last, entry->start, + a->common->lowaddr)) { + dmar_gas_match_insert(a); + return (0); } - l = RB_RIGHT(prev, rb_entry); - if (l != NULL) - return (dmar_gas_lowermatch(a, l)); + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && 0 == dmar_gas_lowermatch(a, child)) + return (0); return (ENOMEM); } static int -dmar_gas_uppermatch(struct dmar_gas_match_args *a) +dmar_gas_uppermatch(struct dmar_gas_match_args *a, struct dmar_map_entry *entry) { - struct dmar_map_entry *next, *prev, find_entry; + struct dmar_map_entry *child; - find_entry.start = a->common->highaddr; - next = RB_NFIND(dmar_gas_entries_tree, &a->domain->rb_root, - &find_entry); - if (next == NULL) + if (entry->last < a->common->highaddr) return (ENOMEM); - prev = RB_PREV(dmar_gas_entries_tree, &a->domain->rb_root, next); - KASSERT(prev != NULL, ("no prev %p %jx", a->domain, - (uintmax_t)find_entry.start)); - for (;;) { - a->entry->start = prev->start + DMAR_PAGE_SIZE; - if (a->entry->start < a->common->highaddr) - a->entry->start = a->common->highaddr; - a->entry->start = roundup2(a->entry->start, - a->common->alignment); - if (dmar_gas_match_one(a, prev, a->domain->end)) { - dmar_gas_match_insert(a, prev); - return (0); - } - - /* - * XXXKIB. This falls back to linear iteration over - * the free space in the high region. But high - * regions are almost unused, the code should be - * enough to cover the case, although in the - * non-optimal way. - */ - prev = next; - next = RB_NEXT(dmar_gas_entries_tree, &a->domain->rb_root, - prev); - KASSERT(next != NULL, ("no next %p %jx", a->domain, - (uintmax_t)find_entry.start)); - if (next->end >= a->domain->end) - return (ENOMEM); + child = RB_LEFT(entry, rb_entry); + if (child != NULL && 0 == dmar_gas_uppermatch(a, child)) + return (0); + if (child != NULL && child->last >= a->common->highaddr && + dmar_gas_match_one(a, child->last, entry->start, + a->domain->end)) { + dmar_gas_match_insert(a); + return (0); } + child = RB_RIGHT(entry, rb_entry); + if (child != NULL && entry->end >= a->common->highaddr && + dmar_gas_match_one(a, entry->end, child->first, + a->domain->end)) { + dmar_gas_match_insert(a); + return (0); + } + if (child != NULL && 0 == dmar_gas_uppermatch(a, child)) + return (0); + return (ENOMEM); } static int @@ -504,7 +443,7 @@ dmar_gas_find_space(struct dmar_domain *domain, /* Handle upper region. */ if (common->highaddr >= domain->end) return (ENOMEM); - error = dmar_gas_uppermatch(&a); + error = dmar_gas_uppermatch(&a, RB_ROOT(&domain->rb_root)); KASSERT(error == ENOMEM, ("error %d from dmar_gas_uppermatch", error)); return (error); From owner-svn-src-all@freebsd.org Mon Jan 27 20:21:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 902A122D14B; Mon, 27 Jan 2020 20:21:09 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4861NP0jm5z47df; Mon, 27 Jan 2020 20:21:08 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00RKL1tb037213 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 Jan 2020 12:21:01 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00RKKxd3037212; Mon, 27 Jan 2020 12:20:59 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 27 Jan 2020 12:20:59 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357004 - in head/sys: kern sys Message-ID: <20200127202059.GV1268@FreeBSD.org> References: <202001230124.00N1OlXi029506@repo.freebsd.org> <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> <20200124170532.GO1268@FreeBSD.org> <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4861NP0jm5z47df X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.59 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.74)[-0.742,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.85)[-0.847,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:21:09 -0000 Hans, On Fri, Jan 24, 2020 at 08:21:54PM +0100, Hans Petter Selasky wrote: H> > If a driver has interrupt moderation than epoch batching counter H> > basically won't ever grow over 1. It kicks in only of driver doesn't H> > have it, or receives interrupts at a very high rate. H> H> Depending on the load an interrupt imposes, this batching counter may H> cause epochs to last for a long time. Have you considered using ticks H> for this instead? I.E. if the congestion lasts more than two ticks, then H> re-acquire the EPOCH? H> H> For example if the network controller spends more time processing H> packets then there is between interrupts, then this unconditional 1000x H> thing can be quite dangerous. I didn't try using ticks instead of execution counter. It could be ticks would be better. Needs more experiments. H> > H> 2) You need to make a new request function for interrupts which take a H> > H> pointer to an EPOCH and replace that IH_NET in hflags! H> > H> > Initially I did that way, but then pondered over this approach and have H> > abandoned it. Most likely we will have just few globally recognized H> > epochs in the kernel. And even less might be associated with interrupt H> > handlers. Complexity and performance impact of using a pointer are H> > noted by Drew in D23347. H> H> Let not the network epoch become the new Giant of EPOCH's. There might H> be realtime constraints for EPOCH's aswell. Epoch isn't a lock, so it can't become the new Giant. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Jan 27 20:23:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E29422D278; Mon, 27 Jan 2020 20:23:05 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4861Qc6XHxz47tZ; Mon, 27 Jan 2020 20:23:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00RKMxca037245 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 Jan 2020 12:22:59 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00RKMxnZ037244; Mon, 27 Jan 2020 12:22:59 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 27 Jan 2020 12:22:59 -0800 From: Gleb Smirnoff To: Cy Schubert Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357004 - in head/sys: kern sys Message-ID: <20200127202259.GW1268@FreeBSD.org> References: <202001230124.00N1OlXi029506@repo.freebsd.org> <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> <20200124170532.GO1268@FreeBSD.org> <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> <202001242023.00OKNXlS094989@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001242023.00OKNXlS094989@slippy.cwsent.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4861Qc6XHxz47tZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.53 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.71)[-0.713,0]; NEURAL_HAM_LONG(-0.82)[-0.821,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:23:05 -0000 On Fri, Jan 24, 2020 at 12:23:33PM -0800, Cy Schubert wrote: C> > Let not the network epoch become the new Giant of EPOCH's. There might C> > be realtime constraints for EPOCH's aswell. C> C> I also had that concern yesterday. C> C> Obtaining an EPOCH higher up the call stack or lower down depends on the C> workload. Are there any measurements that moving the EPOCHs higher in the C> call stack improves one workload (and configuration) or another? Could one C> type of workload or configuration benefit from this at the expense of C> another workload or configuration? Can you imagine a workload where calling epoch_enter/exit more often but for a shorter period of execution would be beneficial that calling it once for a packet? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Jan 27 20:43:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BE6E22E686; Mon, 27 Jan 2020 20:43:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4861tJ06Klz4B1H; Mon, 27 Jan 2020 20:43:35 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00RKhXmB037372 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 Jan 2020 12:43:34 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00RKhX5H037371; Mon, 27 Jan 2020 12:43:33 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 27 Jan 2020 12:43:33 -0800 From: Gleb Smirnoff To: John Baldwin Cc: Jeff Roberson , Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200127204333.GX1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> <6a5485eb-8623-3316-0385-b0cda1624b05@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a5485eb-8623-3316-0385-b0cda1624b05@FreeBSD.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4861tJ06Klz4B1H X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.47 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.68)[-0.679,0]; NEURAL_HAM_LONG(-0.79)[-0.787,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:43:36 -0000 On Sun, Jan 26, 2020 at 09:48:42AM +0000, John Baldwin wrote: J> > We also are concerned about that theoretically. Haven't yet seen effect J> > in practice, but our sessions are mostly longer living. First we have the J> > tunable to limit batching. Second, there are some ideas on how to improve J> > the garbage collector performance if it becomes an issue. J> J> There are other workloads than Netflix. ;) Verisign has incredibly short-lived J> connections with very high turnover. I think though that they have already J> abandoned the in-tree network stack for a userland stack built on netmap. Still, J> I think that there are probably other FreeBSD users that are probably somewhere J> in the middle that shouldn't be ignored. I understand that. First, my change doesn't create extra work for the garbage collector, but it potentially may affect its burstiness. If a machine has very high connection turnover it already may exhibit some problems with the PCB garbage collector on 12.0-RELEASE. Have we observed this yet? Note that PCBs are very different to other things protected by the network epoch: address lists, interface lists, firewall rules, etc. They are short lived. We got several ideas on how to deal with this potential problem: 1) The current PCB destructor does lots of things like freeing and unrefcounting associated multicast options, credentials, etc. This is because it was converted to epoch with a principle of minimal diff in r335015. However, since all operations with a PCB happen under its individual lock, we can free it differently. We can mark it INP_FREED and do all the destruction immediately, leaving only actual free to the garbage collector. Once this is achieved, the garbage collection can be batched at level of UMA. Jeff is working on that. 2) Use separate epoch for PCBs, leaving the network epoch for long lived structures only. Don't hold the PCB epoch long. 3) Just don't use epoch for PCBs. Decompose the hash lock into per slot hash lock. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Jan 27 22:13:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 572DD2306EC; Mon, 27 Jan 2020 22:13:43 +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 4863tH1b4Vz4GK4; Mon, 27 Jan 2020 22:13:43 +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 319E318FE1; Mon, 27 Jan 2020 22:13:43 +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 00RMDgCq085707; Mon, 27 Jan 2020 22:13:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMDgUR085706; Mon, 27 Jan 2020 22:13:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001272213.00RMDgUR085706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 27 Jan 2020 22:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357180 - in stable: 11/include 12/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/include 12/include X-SVN-Commit-Revision: 357180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:13:43 -0000 Author: kevans Date: Mon Jan 27 22:13:42 2020 New Revision: 357180 URL: https://svnweb.freebsd.org/changeset/base/357180 Log: MFC r356994: Mark rfork(2) as __returns_twice rfork is not generally a built-in that would be recognized as behaving like vfork/fork; provide the hint. Modified: stable/11/include/unistd.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/include/unistd.h Directory Properties: stable/12/ (props changed) Modified: stable/11/include/unistd.h ============================================================================== --- stable/11/include/unistd.h Mon Jan 27 20:47:18 2020 (r357179) +++ stable/11/include/unistd.h Mon Jan 27 22:13:42 2020 (r357180) @@ -545,7 +545,7 @@ char *re_comp(const char *); int re_exec(const char *); int reboot(int); int revoke(const char *); -pid_t rfork(int); +pid_t rfork(int) __returns_twice; pid_t rfork_thread(int, void *, int (*)(void *), void *); int rresvport(int *); int rresvport_af(int *, int); From owner-svn-src-all@freebsd.org Mon Jan 27 22:13:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 901332306F0; Mon, 27 Jan 2020 22:13:43 +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 4863tH3JtFz4GK5; Mon, 27 Jan 2020 22:13:43 +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 6D14618FE2; Mon, 27 Jan 2020 22:13:43 +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 00RMDhCW085713; Mon, 27 Jan 2020 22:13:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMDhAd085712; Mon, 27 Jan 2020 22:13:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001272213.00RMDhAd085712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 27 Jan 2020 22:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357180 - in stable: 11/include 12/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/include 12/include X-SVN-Commit-Revision: 357180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:13:43 -0000 Author: kevans Date: Mon Jan 27 22:13:42 2020 New Revision: 357180 URL: https://svnweb.freebsd.org/changeset/base/357180 Log: MFC r356994: Mark rfork(2) as __returns_twice rfork is not generally a built-in that would be recognized as behaving like vfork/fork; provide the hint. Modified: stable/12/include/unistd.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/include/unistd.h Directory Properties: stable/11/ (props changed) Modified: stable/12/include/unistd.h ============================================================================== --- stable/12/include/unistd.h Mon Jan 27 20:47:18 2020 (r357179) +++ stable/12/include/unistd.h Mon Jan 27 22:13:42 2020 (r357180) @@ -551,7 +551,7 @@ char *re_comp(const char *); int re_exec(const char *); int reboot(int); int revoke(const char *); -pid_t rfork(int); +pid_t rfork(int) __returns_twice; pid_t rfork_thread(int, void *, int (*)(void *), void *); int rresvport(int *); int rresvport_af(int *, int); From owner-svn-src-all@freebsd.org Mon Jan 27 22:19:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03F9B2309D6; Mon, 27 Jan 2020 22:19:57 +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 48641S58Clz4Ghj; Mon, 27 Jan 2020 22:19:56 +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 AB1DE18FEE; Mon, 27 Jan 2020 22:19:56 +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 00RMJu8m086038; Mon, 27 Jan 2020 22:19:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMJtg1086033; Mon, 27 Jan 2020 22:19:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001272219.00RMJtg1086033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Jan 2020 22:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357181 - in head/sys: arm/allwinner cam/mmc dev/mmc/host dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/allwinner cam/mmc dev/mmc/host dev/sdhci X-SVN-Commit-Revision: 357181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:19:57 -0000 Author: imp Date: Mon Jan 27 22:19:55 2020 New Revision: 357181 URL: https://svnweb.freebsd.org/changeset/base/357181 Log: Create a convenince wrapper to fill in a CAM_PATH_INQ request for MMC sims. Pass in the parameters needed for the different sims, but it's almost all identical. Modified: head/sys/arm/allwinner/aw_mmc.c head/sys/cam/mmc/mmc_all.h head/sys/cam/mmc/mmc_xpt.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/sdhci/sdhci.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Mon Jan 27 22:13:42 2020 (r357180) +++ head/sys/arm/allwinner/aw_mmc.c Mon Jan 27 22:19:55 2020 (r357181) @@ -213,33 +213,11 @@ aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) switch (ccb->ccb_h.func_code) { case XPT_PATH_INQ: - { - struct ccb_pathinq *cpi; - - cpi = &ccb->cpi; - cpi->version_num = 1; - cpi->hba_inquiry = 0; - cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; - cpi->hba_eng_cnt = 0; - cpi->max_target = 0; - cpi->max_lun = 0; - cpi->initiator_id = 1; - cpi->maxio = (sc->aw_mmc_conf->dma_xferlen * - AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "Deglitch Networks", HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); - cpi->unit_number = cam_sim_unit(sim); - cpi->bus_id = cam_sim_bus(sim); - cpi->protocol = PROTO_MMCSD; - cpi->protocol_version = SCSI_REV_0; - cpi->transport = XPORT_MMCSD; - cpi->transport_version = 1; - - cpi->ccb_h.status = CAM_REQ_CMP; + mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, + (sc->aw_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS) / + MMC_SECTOR_SIZE); break; - } + case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; Modified: head/sys/cam/mmc/mmc_all.h ============================================================================== --- head/sys/cam/mmc/mmc_all.h Mon Jan 27 22:13:42 2020 (r357180) +++ head/sys/cam/mmc/mmc_all.h Mon Jan 27 22:19:55 2020 (r357181) @@ -68,5 +68,9 @@ #include void mmc_print_ident(struct mmc_params *ident_data); +struct ccb_pathinq; +struct cam_sim; +void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, + const struct cam_sim *sim, size_t maxio); #endif Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Mon Jan 27 22:13:42 2020 (r357180) +++ head/sys/cam/mmc/mmc_xpt.c Mon Jan 27 22:19:55 2020 (r357181) @@ -1104,3 +1104,32 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do cam_periph_release_locked(periph); } } + +void +mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, + const struct cam_sim *sim, size_t maxio) +{ + + cpi->version_num = 1; + cpi->hba_inquiry = 0; + cpi->target_sprt = 0; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; + cpi->hba_eng_cnt = 0; + cpi->max_target = 0; + cpi->max_lun = 0; + cpi->initiator_id = 1; + cpi->maxio = maxio; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, hba, HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + cpi->bus_id = cam_sim_bus(sim); + cpi->protocol = PROTO_MMCSD; + cpi->protocol_version = SCSI_REV_0; + cpi->transport = XPORT_MMCSD; + cpi->transport_version = 1; + + cpi->base_transfer_speed = 100; /* XXX WTF? */ + + cpi->ccb_h.status = CAM_REQ_CMP; +} Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Jan 27 22:13:42 2020 (r357180) +++ head/sys/dev/mmc/host/dwmmc.c Mon Jan 27 22:19:55 2020 (r357181) @@ -67,8 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_mmccam.h" - #include "mmcbr_if.h" #define dprintf(x, arg...) Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jan 27 22:13:42 2020 (r357180) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 27 22:19:55 2020 (r357181) @@ -2586,33 +2586,9 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) switch (ccb->ccb_h.func_code) { case XPT_PATH_INQ: - { - struct ccb_pathinq *cpi; - - cpi = &ccb->cpi; - cpi->version_num = 1; - cpi->hba_inquiry = 0; - cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; - cpi->hba_eng_cnt = 0; - cpi->max_target = 0; - cpi->max_lun = 0; - cpi->initiator_id = 1; - cpi->maxio = MAXPHYS; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "Deglitch Networks", HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); - cpi->unit_number = cam_sim_unit(sim); - cpi->bus_id = cam_sim_bus(sim); - cpi->base_transfer_speed = 100; /* XXX WTF? */ - cpi->protocol = PROTO_MMCSD; - cpi->protocol_version = SCSI_REV_0; - cpi->transport = XPORT_MMCSD; - cpi->transport_version = 0; - - cpi->ccb_h.status = CAM_REQ_CMP; + mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MAXPHYS); break; - } + case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; From owner-svn-src-all@freebsd.org Mon Jan 27 22:20:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 366A6230A07; Mon, 27 Jan 2020 22:20:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48641Z72Z0z4Gnk; Mon, 27 Jan 2020 22:20:02 +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 DA40118FF2; Mon, 27 Jan 2020 22:20:02 +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 00RMK2fS086135; Mon, 27 Jan 2020 22:20:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMK2i6086134; Mon, 27 Jan 2020 22:20:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001272220.00RMK2i6086134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Jan 2020 22:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357182 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 357182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:20:03 -0000 Author: imp Date: Mon Jan 27 22:20:02 2020 New Revision: 357182 URL: https://svnweb.freebsd.org/changeset/base/357182 Log: No need to have an extra layer of indirection here. Call the sdhci_cam_requiest routine directly when handling a MMIO request. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Jan 27 22:19:55 2020 (r357181) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 27 22:20:02 2020 (r357182) @@ -124,7 +124,6 @@ static void sdhci_transfer_pio(struct sdhci_slot *slot static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb); static int sdhci_cam_get_possible_host_clock(const struct sdhci_slot *slot, int proposed_clock); -static void sdhci_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb); static void sdhci_cam_poll(struct cam_sim *sim); static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb); static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb); @@ -2560,16 +2559,6 @@ fail: cam_simq_free(slot->devq); } -static void -sdhci_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) -{ - struct sdhci_slot *slot; - - slot = cam_sim_softc(sim); - - sdhci_cam_request(slot, ccb); -} - void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) { @@ -2624,13 +2613,11 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) break; } case XPT_SET_TRAN_SETTINGS: - { if (sdhci_debug > 1) slot_printf(slot, "Got XPT_SET_TRAN_SETTINGS\n"); sdhci_cam_settran_settings(slot, ccb); ccb->ccb_h.status = CAM_REQ_CMP; break; - } case XPT_RESET_BUS: if (sdhci_debug > 1) slot_printf(slot, "Got XPT_RESET_BUS, ACK it...\n"); @@ -2647,10 +2634,8 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) slot_printf(slot, "Got XPT_MMC_IO\n"); ccb->ccb_h.status = CAM_REQ_INPROG; - sdhci_cam_handle_mmcio(sim, ccb); + sdhci_cam_request(cam_sim_softc(sim), ccb); return; - /* NOTREACHED */ - break; default: ccb->ccb_h.status = CAM_REQ_INVALID; break; From owner-svn-src-all@freebsd.org Mon Jan 27 22:36:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D186F231295; Mon, 27 Jan 2020 22:36:54 +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 4864P259NDz4HvR; Mon, 27 Jan 2020 22:36:54 +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 A80DE19394; Mon, 27 Jan 2020 22:36:54 +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 00RMaspR098027; Mon, 27 Jan 2020 22:36:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMasEh098026; Mon, 27 Jan 2020 22:36:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001272236.00RMasEh098026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Jan 2020 22:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357183 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:36:54 -0000 Author: imp Date: Mon Jan 27 22:36:54 2020 New Revision: 357183 URL: https://svnweb.freebsd.org/changeset/base/357183 Log: Make mqueue objects work across a fork again. In r110908 (2003) alfred added DFLAG_PASSABLE to tag those types of FD that can be passed via unix pipes, but mqueuefs didn't exist yet. Later, in r152825 (2005) davidxu neglected to include DFLAG_PASSABLE since people don't normally pass these things via unix sockets (it's a FreeBSD implementation detail that it's a file descriptor, nobody noticed). Then r223866 (2011) by jonathan used the new flag in fdcopy, which fork uses. Due to that, mqueuefs actually broke mqueue objects being propagated by fork. No mention of mqueuefs was made in r223866, so I think it was an unintended consequence. Fix this by tagging mqueuefs as passable as well. They were prior to alfred's change (and it's clear there's no intent in his change to change this behavior), and POSIX requires this to be the case as well. PR: 243103 Reviewed by: kib@, jiles@ Differential Revision: https://reviews.freebsd.org/D23038 Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Mon Jan 27 22:20:02 2020 (r357182) +++ head/sys/kern/uipc_mqueue.c Mon Jan 27 22:36:54 2020 (r357183) @@ -2669,6 +2669,7 @@ static struct fileops mqueueops = { .fo_chown = mqf_chown, .fo_sendfile = invfo_sendfile, .fo_fill_kinfo = mqf_fill_kinfo, + .fo_flags = DFLAG_PASSABLE, }; static struct vop_vector mqfs_vnodeops = { From owner-svn-src-all@freebsd.org Mon Jan 27 22:40:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E647023140D; Mon, 27 Jan 2020 22:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4864Sg5r0Yz4J5F; Mon, 27 Jan 2020 22:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF1A8193A0; Mon, 27 Jan 2020 22:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RMe3MQ098268; Mon, 27 Jan 2020 22:40:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMe36P098267; Mon, 27 Jan 2020 22:40:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001272240.00RMe36P098267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Jan 2020 22:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357184 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 357184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:40:04 -0000 Author: imp Date: Mon Jan 27 22:40:03 2020 New Revision: 357184 URL: https://svnweb.freebsd.org/changeset/base/357184 Log: multi-boot for openstack/qcow images Make stock FreeBSD more useful for people wishing to use them. The QEMU folks suggested this change. It adds a serial console which allows them to interact with FreeBSD from the earliest moments. This allows them to configure FreeBSD via the serial port to set it up for CI use. Reviewed by: kevans@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D22786 Modified: head/release/tools/openstack.conf Modified: head/release/tools/openstack.conf ============================================================================== --- head/release/tools/openstack.conf Mon Jan 27 22:36:54 2020 (r357183) +++ head/release/tools/openstack.conf Mon Jan 27 22:40:03 2020 (r357184) @@ -41,6 +41,9 @@ vm_extra_pre_umount() { # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf + echo 'boot_multicons="YES"' >> ${DESTDIR}/boot/loader.conf + echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf + echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf # Reboot quickly, Don't wait at the panic screen echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf From owner-svn-src-all@freebsd.org Mon Jan 27 22:45:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D419723168D; Mon, 27 Jan 2020 22:45:49 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4864bK5CwZz4JT9; Mon, 27 Jan 2020 22:45:49 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE2C119563; Mon, 27 Jan 2020 22:45:49 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RMjnCm003987; Mon, 27 Jan 2020 22:45:49 GMT (envelope-from woodsb02@FreeBSD.org) Received: (from woodsb02@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RMjnIs003986; Mon, 27 Jan 2020 22:45:49 GMT (envelope-from woodsb02@FreeBSD.org) Message-Id: <202001272245.00RMjnIs003986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: woodsb02 set sender to woodsb02@FreeBSD.org using -f From: Ben Woods Date: Mon, 27 Jan 2020 22:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357185 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: woodsb02 X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 357185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 22:45:49 -0000 Author: woodsb02 (ports committer) Date: Mon Jan 27 22:45:49 2020 New Revision: 357185 URL: https://svnweb.freebsd.org/changeset/base/357185 Log: bsdinstall: Provide help text for partitioning options Includes commentary of when ZFS works well by default (>= 8GB RAM), and where to go for information on ZFS tuning if required. Also hoist the options text to the top of script as variables (will help with future international translations). Reviewed by: philip, dteske, karels, imp, emaste Approved by: rgrimes Differential Revision: https://reviews.freebsd.org/D23224 Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Mon Jan 27 22:40:03 2020 (r357184) +++ head/usr.sbin/bsdinstall/scripts/auto Mon Jan 27 22:45:49 2020 (r357185) @@ -41,13 +41,25 @@ f_include $BSDCFG_SHARE/dialog.subr hline_arrows_tab_enter="Press arrows, TAB or ENTER" hline_arrows_tab_space_enter="Press arrows, TAB, SPACE or ENTER" msg_abort="Abort" +msg_an_installation_step_has_been_aborted="An installation step has been aborted. Would you like\nto restart the installation or exit the installer?" +msg_auto_ufs="Auto (UFS)" +msg_auto_ufs_desc="Guided UFS Disk Setup" +msg_auto_ufs_help="Menu options help choose which disk to setup using UFS and standard partitions" +msg_auto_zfs="Auto (ZFS)" +msg_auto_zfs_desc="Guided Root-on-ZFS" +msg_auto_zfs_help="To use ZFS with less than 8GB RAM, see https://wiki.freebsd.org/ZFSTuningGuide" msg_exit="Exit" msg_freebsd_installer="FreeBSD Installer" msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" -msg_an_installation_step_has_been_aborted="An installation step has been aborted. Would you like\nto restart the installation or exit the installer?" +msg_manual="Manual" +msg_manual_desc="Manual Disk Setup (experts)" +msg_manual_help="Create customized partitions from menu options" msg_no="NO" msg_restart="Restart" +msg_shell="Shell" +msg_shell_desc="Open a shell and partition by hand" +msg_shell_help="Create customized partitions using command-line utilities" msg_yes="YES" ############################################################ FUNCTIONS @@ -281,42 +293,47 @@ if f_interactive; then esac fi -PMODES="\ -\"Auto (UFS)\" \"Guided Disk Setup\" \ -Manual \"Manual Disk Setup (experts)\" \ -Shell \"Open a shell and partition by hand\"" +PMODES=" + '$msg_auto_ufs' '$msg_auto_ufs_desc' '$msg_auto_ufs_help' + '$msg_manual' '$msg_manual_desc' '$msg_manual_help' + '$msg_shell' '$msg_shell_desc' '$msg_shell_help' +" # END-QUOTE CURARCH=$( uname -m ) case $CURARCH in amd64|arm64|i386) # Booting ZFS Supported - PMODES="\"Auto (ZFS)\" \"Guided Root-on-ZFS\" $PMODES" + PMODES=" + '$msg_auto_zfs' '$msg_auto_zfs_desc' '$msg_auto_zfs_help' + $PMODES + " # END-QUOTE ;; - *) # Booting ZFS Unspported + *) # Booting ZFS Unsupported ;; esac exec 3>&1 PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ --title "Partitioning" \ + --item-help \ --menu "How would you like to partition your disk?" \ 0 0 0 2>&1 1>&3` || exit 1 exec 3>&- case "$PARTMODE" in -"Auto (ZFS)") # ZFS +"$msg_auto_zfs") # ZFS bsdinstall zfsboot || error "ZFS setup failed" bsdinstall mount || error "Failed to mount filesystem" ;; -"Auto (UFS)") # Guided +"$msg_auto_ufs") # Guided UFS bsdinstall autopart || error "Partitioning error" bsdinstall mount || error "Failed to mount filesystem" ;; -"Shell") # Shell +"$msg_shell") # Shell clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 ;; -"Manual") # Manual +"$msg_manual") # Manual if f_isset debugFile; then # Give partedit the path to our logfile so it can append BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error "Partitioning error" From owner-svn-src-all@freebsd.org Tue Jan 28 00:36:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4045233DC7; Tue, 28 Jan 2020 00:36:46 +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 48673L5Hckz4Q8d; Tue, 28 Jan 2020 00:36:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC2B21A97A; Tue, 28 Jan 2020 00:36:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S0ak0w069556; Tue, 28 Jan 2020 00:36:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S0akQ7069555; Tue, 28 Jan 2020 00:36:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001280036.00S0akQ7069555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 28 Jan 2020 00:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357186 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 357186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 00:36:47 -0000 Author: imp Date: Tue Jan 28 00:36:46 2020 New Revision: 357186 URL: https://svnweb.freebsd.org/changeset/base/357186 Log: Remove old device list The device list hasn't aged well. All these devices are over a decade old. umass supports thunb drives almost universally, and the list is too long to try to list here. Remove some obsolete advice as well. This isn't the place to talk about how to create FAT filesystems, nor now to mount them. The only advice that's still useful is the rescanning of a multi-slot flash adapater. MFC After: 3 days Modified: head/share/man/man4/umass.4 Modified: head/share/man/man4/umass.4 ============================================================================== --- head/share/man/man4/umass.4 Mon Jan 27 22:45:49 2020 (r357185) +++ head/share/man/man4/umass.4 Tue Jan 28 00:36:46 2020 (r357186) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2014 +.Dd January 27, 2020 .Dt UMASS 4 .Os .Sh NAME @@ -73,114 +73,6 @@ requires and .Xr scbus 4 to be included in the kernel. -.Sh HARDWARE -The -.Nm -driver supports USB Mass Storage devices, including: -.Pp -.Bl -bullet -compact -.It -ADTEC Stick Drive AD-UST32M, 64M, 128M, 256M -.It -Denno FireWire/USB2 Removable 2.5-inch HDD Case MIFU-25CB20 -.It -FujiFilm Zip USB Drive ZDR100 USB A -.It -GREEN HOUSE USB Flash Memory "PicoDrive" GH-UFD32M, 64M, 128M -.It -Huawei Mobile (SD slot) -.It -IBM 32MB USB Memory Key (P/N 22P5296) -.It -IBM 256MB USB Drive (MSYSTEM DiskOnKey2) -.It -IBM ThinkPad USB Portable CD-ROM Drive (P/N 33L5151) -.It -I-O DATA USB CD/CD-R/CD-RW/DVD-R/DVD-RW/DVD-RAM/DVD-ROM Drive DVR-iUH2 (CDROM, DVD-RAM only) -.It -I-O DATA USB x6 CD-RW Drive CDRW-i64/USB (CDROM only) -.It -I-O DATA USB/IEEE1394 Portable HD Drive HDP-i30P/CI, HDP-i40P/CI -.It -Iomega USB Zip 100/250 drive -.It -Iomega Zip750 USB2.0 drive -.It -Keian USB1.1/2.0 3.5-inch HDD Case KU350A -.It -Kurouto Shikou USB 2.5-inch HDD Case GAWAP2.5PS-USB2.0 -.It -LaCie P3 HardDrive USB 200GB -.It -Logitec LDR-H443U2 DVD-RAM/-R/+R/-RW/+RW drive -.It -Logitec Mobile USB Memory LMC-256UD -.It -Logitec USB1.1/2.0 HDD Unit SHD-E60U2 -.It -Logitec USB Double-Speed Floppy Drive LFD-31U2 -.It -Logitec USB/IEEE1394 DVD-RAM/R/RW Unit LDR-N21FU2 (CDROM only) -.It -MELCO USB Flash Disk "ClipDrive", RUF-C32M, -C64M, -C128M, -C256M, -C512M -.It -MELCO USB Flash Disk "PetitDrive", RUF-32M, -64M, -128M, -256Mm -.It -MELCO USB2.0 Flash Disk "PetitDrive2", RUF-256M/U2, -512M/U2 -.It -MELCO USB2.0 MO Drive MO-CH640U2 -.It -Matshita CF-VFDU03 floppy drive -.It -Merlin SM300 MP3/WMA Player (256Mb) -.It -Microtech International, Inc.\& USB-SCSI-HD 50 USB to SCSI cable -.It -Motorola E398 Mobile Phone (TransFlash memory card) -.It -NOVAC USB2.0 2.5/3.5-inch HDD Case NV-HD351U -.It -PNY Attache Flash Drive -.It -Panasonic ("Matshita FDD CF-VFDU03") -.It -Panasonic KXL-CB20AN Portable DVD-ROM/CD-R/RW -.It -Panasonic KXL-CB35AN (DVD-ROM & CD-R/RW) -.It -Panasonic USB2.0 Portable CD-RW Drive KXL-RW40AN (CDROM only) -.It -Panasonic floppy drive -.It -Qware BeatZkey!\& Pro -.It -RATOC Systems USB2.0 Removable HDD Case U2-MDK1, U2-MDK1B -.It -SanDisk SDDR-31 (Compact Flash) -.It -SanDisk SDDR-75 (only Compact Flash port works) -.It -Sitecom CN-300 MultiFlash (MMC/SD, SmartMedia, CF, MemoryStick) -.It -Sony Portable CD-R/RW Drive CRX10U (CDROM only) -.It -TEAC Portable USB CD-ROM Unit CD-110PU/210PU -.It -Time DPA20B MP3 Player (1Gb) -.It -Trek Thumbdrive 8MB -.It -VAIO floppy drive (includes Y-E Data Flashbuster-U) -.It -Y-E Data floppy drive (720/1.44/2.88Mb) -.El -.Pp -Among the supported digital cameras are: -.Pp -.Bl -bullet -compact -.It -Asahi Optical (PENTAX) Optio 230 & 330 -.El .Sh EXAMPLES .Bd -literal -offset indent device umass @@ -193,11 +85,6 @@ Add the .Nm driver to the kernel. .Pp -.Dl "camcontrol rescan 0" -.Pp -Rescan a Zip drive that was added after boot. -The command above -assumes that the Zip drive is on the first SCSI bus in the system. .Bd -literal -offset indent camcontrol rescan 0:0:0 camcontrol rescan 0:0:1 @@ -208,46 +95,14 @@ camcontrol rescan 0:0:3 Rescan all slots on a multi-slot flash reader, where the slots map to separate LUNs on a single SCSI ID. Typically only the first slot will be enabled at boot time. -Again, this assumes that the flash reader is the first SCSI bus in the system. -.Bd -literal -offset indent -bsdlabel -w da0 zip100 -newfs da0c -mount -t ufs /dev/da0c /mnt -.Ed -.Pp -Write a disklabel to the Zip drive (see -.Xr vpo 4 -for the -.Xr disktab 5 -entry), creates the file system and mounts the new file system on /mnt. -.Pp -.Dl "newfs_msdos /dev/da0" -.Pp -Create a new FAT type file system. -Care should be taken not to run -.Xr newfs 8 -on devices that already contain data, as this will result in the -information being lost. -.Pp -Many consumer devices such as digital cameras automatically create -.Tn MS-DOS -based file systems when storing information such as images and -videos. -These file systems can be accessed by specifying the file system -type as -.Cm msdosfs -when using -.Xr mount 8 . +This assumes that the flash reader is the first SCSI bus in the system and has 4 slots. .Sh SEE ALSO .Xr cfumass 4 , .Xr ehci 4 , .Xr ohci 4 , .Xr uhci 4 , .Xr usb 4 , -.Xr vpo 4 , .Xr xhci 4 , -.Xr disktab 5 , -.Xr bsdlabel 8 , .Xr camcontrol 8 .\".Sh HISTORY .Sh AUTHORS From owner-svn-src-all@freebsd.org Tue Jan 28 01:36:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19610236020; Tue, 28 Jan 2020 01:36:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4868NY725Pz4TPc; Tue, 28 Jan 2020 01:36:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC8BC1B508; Tue, 28 Jan 2020 01:36:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S1aj0j005581; Tue, 28 Jan 2020 01:36:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S1ajSb005580; Tue, 28 Jan 2020 01:36:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001280136.00S1ajSb005580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 Jan 2020 01:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357187 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 357187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 01:36:46 -0000 Author: cem Date: Tue Jan 28 01:36:45 2020 New Revision: 357187 URL: https://svnweb.freebsd.org/changeset/base/357187 Log: x86: identcpu: Decode new Zen2 AMD Feature2 bit Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue Jan 28 00:36:46 2020 (r357186) +++ head/sys/x86/x86/identcpu.c Tue Jan 28 01:36:45 2020 (r357187) @@ -933,7 +933,7 @@ printcpuinfo(void) "\034PTSC" /* Performance TSC */ "\035PL2I" /* L2I perf count */ "\036MWAITX" /* MONITORX/MWAITX instructions */ - "\037" + "\037ADMSKX" /* Address mask extension */ "\040" ); } From owner-svn-src-all@freebsd.org Tue Jan 28 01:37:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DBB32360E4; Tue, 28 Jan 2020 01:37:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4868PF3Fz5z4TXc; Tue, 28 Jan 2020 01:37:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B1951B50C; Tue, 28 Jan 2020 01:37:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S1bL4n005652; Tue, 28 Jan 2020 01:37:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S1bLAc005651; Tue, 28 Jan 2020 01:37:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001280137.00S1bLAc005651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 Jan 2020 01:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357188 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 357188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 01:37:21 -0000 Author: cem Date: Tue Jan 28 01:37:20 2020 New Revision: 357188 URL: https://svnweb.freebsd.org/changeset/base/357188 Log: x86: identcpu: Decode new Intel Structured Extended feature bits Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue Jan 28 01:36:45 2020 (r357187) +++ head/sys/x86/x86/identcpu.c Tue Jan 28 01:37:20 2020 (r357188) @@ -1024,10 +1024,12 @@ printcpuinfo(void) "\020" "\003AVX512_4VNNIW" "\004AVX512_4FMAPS" + "\005FSRM" "\011AVX512VP2INTERSECT" "\013MD_CLEAR" "\016TSXFA" "\023PCONFIG" + "\025IBT" "\033IBPB" "\034STIBP" "\035L1DFL" From owner-svn-src-all@freebsd.org Tue Jan 28 01:38:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AFA323628A; Tue, 28 Jan 2020 01:38:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4868R01lHxz4Thw; Tue, 28 Jan 2020 01:38:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EA471B514; Tue, 28 Jan 2020 01:38:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S1cqil005764; Tue, 28 Jan 2020 01:38:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S1cps2005763; Tue, 28 Jan 2020 01:38:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001280138.00S1cps2005763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 Jan 2020 01:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357189 - head/sys/dev/amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/amdtemp X-SVN-Commit-Revision: 357189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 01:38:52 -0000 Author: cem Date: Tue Jan 28 01:38:51 2020 New Revision: 357189 URL: https://svnweb.freebsd.org/changeset/base/357189 Log: amdtemp(4): Refactor shared temperature calculation logic No functional change intended. Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 01:37:20 2020 (r357188) +++ head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 01:38:51 2020 (r357189) @@ -651,28 +651,48 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) } static uint32_t -amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +amdtemp_decode_fam10h_to_17h(int32_t sc_offset, uint32_t val, bool minus49) { uint32_t temp; /* Convert raw register subfield units (0.125C) to units of 0.1C. */ - temp = ((val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT) & - AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + temp = (val & AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; + if (minus49) + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + + temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; + return (temp); +} + +static uint32_t +amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) +{ + bool minus49; + /* * On Family 15h and higher, if CurTmpTjSel is 11b, the range is * adjusted down by 49.0 degrees Celsius. (This adjustment is not * documented in BKDGs prior to family 15h model 00h.) */ - if (CPUID_TO_FAMILY(cpu_id) >= 0x15 && + minus49 = (CPUID_TO_FAMILY(cpu_id) >= 0x15 && ((val >> AMDTEMP_REPTMP10H_TJSEL_SHIFT) & - AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3) - temp -= AMDTEMP_CURTMP_RANGE_ADJUST; + AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3); - temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; - return (temp); + return (amdtemp_decode_fam10h_to_17h(sc_offset, + val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT, minus49)); } +static uint32_t +amdtemp_decode_fam17h_tctl(int32_t sc_offset, uint32_t val) +{ + bool minus49; + + minus49 = ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0); + return (amdtemp_decode_fam10h_to_17h(sc_offset, + val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT, minus49)); +} + static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor) { @@ -699,16 +719,11 @@ static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) { struct amdtemp_softc *sc = device_get_softc(dev); - uint32_t temp, val; + uint32_t val; int error; error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); KASSERT(error == 0, ("amdsmn_read")); - temp = ((val >> 21) & 0x7ff) * 5 / 4; - if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) - temp -= AMDTEMP_CURTMP_RANGE_ADJUST; - temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; - - return (temp); + return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); } From owner-svn-src-all@freebsd.org Tue Jan 28 01:39:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6E2C236343; Tue, 28 Jan 2020 01:39:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4868S64vttz4Tqj; Tue, 28 Jan 2020 01:39:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A39911B516; Tue, 28 Jan 2020 01:39:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S1doe1005847; Tue, 28 Jan 2020 01:39:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S1do1A005846; Tue, 28 Jan 2020 01:39:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001280139.00S1do1A005846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 Jan 2020 01:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357190 - in head/sys/dev: amdsmn amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 357190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 01:39:50 -0000 Author: cem Date: Tue Jan 28 01:39:50 2020 New Revision: 357190 URL: https://svnweb.freebsd.org/changeset/base/357190 Log: amdtemp(4): Add support for Family 17h CCD sensors Probe Family 17h CPUs for up to 4 (Zen, Zen+) or 8 (Zen2) CCD temperature sensors. These were discovered by Ondrej Čerman (https://github.com/ocerman) and collaborators experimentally, and are not currently documented in any datasheet I have access to. Modified: head/sys/dev/amdsmn/amdsmn.c head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Tue Jan 28 01:38:51 2020 (r357189) +++ head/sys/dev/amdsmn/amdsmn.c Tue Jan 28 01:39:50 2020 (r357190) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 -#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H. */ struct pciid; struct amdsmn_softc { Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 01:38:51 2020 (r357189) +++ head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 01:39:50 2020 (r357190) @@ -5,8 +5,7 @@ * Copyright (c) 2009 Norikatsu Shigemura * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. - * Copyright (c) 2017-2019 Conrad Meyer - * All rights reserved. + * Copyright (c) 2017-2020 Conrad Meyer . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +60,18 @@ typedef enum { CORE1_SENSOR0, CORE1_SENSOR1, CORE0, - CORE1 + CORE1, + CCD1, + CCD_BASE = CCD1, + CCD2, + CCD3, + CCD4, + CCD5, + CCD6, + CCD7, + CCD8, + CCD_MAX = CCD8, + NUM_CCDS = CCD_MAX - CCD_BASE + 1, } amdsensor_t; struct amdtemp_softc { @@ -96,7 +106,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 -#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70h. */ static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -149,7 +159,15 @@ static const struct amdtemp_product { * to -49..206C. */ #define AMDTEMP_17H_CUR_TMP 0x59800 -#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) +#define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1u << 19) +/* + * The following register set was discovered experimentally by Ondrej Čerman + * and collaborators, but is not (yet) documented in a PPR/OSRR (other than + * the M70H PPR SMN memory map showing [0x59800, +0x314] as allocated to + * SMU::THM). It seems plausible and the Linux sensor folks have adopted it. + */ +#define AMDTEMP_17H_CCD_TMP_BASE 0x59954 +#define AMDTEMP_17H_CCD_TMP_VALID (1u << 11) /* * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). @@ -186,6 +204,7 @@ static int32_t amdtemp_gettemp0f(device_t dev, amdsens static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); +static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -485,7 +504,9 @@ amdtemp_attach(device_t dev) dev, CORE0_SENSOR0, amdtemp_sysctl, "IK", "Core 0 / Sensor 0 temperature"); - if (sc->sc_ntemps > 1) { + if (family == 0x17) + amdtemp_probe_ccd_sensors17h(dev, model); + else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "sensor1", CTLTYPE_INT | CTLFLAG_RD, @@ -638,6 +659,8 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) if ((sc->sc_flags & AMDTEMP_FLAG_CS_SWAP) == 0) temp |= AMDTEMP_TTSR_SELCORE; break; + default: + __unreachable(); } pci_write_config(dev, AMDTEMP_THERMTP_STAT, temp, 1); @@ -722,8 +745,69 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) uint32_t val; int error; - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); - KASSERT(error == 0, ("amdsmn_read")); + switch (sensor) { + case CORE0_SENSOR0: + /* Tctl */ + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val); + KASSERT(error == 0, ("amdsmn_read")); + return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); + case CCD_BASE ... CCD_MAX: + /* Tccd */ + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + (((int)sensor - CCD_BASE) * sizeof(val)), &val); + KASSERT(error == 0, ("amdsmn_read2")); + KASSERT((val & AMDTEMP_17H_CCD_TMP_VALID) != 0, + ("sensor %d: not valid", (int)sensor)); + return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); + default: +#if 0 + KASSERT(false, ("%s: invalid sensor %d", __func__, + (int)sensor)); + return (-1); +#endif + __unreachable(); + } +} - return (amdtemp_decode_fam17h_tctl(sc->sc_offset, val)); +static void +amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model) +{ + char sensor_name[16], sensor_descr[32]; + struct amdtemp_softc *sc; + uint32_t maxreg, i, val; + int error; + + switch (model) { + case 0x00 ... 0x1f: /* Zen1, Zen+ */ + maxreg = 4; + break; + case 0x30 ... 0x3f: /* Zen2 TR/Epyc */ + case 0x70 ... 0x7f: /* Zen2 Ryzen */ + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 17h Model: %02xh\n", model); + return; + } + + sc = device_get_softc(dev); + for (i = 0; i < maxreg; i++) { + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE + + (i * sizeof(val)), &val); + if (error != 0) + continue; + if ((val & AMDTEMP_17H_CCD_TMP_VALID) == 0) + continue; + + snprintf(sensor_name, sizeof(sensor_name), "ccd%u", i); + snprintf(sensor_descr, sizeof(sensor_descr), + "CCD %u temperature (Tccd%u)", i, i); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + sensor_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, CCD_BASE + i, amdtemp_sysctl, "IK", sensor_descr); + } } From owner-svn-src-all@freebsd.org Tue Jan 28 02:42:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 358EA2383CA; Tue, 28 Jan 2020 02:42:34 +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 4869rV0jvQz4XpL; Tue, 28 Jan 2020 02:42:34 +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 13D9C1C20D; Tue, 28 Jan 2020 02:42:34 +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 00S2gX9o046649; Tue, 28 Jan 2020 02:42:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S2gXOe046647; Tue, 28 Jan 2020 02:42:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280242.00S2gXOe046647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 02:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357191 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 357191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 02:42:34 -0000 Author: kevans Date: Tue Jan 28 02:42:33 2020 New Revision: 357191 URL: https://svnweb.freebsd.org/changeset/base/357191 Log: MFC r357103-r357104: unbreak local.lua, add a modules.loaded hook r357103: loader.lua: re-arrange to load local.lua *after* config loading The major problem with the current ordering is that loader.conf may contain all of the magic we need to actually setup the console, so loading local.lua prior to that can make it excessively difficult and annoying to debug (whoops, sorry Ravi & Warner). The new ordering has some implications, but I suspect they are a non-issue. The first is that it's no longer possible for the local module to inject any logic prior to loading config -- I suspect no one has relied on this. The second implication is that the config.loaded hook is now useless, as the local module will always be included after that hook would have fired. For config.loaded, I will opt to leave it in, just in case we add an early point for local lua to get injected or in case one wants to schedule some deferred logic in a custom loader.lua. The overhead of having it if no hooks will be invoked is relatively minimal. r357104: lua: add modules.loaded hook This may be used for the local module to hook in and load any additional modules that it wants, since it can't modify the modules table internal to config. We may consider adding API to do so at a later time, but I suspect it will be more complicated to use with little return. status is captured but ignored for the purpose of loading the hook. status will be false if *any* module failed to load, but we typically don't let that halt the boot so there's no reason to let it halt hooks. Some vendors or setups may have expected fails that would be actively thwarted by checking it. We may, at a later date, consider adding an API for letting non-config modules check which modules have successfully (or not) loaded in case an unexpected failure *should* halt whatever they are doing. Modified: stable/11/stand/lua/config.lua stable/11/stand/lua/loader.lua Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/stand/lua/config.lua stable/12/stand/lua/loader.lua Directory Properties: stable/12/ (props changed) Modified: stable/11/stand/lua/config.lua ============================================================================== --- stable/11/stand/lua/config.lua Tue Jan 28 01:39:50 2020 (r357190) +++ stable/11/stand/lua/config.lua Tue Jan 28 02:42:33 2020 (r357191) @@ -623,7 +623,7 @@ end function config.loadelf() local xen_kernel = loader.getenv('xen_kernel') local kernel = config.kernel_selected or config.kernel_loaded - local loaded + local loaded, status if xen_kernel ~= nil then print(MSG_XENKERNLOADING) @@ -640,9 +640,12 @@ function config.loadelf() end print(MSG_MODLOADING) - return loadModule(modules, not config.verbose) + status = loadModule(modules, not config.verbose) + hook.runAll("modules.loaded") + return status end hook.registerType("config.loaded") hook.registerType("config.reloaded") +hook.registerType("modules.loaded") return config Modified: stable/11/stand/lua/loader.lua ============================================================================== --- stable/11/stand/lua/loader.lua Tue Jan 28 01:39:50 2020 (r357190) +++ stable/11/stand/lua/loader.lua Tue Jan 28 02:42:33 2020 (r357191) @@ -42,14 +42,14 @@ local password = require("password") -- need it. local menu -try_include("local") - config.load() + -- Our console may have been setup for a different color scheme before we get -- here, so make sure we set the default. if color.isEnabled() then printc(color.default()) end +try_include("local") if not core.isMenuSkipped() then menu = require("menu") end From owner-svn-src-all@freebsd.org Tue Jan 28 02:42:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD36E2383CF; Tue, 28 Jan 2020 02:42:34 +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 4869rV450Dz4XpM; Tue, 28 Jan 2020 02:42:34 +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 876801C20E; Tue, 28 Jan 2020 02:42:34 +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 00S2gY3U046656; Tue, 28 Jan 2020 02:42:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S2gYXD046654; Tue, 28 Jan 2020 02:42:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280242.00S2gYXD046654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 02:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357191 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 357191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 02:42:34 -0000 Author: kevans Date: Tue Jan 28 02:42:33 2020 New Revision: 357191 URL: https://svnweb.freebsd.org/changeset/base/357191 Log: MFC r357103-r357104: unbreak local.lua, add a modules.loaded hook r357103: loader.lua: re-arrange to load local.lua *after* config loading The major problem with the current ordering is that loader.conf may contain all of the magic we need to actually setup the console, so loading local.lua prior to that can make it excessively difficult and annoying to debug (whoops, sorry Ravi & Warner). The new ordering has some implications, but I suspect they are a non-issue. The first is that it's no longer possible for the local module to inject any logic prior to loading config -- I suspect no one has relied on this. The second implication is that the config.loaded hook is now useless, as the local module will always be included after that hook would have fired. For config.loaded, I will opt to leave it in, just in case we add an early point for local lua to get injected or in case one wants to schedule some deferred logic in a custom loader.lua. The overhead of having it if no hooks will be invoked is relatively minimal. r357104: lua: add modules.loaded hook This may be used for the local module to hook in and load any additional modules that it wants, since it can't modify the modules table internal to config. We may consider adding API to do so at a later time, but I suspect it will be more complicated to use with little return. status is captured but ignored for the purpose of loading the hook. status will be false if *any* module failed to load, but we typically don't let that halt the boot so there's no reason to let it halt hooks. Some vendors or setups may have expected fails that would be actively thwarted by checking it. We may, at a later date, consider adding an API for letting non-config modules check which modules have successfully (or not) loaded in case an unexpected failure *should* halt whatever they are doing. Modified: stable/12/stand/lua/config.lua stable/12/stand/lua/loader.lua Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/lua/config.lua stable/11/stand/lua/loader.lua Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/lua/config.lua ============================================================================== --- stable/12/stand/lua/config.lua Tue Jan 28 01:39:50 2020 (r357190) +++ stable/12/stand/lua/config.lua Tue Jan 28 02:42:33 2020 (r357191) @@ -623,7 +623,7 @@ end function config.loadelf() local xen_kernel = loader.getenv('xen_kernel') local kernel = config.kernel_selected or config.kernel_loaded - local loaded + local loaded, status if xen_kernel ~= nil then print(MSG_XENKERNLOADING) @@ -640,9 +640,12 @@ function config.loadelf() end print(MSG_MODLOADING) - return loadModule(modules, not config.verbose) + status = loadModule(modules, not config.verbose) + hook.runAll("modules.loaded") + return status end hook.registerType("config.loaded") hook.registerType("config.reloaded") +hook.registerType("modules.loaded") return config Modified: stable/12/stand/lua/loader.lua ============================================================================== --- stable/12/stand/lua/loader.lua Tue Jan 28 01:39:50 2020 (r357190) +++ stable/12/stand/lua/loader.lua Tue Jan 28 02:42:33 2020 (r357191) @@ -42,14 +42,14 @@ local password = require("password") -- need it. local menu -try_include("local") - config.load() + -- Our console may have been setup for a different color scheme before we get -- here, so make sure we set the default. if color.isEnabled() then printc(color.default()) end +try_include("local") if not core.isMenuSkipped() then menu = require("menu") end From owner-svn-src-all@freebsd.org Tue Jan 28 02:58:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5BD023899F; Tue, 28 Jan 2020 02:58:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486BC35J5nz4YWk; Tue, 28 Jan 2020 02:58:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B10D41C3DF; Tue, 28 Jan 2020 02:58:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S2wd3u052994; Tue, 28 Jan 2020 02:58:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S2wdDM052993; Tue, 28 Jan 2020 02:58:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280258.00S2wdDM052993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 02:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357192 - in stable: 11/secure/caroot 12/secure/caroot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/secure/caroot 12/secure/caroot X-SVN-Commit-Revision: 357192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 02:58:39 -0000 Author: kevans Date: Tue Jan 28 02:58:39 2020 New Revision: 357192 URL: https://svnweb.freebsd.org/changeset/base/357192 Log: MFC r357084: caroot: use bsd.obj.mk, not bsd.prog.mk This directory stages certdata into .OBJDIR and processes it, but does not actually build a prog-shaped object; bsd.obj.mk provides the minimal support that we actually need, an .OBJDIR and descent into subdirs. This is admittedly the nittiest of nits. Modified: stable/11/secure/caroot/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/secure/caroot/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/secure/caroot/Makefile ============================================================================== --- stable/11/secure/caroot/Makefile Tue Jan 28 02:42:33 2020 (r357191) +++ stable/11/secure/caroot/Makefile Tue Jan 28 02:58:39 2020 (r357192) @@ -7,10 +7,9 @@ CLEANFILES+= certdata.txt SUBDIR+= trusted SUBDIR+= blacklisted -.include +.include # To be used by secteam@ to update the trusted certificates - fetchcerts: .PHONY fetch --no-sslv3 --no-tlsv1 -o certdata.txt 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt' From owner-svn-src-all@freebsd.org Tue Jan 28 02:58:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C7B62389A4; Tue, 28 Jan 2020 02:58:40 +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 486BC40SSGz4YWl; Tue, 28 Jan 2020 02:58:40 +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 0AF0C1C3E0; Tue, 28 Jan 2020 02:58:40 +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 00S2wdXa053001; Tue, 28 Jan 2020 02:58:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S2wd7b053000; Tue, 28 Jan 2020 02:58:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280258.00S2wd7b053000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 02:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357192 - in stable: 11/secure/caroot 12/secure/caroot X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/secure/caroot 12/secure/caroot X-SVN-Commit-Revision: 357192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 02:58:40 -0000 Author: kevans Date: Tue Jan 28 02:58:39 2020 New Revision: 357192 URL: https://svnweb.freebsd.org/changeset/base/357192 Log: MFC r357084: caroot: use bsd.obj.mk, not bsd.prog.mk This directory stages certdata into .OBJDIR and processes it, but does not actually build a prog-shaped object; bsd.obj.mk provides the minimal support that we actually need, an .OBJDIR and descent into subdirs. This is admittedly the nittiest of nits. Modified: stable/12/secure/caroot/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/secure/caroot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/secure/caroot/Makefile ============================================================================== --- stable/12/secure/caroot/Makefile Tue Jan 28 02:42:33 2020 (r357191) +++ stable/12/secure/caroot/Makefile Tue Jan 28 02:58:39 2020 (r357192) @@ -7,10 +7,9 @@ CLEANFILES+= certdata.txt SUBDIR+= trusted SUBDIR+= blacklisted -.include +.include # To be used by secteam@ to update the trusted certificates - fetchcerts: .PHONY fetch --no-sslv3 --no-tlsv1 -o certdata.txt 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt' From owner-svn-src-all@freebsd.org Tue Jan 28 03:02:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4099238CE5; Tue, 28 Jan 2020 03:02:18 +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 486BHG41YFz4Z97; Tue, 28 Jan 2020 03:02:18 +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 854611C4B7; Tue, 28 Jan 2020 03:02:18 +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 00S32IJH059588; Tue, 28 Jan 2020 03:02:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S32IdW059564; Tue, 28 Jan 2020 03:02:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280302.00S32IdW059564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 03:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357193 - head/secure/caroot/blacklisted X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/secure/caroot/blacklisted X-SVN-Commit-Revision: 357193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 03:02:18 -0000 Author: kevans Date: Tue Jan 28 03:02:18 2020 New Revision: 357193 URL: https://svnweb.freebsd.org/changeset/base/357193 Log: caroot: blacklisted: automatically pick up *.pem in the tree This kind of automagica got picked up in trusted/ prior to the initial commit, but never got applied over in blacklisted. Ideally no one will be using blacklisted/ to store arbitrary certs that they don't intend to blacklist, so we should just install anything that's in here rather than force consumer to first copy cert into place and then modify the file listing in the Makefile. Wise man once say: "it is better to restrict too much, than not enough. sometimes." Modified: head/secure/caroot/blacklisted/Makefile Modified: head/secure/caroot/blacklisted/Makefile ============================================================================== --- head/secure/caroot/blacklisted/Makefile Tue Jan 28 02:58:39 2020 (r357192) +++ head/secure/caroot/blacklisted/Makefile Tue Jan 28 03:02:18 2020 (r357193) @@ -2,6 +2,8 @@ BINDIR= /usr/share/certs/blacklisted -FILES= +BLACKLISTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true + +FILES+= ${BLACKLISTED_CERTS} .include From owner-svn-src-all@freebsd.org Tue Jan 28 03:27:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E74D239495; Tue, 28 Jan 2020 03:27:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486Bqt6QnLz4b9x; Tue, 28 Jan 2020 03:27:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D76991C9DB; Tue, 28 Jan 2020 03:27:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00S3R6h5071796; Tue, 28 Jan 2020 03:27:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S3R6m8071795; Tue, 28 Jan 2020 03:27:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001280327.00S3R6m8071795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 Jan 2020 03:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357194 - head/sys/dev/amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/amdtemp X-SVN-Commit-Revision: 357194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 03:27:07 -0000 Author: cem Date: Tue Jan 28 03:27:06 2020 New Revision: 357194 URL: https://svnweb.freebsd.org/changeset/base/357194 Log: amdtemp(4): Remove dead code that snuck in with r357190 I intended to remove this before committing, but neglected to. Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 03:02:18 2020 (r357193) +++ head/sys/dev/amdtemp/amdtemp.c Tue Jan 28 03:27:06 2020 (r357194) @@ -760,11 +760,6 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) ("sensor %d: not valid", (int)sensor)); return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); default: -#if 0 - KASSERT(false, ("%s: invalid sensor %d", __func__, - (int)sensor)); - return (-1); -#endif __unreachable(); } } From owner-svn-src-all@freebsd.org Tue Jan 28 03:47:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC25E239E60; Tue, 28 Jan 2020 03:47:29 +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 486CHP4d0hz4cHV; Tue, 28 Jan 2020 03:47:29 +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 99E911CDAE; Tue, 28 Jan 2020 03:47:29 +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 00S3lTuC083691; Tue, 28 Jan 2020 03:47:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S3lTmQ083690; Tue, 28 Jan 2020 03:47:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001280347.00S3lTmQ083690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jan 2020 03:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357195 - head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/c063 X-SVN-Commit-Revision: 357195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 03:47:29 -0000 Author: kevans Date: Tue Jan 28 03:47:29 2020 New Revision: 357195 URL: https://svnweb.freebsd.org/changeset/base/357195 Log: netbsd-tests: libc: use correct modes in O_SEARCH tests The current code clearly intended for these to be octal based on the values used, but the octal prefix was forgotten. Add it now for correctness, but note that we don't currently execute these tests. This has been submitted upstream as misc/54902, so I've omitted the standard FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate identification. Reviewed by: ngie MFC after: 3 days Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Modified: head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Tue Jan 28 03:27:06 2020 (r357194) +++ head/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Tue Jan 28 03:47:29 2020 (r357195) @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); From owner-svn-src-all@freebsd.org Tue Jan 28 07:49:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9D1623F7BA; Tue, 28 Jan 2020 07:49:52 +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 486Jg44YxYz4p5w; Tue, 28 Jan 2020 07:49:52 +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 97E3B1F9EA; Tue, 28 Jan 2020 07:49:52 +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 00S7nq8j027202; Tue, 28 Jan 2020 07:49:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00S7nqY8027201; Tue, 28 Jan 2020 07:49:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001280749.00S7nqY8027201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 28 Jan 2020 07:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357196 - stable/12/sbin/fsck_msdosfs X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/fsck_msdosfs X-SVN-Commit-Revision: 357196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 07:49:52 -0000 Author: delphij Date: Tue Jan 28 07:49:52 2020 New Revision: 357196 URL: https://svnweb.freebsd.org/changeset/base/357196 Log: MFC r356629, r356636 r356629: Apply typo fix from NetBSD, we have already applied all NetBSD changes so update the NetBSD tag while I'm there. r356636: Correct off-by-two issue when determining FAT type. In the code we used NumClusters as the upper (non-inclusive) boundary of valid cluster number, so the actual value was 2 (CLUST_FIRST) more than the real number of clusters. This causes a FAT16 media with 65524 clusters be treated as FAT32 and might affect FAT12 media with 4084 clusters as well. To fix this, we increment NumClusters by CLUST_FIRST after the type determination. PR: 243179 Modified: stable/12/sbin/fsck_msdosfs/boot.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/12/sbin/fsck_msdosfs/boot.c Tue Jan 28 03:47:29 2020 (r357195) +++ stable/12/sbin/fsck_msdosfs/boot.c Tue Jan 28 07:49:52 2020 (r357196) @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: boot.c,v 1.11 2006/06/05 16:51:18 christos Exp "); +__RCSID("$NetBSD: boot.c,v 1.21 2018/02/08 09:05:17 dholland Exp $"); static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ @@ -269,8 +269,11 @@ readboot(int dosfs, struct bootblock *boot) return FSFATAL; } - boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust + - CLUST_FIRST; + /* + * The number of clusters is derived from available data sectors, divided + * by sectors per cluster. + */ + boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust; if (boot->flags & FAT32) boot->ClustMask = CLUST32_MASK; @@ -296,11 +299,19 @@ readboot(int dosfs, struct bootblock *boot) break; } - if (boot->NumFatEntries < boot->NumClusters - CLUST_FIRST) { + if (boot->NumFatEntries < boot->NumClusters) { pfatal("FAT size too small, %u entries won't fit into %u sectors\n", boot->NumClusters, boot->FATsecs); return FSFATAL; } + + /* + * There are two reserved clusters. To avoid adding CLUST_FIRST every time + * when we perform boundary checks, we increment the NumClusters by 2, + * which is CLUST_FIRST to denote the first out-of-range cluster number. + */ + boot->NumClusters += CLUST_FIRST; + boot->ClusterSize = boot->bpbBytesPerSec * boot->bpbSecPerClust; boot->NumFiles = 1; @@ -342,7 +353,7 @@ writefsinfo(int dosfs, struct bootblock *boot) * support for FAT32) doesn't maintain the FSINFO block * correctly, it has to be fixed pretty often. * - * Therefor, we handle the FSINFO block only informally, + * Therefore, we handle the FSINFO block only informally, * fixing it if necessary, but otherwise ignoring the * fact that it was incorrect. */ From owner-svn-src-all@freebsd.org Tue Jan 28 10:09:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B27381FCB20; Tue, 28 Jan 2020 10:09:06 +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 486Mlk4G8Fz3CWw; Tue, 28 Jan 2020 10:09:06 +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 8D71B21401; Tue, 28 Jan 2020 10:09:06 +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 00SA96OS012468; Tue, 28 Jan 2020 10:09:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SA96FO012467; Tue, 28 Jan 2020 10:09:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001281009.00SA96FO012467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 28 Jan 2020 10:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357197 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 10:09:06 -0000 Author: tuexen Date: Tue Jan 28 10:09:05 2020 New Revision: 357197 URL: https://svnweb.freebsd.org/changeset/base/357197 Log: Fix build issues for the userland stack on 32-bit platforms. Reported by: Felix Weinrank MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue Jan 28 07:49:52 2020 (r357196) +++ head/sys/netinet/sctp_asconf.c Tue Jan 28 10:09:05 2020 (r357197) @@ -105,7 +105,7 @@ sctp_asconf_error_response(uint32_t id, uint16_t cause struct mbuf *m_reply = NULL; struct sctp_asconf_paramhdr *aph; struct sctp_error_cause *error; - size_t buf_len; + uint32_t buf_len; uint16_t i, param_length, cause_length, padding_length; uint8_t *tlv; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Jan 28 07:49:52 2020 (r357196) +++ head/sys/netinet/sctp_output.c Tue Jan 28 10:09:05 2020 (r357197) @@ -6885,7 +6885,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, /* There is another. */ return (EBUSY); } - if (uio->uio_resid > SCTP_BASE_SYSCTL(sctp_sendall_limit)) { + if (uio->uio_resid > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { /* You must not be larger than the limit! */ return (EMSGSIZE); } From owner-svn-src-all@freebsd.org Tue Jan 28 11:22:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 002571FF64A; Tue, 28 Jan 2020 11:22:21 +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 486PND608Gz3J6j; Tue, 28 Jan 2020 11:22:20 +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 C902722313; Tue, 28 Jan 2020 11:22:20 +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 00SBMKSH061767; Tue, 28 Jan 2020 11:22:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SBMKrd061766; Tue, 28 Jan 2020 11:22:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001281122.00SBMKrd061766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Jan 2020 11:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357198 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 357198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 11:22:21 -0000 Author: kib Date: Tue Jan 28 11:22:20 2020 New Revision: 357198 URL: https://svnweb.freebsd.org/changeset/base/357198 Log: Provide support for fdevname(3) on linuxkpi-backed devices. Reported and tested by: manu Reviewed by: hselasky, manu Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23386 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 28 10:09:05 2020 (r357197) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Jan 28 11:22:20 2020 (r357198) @@ -1526,7 +1526,9 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da struct linux_file *filp; const struct file_operations *fop; struct linux_cdev *ldev; - int error; + struct fiodgname_arg *fgn; + const char *p; + int error, i; error = 0; filp = (struct linux_file *)fp->f_data; @@ -1553,6 +1555,23 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da break; case FIOGETOWN: *(int *)data = fgetown(&filp->f_sigio); + break; + case FIODGNAME: +#ifdef COMPAT_FREEBSD32 + case FIODGNAME_32: +#endif + if (filp->f_cdev == NULL || filp->f_cdev->cdev == NULL) { + error = ENXIO; + break; + } + fgn = data; + p = devtoname(filp->f_cdev->cdev); + i = strlen(p) + 1; + if (i > fgn->len) { + error = EINVAL; + break; + } + error = copyout(p, fiodgname_buf_get_ptr(fgn, cmd), i); break; default: error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); From owner-svn-src-all@freebsd.org Tue Jan 28 11:29:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF6A1FF8C8; Tue, 28 Jan 2020 11:29: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 486PX32v8zz3JMD; Tue, 28 Jan 2020 11:29: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 5E86E2235C; Tue, 28 Jan 2020 11:29: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 00SBT7TU063191; Tue, 28 Jan 2020 11:29:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SBT6AJ063186; Tue, 28 Jan 2020 11:29:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001281129.00SBT6AJ063186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Jan 2020 11:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357199 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 357199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 11:29:07 -0000 Author: kib Date: Tue Jan 28 11:29:06 2020 New Revision: 357199 URL: https://svnweb.freebsd.org/changeset/base/357199 Log: Save lower root vnode in nullfs mnt data instead of upper. Nullfs needs to know the root vnode of the lower fs during the operation. Currently it caches the upper vnode of it, which is also the root of the nullfs mount. On unmount, nullfs calls vflush() with rootrefs == 1, and aborts non-forced unmount if there are any more vnodes instantiated during vflush(). This means that the reference to the root vnode after failed non-forced unmount could be lost and nullm_rootvp points to the freed memory. Fix it by storing the reference for lower vnode instead, which is kept intact during vflush(). nullfs_root() now instantiates the upper vnode of lower root. Care about VV_ROOT flag in null_nodeget(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null.h head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null.h ============================================================================== --- head/sys/fs/nullfs/null.h Tue Jan 28 11:22:20 2020 (r357198) +++ head/sys/fs/nullfs/null.h Tue Jan 28 11:29:06 2020 (r357199) @@ -43,7 +43,7 @@ struct null_mount { struct mount *nullm_vfs; - struct vnode *nullm_rootvp; /* Reference to root null_node */ + struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ uint64_t nullm_flags; }; Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Tue Jan 28 11:22:20 2020 (r357198) +++ head/sys/fs/nullfs/null_subr.c Tue Jan 28 11:29:06 2020 (r357199) @@ -252,6 +252,8 @@ null_nodeget(mp, lowervp, vpp) vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; + if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) + vp->v_vflag |= VV_ROOT; error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Tue Jan 28 11:22:20 2020 (r357198) +++ head/sys/fs/nullfs/null_vfsops.c Tue Jan 28 11:29:06 2020 (r357199) @@ -74,7 +74,7 @@ static vfs_extattrctl_t nullfs_extattrctl; static int nullfs_mount(struct mount *mp) { - struct vnode *lowerrootvp, *vp; + struct vnode *lowerrootvp; struct vnode *nullm_rootvp; struct null_mount *xmp; struct null_node *nn; @@ -158,36 +158,24 @@ nullfs_mount(struct mount *mp) M_NULLFSMNT, M_WAITOK | M_ZERO); /* - * Save reference to underlying FS + * Save pointer to underlying FS and the reference to the + * lower root vnode. */ xmp->nullm_vfs = lowerrootvp->v_mount; + vref(lowerrootvp); + xmp->nullm_lowerrootvp = lowerrootvp; + mp->mnt_data = xmp; /* - * Save reference. Each mount also holds - * a reference on the root vnode. + * Make sure the node alias worked. */ - error = null_nodeget(mp, lowerrootvp, &vp); - /* - * Make sure the node alias worked - */ - if (error) { + error = null_nodeget(mp, lowerrootvp, &nullm_rootvp); + if (error != 0) { + vrele(lowerrootvp); free(xmp, M_NULLFSMNT); return (error); } - /* - * Keep a held reference to the root vnode. - * It is vrele'd in nullfs_unmount. - */ - nullm_rootvp = vp; - nullm_rootvp->v_vflag |= VV_ROOT; - xmp->nullm_rootvp = nullm_rootvp; - - /* - * Unlock the node (either the lower or the alias) - */ - VOP_UNLOCK(vp); - if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) { MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; @@ -209,7 +197,6 @@ nullfs_mount(struct mount *mp) mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & (MNTK_USES_BCACHE | MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS); MNT_IUNLOCK(mp); - mp->mnt_data = xmp; vfs_getnewfsid(mp); if ((xmp->nullm_flags & NULLM_CACHE) != 0) { MNT_ILOCK(xmp->nullm_vfs); @@ -219,6 +206,7 @@ nullfs_mount(struct mount *mp) } vfs_mountedfrom(mp, target); + vput(nullm_rootvp); NULLFSDEBUG("nullfs_mount: lower %s, alias at %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); @@ -235,7 +223,7 @@ nullfs_unmount(mp, mntflags) { struct null_mount *mntdata; struct mount *ump; - int error, flags, rootrefs; + int error, flags; NULLFSDEBUG("nullfs_unmount: mp = %p\n", (void *)mp); @@ -244,9 +232,9 @@ nullfs_unmount(mp, mntflags) else flags = 0; - for (rootrefs = 1;; rootrefs = 0) { + for (;;) { /* There is 1 extra root vnode reference (nullm_rootvp). */ - error = vflush(mp, rootrefs, flags, curthread); + error = vflush(mp, 0, flags, curthread); if (error) return (error); MNT_ILOCK(mp); @@ -273,6 +261,7 @@ nullfs_unmount(mp, mntflags) TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); MNT_IUNLOCK(ump); } + vrele(mntdata->nullm_lowerrootvp); mp->mnt_data = NULL; free(mntdata, M_NULLFSMNT); return (0); @@ -285,21 +274,24 @@ nullfs_root(mp, flags, vpp) struct vnode **vpp; { struct vnode *vp; + struct null_mount *mntdata; + int error; - NULLFSDEBUG("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp, - (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, - (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); + mntdata = MOUNTTONULLMOUNT(mp); + NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", mp, + mntdata->nullm_lowerrootvp); - /* - * Return locked reference to root. - */ - vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; - VREF(vp); - - ASSERT_VOP_UNLOCKED(vp, "root vnode is locked"); - vn_lock(vp, flags | LK_RETRY); - *vpp = vp; - return 0; + error = vget(mntdata->nullm_lowerrootvp, (flags & ~LK_TYPE_MASK) | + LK_EXCLUSIVE, curthread); + if (error == 0) { + error = null_nodeget(mp, mntdata->nullm_lowerrootvp, &vp); + if (error == 0) { + if ((flags & LK_TYPE_MASK) == LK_SHARED) + vn_lock(vp, LK_DOWNGRADE | LK_RETRY); + *vpp = vp; + } + } + return (error); } static int From owner-svn-src-all@freebsd.org Tue Jan 28 11:33:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B37851FFDF1; Tue, 28 Jan 2020 11:33:15 +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 486Pcq4Fz9z3Jp8; Tue, 28 Jan 2020 11:33:15 +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 8CDE822534; Tue, 28 Jan 2020 11:33:15 +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 00SBXFOS069056; Tue, 28 Jan 2020 11:33:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SBXDNl069043; Tue, 28 Jan 2020 11:33:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001281133.00SBXDNl069043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 28 Jan 2020 11:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357200 - in stable/12: stand/i386/libi386 sys/amd64/amd64 sys/i386/i386 sys/x86/cpufreq sys/x86/include sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: stand/i386/libi386 sys/amd64/amd64 sys/i386/i386 sys/x86/cpufreq sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 357200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 11:33:15 -0000 Author: kib Date: Tue Jan 28 11:33:12 2020 New Revision: 357200 URL: https://svnweb.freebsd.org/changeset/base/357200 Log: MFC r356940: Add support for Hygon Dhyana Family 18h processor. Modified: stable/12/stand/i386/libi386/bootinfo64.c stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/i386/i386/machdep.c stable/12/sys/x86/cpufreq/hwpstate.c stable/12/sys/x86/include/cputypes.h stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/x86/identcpu.c stable/12/sys/x86/x86/local_apic.c stable/12/sys/x86/x86/mca.c stable/12/sys/x86/x86/mp_x86.c stable/12/sys/x86/x86/msi.c stable/12/sys/x86/x86/tsc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/bootinfo64.c ============================================================================== --- stable/12/stand/i386/libi386/bootinfo64.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/stand/i386/libi386/bootinfo64.c Tue Jan 28 11:33:12 2020 (r357200) @@ -158,6 +158,7 @@ bi_checkcpu(void) /* Check for vendors that support AMD features. */ if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, HYGON_VENDOR_ID, 12) != 0 && strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) return (0); Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/amd64/amd64/initcpu.c Tue Jan 28 11:33:12 2020 (r357200) @@ -171,7 +171,8 @@ init_amd(void) */ if (lower_sharedpage_init == 0) { lower_sharedpage_init = 1; - if (CPUID_TO_FAMILY(cpu_id) == 0x17) { + if (CPUID_TO_FAMILY(cpu_id) == 0x17 || + CPUID_TO_FAMILY(cpu_id) == 0x18) { hw_lower_amd64_sharedpage = 1; } } @@ -259,6 +260,7 @@ initializecpu(void) amd64_syscall_ret_flush_l1d_recalc(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: init_amd(); break; case CPU_VENDOR_CENTAUR: Modified: stable/12/sys/i386/i386/machdep.c ============================================================================== --- stable/12/sys/i386/i386/machdep.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/i386/i386/machdep.c Tue Jan 28 11:33:12 2020 (r357200) @@ -1621,8 +1621,9 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs) if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) db_printf("FEATURES_CTL\t0x%016llx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - if ((cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + if (((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) || + cpu_vendor_id == CPU_VENDOR_HYGON) db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); if (cpu_feature & CPUID_PAT) db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); Modified: stable/12/sys/x86/cpufreq/hwpstate.c ============================================================================== --- stable/12/sys/x86/cpufreq/hwpstate.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/cpufreq/hwpstate.c Tue Jan 28 11:33:12 2020 (r357200) @@ -315,7 +315,8 @@ hwpstate_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "hwpstate", -1) != NULL) return; - if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) + if ((cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) && + cpu_vendor_id != CPU_VENDOR_HYGON) return; /* @@ -446,6 +447,7 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; case 0x17: + case 0x18: did = AMD_17H_CUR_DID(msr); if (did == 0) { HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); @@ -455,8 +457,10 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (200 * fid) / did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" - " 0x%02x CPUs are not supported yet\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: %s family" + " 0x%02x CPUs are not supported yet\n", + cpu_vendor_id == CPU_VENDOR_HYGON ? "Hygon" : "AMD", + family); return (ENXIO); } hwpstate_set[i].pstate_id = i; Modified: stable/12/sys/x86/include/cputypes.h ============================================================================== --- stable/12/sys/x86/include/cputypes.h Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/include/cputypes.h Tue Jan 28 11:33:12 2020 (r357200) @@ -45,5 +45,6 @@ #define CPU_VENDOR_INTEL 0x8086 /* Intel */ #define CPU_VENDOR_RISE 0xdead2bad /* Rise */ #define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT +#define CPU_VENDOR_HYGON 0x1d94 /* Hygon */ #endif /* !_X86_CPUTYPES_H_ */ Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/include/specialreg.h Tue Jan 28 11:33:12 2020 (r357200) @@ -468,6 +468,7 @@ #define SIS_VENDOR_ID "SiS SiS SiS " #define TRANSMETA_VENDOR_ID "GenuineTMx86" #define UMC_VENDOR_ID "UMC UMC UMC " +#define HYGON_VENDOR_ID "HygonGenuine" /* * Model-specific registers for the i386 family Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/identcpu.c Tue Jan 28 11:33:12 2020 (r357200) @@ -215,6 +215,7 @@ static struct { } cpu_vendors[] = { { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ + { HYGON_VENDOR_ID, CPU_VENDOR_HYGON }, /* HygonGenuine*/ { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ #ifdef __i386__ { NSC_VENDOR_ID, CPU_VENDOR_NSC }, /* Geode by NSC */ @@ -674,6 +675,18 @@ printcpuinfo(void) } break; #endif + case CPU_VENDOR_HYGON: + strcpy(cpu_model, "Hygon "); +#ifdef __i386__ + strcat(cpu_model, "Unknown"); +#else + if ((cpu_id & 0xf00) == 0xf00) + strcat(cpu_model, "AMD64 Processor"); + else + strcat(cpu_model, "Unknown"); +#endif + break; + default: strcat(cpu_model, "Unknown"); break; @@ -733,6 +746,7 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_CENTAUR || #ifdef __i386__ cpu_vendor_id == CPU_VENDOR_TRANSMETA || @@ -1051,7 +1065,8 @@ printcpuinfo(void) print_svm_info(); if ((cpu_feature & CPUID_HTT) && - cpu_vendor_id == CPU_VENDOR_AMD) + (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON)) cpu_feature &= ~CPUID_HTT; /* @@ -1081,7 +1096,8 @@ printcpuinfo(void) printf("\n"); if (bootverbose) { - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) print_AMD_info(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) print_INTEL_info(); @@ -1520,6 +1536,7 @@ finishidentcpu(void) if (cpu_high > 0 && (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_TRANSMETA || cpu_vendor_id == CPU_VENDOR_CENTAUR || cpu_vendor_id == CPU_VENDOR_NSC)) { @@ -1530,6 +1547,7 @@ finishidentcpu(void) #else if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; @@ -1649,7 +1667,8 @@ int pti_get_default(void) { - if (strcmp(cpu_vendor, AMD_VENDOR_ID) == 0) + if (strcmp(cpu_vendor, AMD_VENDOR_ID) == 0 || + strcmp(cpu_vendor, HYGON_VENDOR_ID) == 0) return (0); if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) != 0) return (0); Modified: stable/12/sys/x86/x86/local_apic.c ============================================================================== --- stable/12/sys/x86/x86/local_apic.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/local_apic.c Tue Jan 28 11:33:12 2020 (r357200) @@ -676,7 +676,8 @@ amd_read_ext_features(void) { uint32_t version; - if (cpu_vendor_id != CPU_VENDOR_AMD) + if (cpu_vendor_id != CPU_VENDOR_AMD && + cpu_vendor_id != CPU_VENDOR_HYGON) return (0); version = lapic_read32(LAPIC_VERSION); if ((version & APIC_VER_AMD_EXT_SPACE) != 0) Modified: stable/12/sys/x86/x86/mca.c ============================================================================== --- stable/12/sys/x86/x86/mca.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/mca.c Tue Jan 28 11:33:12 2020 (r357200) @@ -134,7 +134,8 @@ static int amd_elvt = -1; static inline bool amd_thresholding_supported(void) { - if (cpu_vendor_id != CPU_VENDOR_AMD) + if (cpu_vendor_id != CPU_VENDOR_AMD && + cpu_vendor_id != CPU_VENDOR_HYGON) return (false); /* * The RASCap register is wholly reserved in families 0x10-0x15 (through model 1F). Modified: stable/12/sys/x86/x86/mp_x86.c ============================================================================== --- stable/12/sys/x86/x86/mp_x86.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/mp_x86.c Tue Jan 28 11:33:12 2020 (r357200) @@ -508,7 +508,8 @@ topo_probe(void) if (mp_ncpus <= 1) ; /* nothing */ - else if (cpu_vendor_id == CPU_VENDOR_AMD) + else if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) topo_probe_intel(); Modified: stable/12/sys/x86/x86/msi.c ============================================================================== --- stable/12/sys/x86/x86/msi.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/msi.c Tue Jan 28 11:33:12 2020 (r357200) @@ -319,6 +319,7 @@ msi_init(void) switch (cpu_vendor_id) { case CPU_VENDOR_INTEL: case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: break; case CPU_VENDOR_CENTAUR: if (CPUID_TO_FAMILY(cpu_id) == 0x6 && Modified: stable/12/sys/x86/x86/tsc.c ============================================================================== --- stable/12/sys/x86/x86/tsc.c Tue Jan 28 11:29:06 2020 (r357199) +++ stable/12/sys/x86/x86/tsc.c Tue Jan 28 11:33:12 2020 (r357200) @@ -254,6 +254,7 @@ probe_tsc_freq(void) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || (vm_guest == VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >= 0x10)) @@ -517,6 +518,7 @@ retry: if (smp_tsc && tsc_is_invariant) { switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: /* * Starting with Family 15h processors, TSC clock * source is in the north bridge. Check whether @@ -614,7 +616,8 @@ init: for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++) ; if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) { - if (cpu_vendor_id == CPU_VENDOR_AMD) { + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) { tsc_timecounter.tc_get_timecount = shift > 0 ? tsc_get_timecount_low_mfence : tsc_get_timecount_mfence; From owner-svn-src-all@freebsd.org Tue Jan 28 13:13:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8537E22C856; Tue, 28 Jan 2020 13:13:57 +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 486Rs13N8Sz3R7q; Tue, 28 Jan 2020 13:13:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EBD923853; Tue, 28 Jan 2020 13:13:57 +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 00SDDvbj030432; Tue, 28 Jan 2020 13:13:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SDDfhI030414; Tue, 28 Jan 2020 13:13:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001281313.00SDDfhI030414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 28 Jan 2020 13:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357201 - in head/contrib/sqlite3: . tea tea/generic tea/win X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea tea/generic tea/win X-SVN-Commit-Revision: 357201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 13:13:57 -0000 Author: cy Date: Tue Jan 28 13:13:41 2020 New Revision: 357201 URL: https://svnweb.freebsd.org/changeset/base/357201 Log: MFV r357163: Update sqlite3-3.30.1 (3300100) --> sqlite3-3.31.0 (3310000) MFC after: 1 month Modified: head/contrib/sqlite3/Makefile.msc head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac head/contrib/sqlite3/tea/generic/tclsqlite3.c head/contrib/sqlite3/tea/win/makefile.vc Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.msc ============================================================================== --- head/contrib/sqlite3/Makefile.msc Tue Jan 28 11:33:12 2020 (r357200) +++ head/contrib/sqlite3/Makefile.msc Tue Jan 28 13:13:41 2020 (r357201) @@ -210,6 +210,12 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF +# Set this to non-0 to enable support for the rbu extension. +# +!IFNDEF RBU +RBU = 0 +!ENDIF + # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -282,7 +288,6 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -296,6 +301,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Should the rbu extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(RBU)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 +!ENDIF + # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -978,7 +990,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Tue Jan 28 11:33:12 2020 (r357200) +++ head/contrib/sqlite3/configure Tue Jan 28 13:13:41 2020 (r357201) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.31.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.30.1' -PACKAGE_STRING='sqlite 3.30.1' +PACKAGE_VERSION='3.31.0' +PACKAGE_STRING='sqlite 3.31.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.31.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.30.1:";; + short | recursive ) echo "Configuration of sqlite 3.31.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.30.1 +sqlite configure 3.31.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.30.1, which was +It was created by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.30.1' + VERSION='3.31.0' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.30.1, which was +This file was extended by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.30.1 +sqlite config.status 3.31.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Tue Jan 28 11:33:12 2020 (r357200) +++ head/contrib/sqlite3/configure.ac Tue Jan 28 13:13:41 2020 (r357201) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.31.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Tue Jan 28 11:33:12 2020 (r357200) +++ head/contrib/sqlite3/shell.c Tue Jan 28 13:13:41 2020 (r357201) @@ -2007,19 +2007,23 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } return rc; } @@ -2613,6 +2617,7 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3006,10 +3011,12 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "readfile", 1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "writefile", -1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3144,6 +3151,7 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -4578,6 +4586,7 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5190,25 +5199,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - sqlite3_int64 nAlloc = compressBound(nIn); - u8 *aOut; int rc = SQLITE_OK; + sqlite3_int64 nAlloc; + z_stream str; + u8 *aOut; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + + nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; - z_stream str; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; - - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); - if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5517,10 +5526,10 @@ static int zipfileBestIndex( idx = i; } } + pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; - pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5642,8 +5651,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( zA[nA-1]=='/' ) nA--; - if( zB[nB-1]=='/' ) nB--; + if( nA>0 && zA[nA-1]=='/' ) nA--; + if( nB>0 && zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5653,6 +5662,10 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); + if( pTab->zFile==0 || pTab->zFile[0]==0 ){ + pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); + return SQLITE_ERROR; + } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5827,6 +5840,7 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); + if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5836,11 +5850,15 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( zPath[nPath-1]!='/' ){ + if( nPath<=0 || zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); - if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - nPath++; + if( zFree==0 ){ + rc = SQLITE_NOMEM; + nPath = 0; + }else{ + nPath = (int)strlen(zPath); + } } } @@ -6233,19 +6251,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( zName[nName-1]=='/' ){ + if( nName>0 && zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( zName[nName-1]!='/' ){ + if( nName==0 || zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); - nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } + nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6501,10 +6519,12 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6525,8 +6545,8 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ - - +#if !defined(SQLITEEXPERT_H) +#define SQLITEEXPERT_H 1 /* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6680,8 +6700,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); +#endif /* !defined(SQLITEEXPERT_H) */ - /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -9566,6 +9586,7 @@ struct ShellState { int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ + int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ FILE *out; /* Write results here */ FILE *traceOut; /* Output for sqlite3_trace() */ @@ -10400,19 +10421,22 @@ static int shell_callback( const int *colWidth; int showHdr; char *rowSep; + int nWidth; if( p->cMode==MODE_Column ){ colWidth = p->colWidth; + nWidth = ArraySize(p->colWidth); showHdr = p->showHeader; rowSep = p->rowSeparator; }else{ colWidth = aExplainWidths; + nWidth = ArraySize(aExplainWidths); showHdr = 1; rowSep = SEP_Row; } if( p->cnt++==0 ){ for(i=0; icolWidth) ){ + if( idb, SQLITE_DBCONFIG_DEFENSIVE, -1, &defensiveMode); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, @@ -11311,6 +11338,7 @@ static void bind_table_init(ShellState *p){ ") WITHOUT ROWID;", 0, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, defensiveMode, 0); } /* @@ -12053,9 +12081,7 @@ static const char *(azHelp[]) = { ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", ".expert EXPERIMENTAL. Suggest indexes for queries", -/* Because explain mode comes on automatically now, the ".explain" mode -** is removed from the help screen. It is still supported for legacy, however */ -/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ + ".explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto", ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12106,6 +12132,7 @@ static const char *(azHelp[]) = { " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", + " --nofollow Do not follow symbolic links", " --readonly Open FILE readonly", " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", @@ -12670,7 +12697,7 @@ static void open_db(ShellState *p, int openFlags){ switch( p->openMode ){ case SHELL_OPEN_APPENDVFS: { sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs"); + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, "apndvfs"); break; } case SHELL_OPEN_HEXDB: @@ -12683,12 +12710,14 @@ static void open_db(ShellState *p, int openFlags){ break; } case SHELL_OPEN_READONLY: { - sqlite3_open_v2(p->zDbFilename, &p->db, SQLITE_OPEN_READONLY, 0); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READONLY|p->openFlags, 0); break; } case SHELL_OPEN_UNSPEC: case SHELL_OPEN_NORMAL: { - sqlite3_open(p->zDbFilename, &p->db); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, 0); break; } } @@ -13462,7 +13491,7 @@ static unsigned int get4byteInt(unsigned char *a){ } /* -** Implementation of the ".info" command. +** Implementation of the ".dbinfo" command. ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ @@ -15699,20 +15728,22 @@ static int do_meta_command(char *zLine, ShellState *p) const char *zName; int op; } aDbConfig[] = { + { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, + { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, { "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY }, + { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, { "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER }, { "enable_view", SQLITE_DBCONFIG_ENABLE_VIEW }, { "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER }, + { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, + { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT }, { "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION }, { "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE }, - { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, - { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, { "reset_database", SQLITE_DBCONFIG_RESET_DATABASE }, - { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, + { "trusted_schema", SQLITE_DBCONFIG_TRUSTED_SCHEMA }, { "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA }, - { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, - { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, - { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, }; int ii, v; open_db(p, 0); @@ -15722,7 +15753,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_db_config(p->db, aDbConfig[ii].op, booleanValue(azArg[2]), 0); } sqlite3_db_config(p->db, aDbConfig[ii].op, -1, &v); - utf8_printf(p->out, "%18s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); + utf8_printf(p->out, "%19s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); if( nArg>1 ) break; } if( nArg>1 && ii==ArraySize(aDbConfig) ){ @@ -16303,10 +16334,19 @@ static int do_meta_command(char *zLine, ShellState *p) char *zCollist = 0; sqlite3_stmt *pStmt; int tnum = 0; + int isWO = 0; /* True if making an imposter of a WITHOUT ROWID table */ + int lenPK = 0; /* Length of the PRIMARY KEY string for isWO tables */ int i; if( !(nArg==3 || (nArg==2 && sqlite3_stricmp(azArg[1],"off")==0)) ){ utf8_printf(stderr, "Usage: .imposter INDEX IMPOSTER\n" " .imposter off\n"); + /* Also allowed, but not documented: + ** + ** .imposter TABLE IMPOSTER + ** + ** where TABLE is a WITHOUT ROWID table. In that case, the + ** imposter is another WITHOUT ROWID table with the columns in + ** storage order. */ rc = 1; goto meta_command_exit; } @@ -16315,19 +16355,22 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 0, 1); goto meta_command_exit; } - zSql = sqlite3_mprintf("SELECT rootpage FROM sqlite_master" - " WHERE name='%q' AND type='index'", azArg[1]); + zSql = sqlite3_mprintf( + "SELECT rootpage, 0 FROM sqlite_master" + " WHERE name='%q' AND type='index'" + "UNION ALL " + "SELECT rootpage, 1 FROM sqlite_master" + " WHERE name='%q' AND type='table'" + " AND sql LIKE '%%without%%rowid%%'", + azArg[1], azArg[1] + ); sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( sqlite3_step(pStmt)==SQLITE_ROW ){ tnum = sqlite3_column_int(pStmt, 0); + isWO = sqlite3_column_int(pStmt, 1); } sqlite3_finalize(pStmt); - if( tnum==0 ){ - utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); - rc = 1; - goto meta_command_exit; - } zSql = sqlite3_mprintf("PRAGMA index_xinfo='%q'", azArg[1]); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); @@ -16344,6 +16387,9 @@ static int do_meta_command(char *zLine, ShellState *p) zCol = zLabel; } } + if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){ + lenPK = (int)strlen(zCollist); + } if( zCollist==0 ){ zCollist = sqlite3_mprintf("\"%w\"", zCol); }else{ @@ -16351,9 +16397,16 @@ static int do_meta_command(char *zLine, ShellState *p) } } sqlite3_finalize(pStmt); + if( i==0 || tnum==0 ){ + utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); + rc = 1; + sqlite3_free(zCollist); + goto meta_command_exit; + } + if( lenPK==0 ) lenPK = 100000; zSql = sqlite3_mprintf( - "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%s))WITHOUT ROWID", - azArg[2], zCollist, zCollist); + "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%.*s))WITHOUT ROWID", + azArg[2], zCollist, lenPK, zCollist); sqlite3_free(zCollist); rc = sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 1, tnum); if( rc==SQLITE_OK ){ @@ -16364,7 +16417,8 @@ static int do_meta_command(char *zLine, ShellState *p) }else{ utf8_printf(stdout, "%s;\n", zSql); raw_printf(stdout, - "WARNING: writing to an imposter table will corrupt the index!\n" + "WARNING: writing to an imposter table will corrupt the \"%s\" %s!\n", + azArg[1], isWO ? "table" : "index" ); } }else{ @@ -16562,6 +16616,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_free(p->zFreeOnClose); p->zFreeOnClose = 0; p->openMode = SHELL_OPEN_UNSPEC; + p->openFlags = 0; p->szMax = 0; /* Check for command-line arguments */ for(iName=1; iNameopenMode = SHELL_OPEN_APPENDVFS; }else if( optionMatch(z, "readonly") ){ p->openMode = SHELL_OPEN_READONLY; + }else if( optionMatch(z, "nofollow") ){ + p->openFlags |= SQLITE_OPEN_NOFOLLOW; #ifdef SQLITE_ENABLE_DESERIALIZE }else if( optionMatch(z, "deserialize") ){ p->openMode = SHELL_OPEN_DESERIALIZE; @@ -17732,7 +17789,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "" }, { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, @@ -17848,7 +17905,6 @@ static int do_meta_command(char *zLine, ShellState *p) /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: - case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: if( nArg==3 ){ int opt = booleanValue(azArg[2]); rc2 = sqlite3_test_control(testctrl, opt); @@ -17866,6 +17922,12 @@ static int do_meta_command(char *zLine, ShellState *p) } break; + /* sqlite3_test_control(sqlite3*) */ + case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: + rc2 = sqlite3_test_control(testctrl, p->db); + isOk = 3; + break; + case SQLITE_TESTCTRL_IMPOSTER: if( nArg==5 ){ rc2 = sqlite3_test_control(testctrl, p->db, @@ -18496,6 +18558,7 @@ static const char zOptions[] = " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" + " -nofollow refuse to open symbolic links to database files\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" @@ -18806,6 +18869,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags = SQLITE_OPEN_NOFOLLOW; #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) }else if( strncmp(z, "-A",2)==0 ){ /* All remaining command-line arguments are passed to the ".archive" @@ -18909,6 +18974,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags |= SQLITE_OPEN_NOFOLLOW; }else if( strcmp(z,"-ascii")==0 ){ data.mode = MODE_Ascii; sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, Modified: head/contrib/sqlite3/sqlite3.c ============================================================================== --- head/contrib/sqlite3/sqlite3.c Tue Jan 28 11:33:12 2020 (r357200) +++ head/contrib/sqlite3/sqlite3.c Tue Jan 28 13:13:41 2020 (r357201) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.30.1. By combining all the individual C code files into this +** version 3.31.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1165,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.30.1" -#define SQLITE_VERSION_NUMBER 3030001 -#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" +#define SQLITE_VERSION "3.31.0" +#define SQLITE_VERSION_NUMBER 3031000 +#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1558,6 +1558,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) #define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ +#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) @@ -1577,11 +1578,13 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) +#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) +#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations @@ -1610,6 +1613,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ +#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ /* Reserved: 0x00F00000 */ @@ -2021,16 +2025,16 @@ struct sqlite3_io_methods { ** ^The [SQLITE_FCNTL_BUSYHANDLER] ** file-control may be invoked by SQLite on the database file handle ** shortly after it is opened in order to provide a custom VFS with access -** to the connections busy-handler callback. The argument is of type (void **) +** to the connection's busy-handler callback. The argument is of type (void**) ** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connections +** to a function of type (int (*)(void *)). In order to invoke the connection's ** busy-handler, this function should be invoked with the second (void *) in ** the array as the only argument. If it returns non-zero, then the operation ** should be retried. If it returns zero, the custom VFS should abandon the ** current operation. ** **
    • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control ** to have SQLite generate a ** temporary filename using the same algorithm that is followed to generate ** temporary filenames for TEMP tables and other internal uses. The @@ -2143,12 +2147,18 @@ struct sqlite3_io_methods { ** not provide a mechanism to detect changes to MAIN only. Also, the ** [sqlite3_total_changes()] interface responds to internal changes only and ** omits changes made by other database connections. The -** [PRAGMA data_version] command provide a mechanism to detect changes to +** [PRAGMA data_version] command provides a mechanism to detect changes to ** a single attached database that occur due to other database connections, ** but omits changes implemented by the database connection on which it is ** called. This file control is the only mechanism to detect changes that ** happen either internally or externally and that are associated with ** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. **
    */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -2186,6 +2196,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_LOCK_TIMEOUT 34 #define SQLITE_FCNTL_DATA_VERSION 35 #define SQLITE_FCNTL_SIZE_LIMIT 36 +#define SQLITE_FCNTL_CKPT_DONE 37 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -2231,10 +2242,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields ** may be appended to the sqlite3_vfs object and the iVersion value ** may increase again in future versions of SQLite. -** Note that the structure -** of the sqlite3_vfs object changes in the transition from +** Note that due to an oversight, the structure +** of the sqlite3_vfs object changed in the transition from ** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] -** and yet the iVersion field was not modified. +** and yet the iVersion field was not increased. ** ** The szOsFile field is the size of the subclassed [sqlite3_file] ** structure used by this VFS. mxPathname is the maximum length of @@ -2325,7 +2336,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite -** to hold the [sqlite3_file] structure passed as the third +** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that ** the xOpen method must set the sqlite3_file.pMethods to either @@ -2662,7 +2673,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ... ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, -** it might allocate any require mutexes or initialize internal data +** it might allocate any required mutexes or initialize internal data ** structures. The xShutdown method is invoked (indirectly) by ** [sqlite3_shutdown()] and should deallocate any resources acquired ** by xInit. The pAppData pointer is used as the only parameter to @@ -2784,6 +2795,7 @@ struct sqlite3_mem_methods { ** memory allocation statistics. ^(When memory allocation statistics are ** disabled, the following SQLite interfaces become non-operational: **
      +**
    • [sqlite3_hard_heap_limit64()] **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] **
    • [sqlite3_soft_heap_limit64()] @@ -2802,7 +2814,7 @@ struct sqlite3_mem_methods { **
      ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page ** cache implementation. -** This configuration option is a no-op if an application-define page +** This configuration option is a no-op if an application-defined page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to ** 8-byte aligned memory (pMem), the size of each page cache line (sz), @@ -3287,7 +3299,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_DQS_DML]] **
      SQLITE_DBCONFIG_DQS_DML **
      The SQLITE_DBCONFIG_DQS_DML option activates or deactivates -** the legacy [double-quoted string literal] misfeature for DML statement +** the legacy [double-quoted string literal] misfeature for DML statements ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. @@ -3301,6 +3313,49 @@ struct sqlite3_mem_methods { ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. **
      +** +** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] +**
      SQLITE_DBCONFIG_TRUSTED_SCHEMA +**
      The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to +** assume that database schemas (the contents of the [sqlite_master] tables) +** are untainted by malicious content. +** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite +** takes additional defensive steps to protect the application from harm +** including: +**
        +**
      • Prohibit the use of SQL functions inside triggers, views, +** CHECK constraints, DEFAULT clauses, expression indexes, +** partial indexes, or generated columns +** unless those functions are tagged with [SQLITE_INNOCUOUS]. +**
      • Prohibit the use of virtual tables inside of triggers or views +** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS]. +**
      +** This setting defaults to "on" for legacy compatibility, however +** all applications are advised to turn it off if possible. This setting +** can also be controlled using the [PRAGMA trusted_schema] statement. +**
      +** +** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] +**
      SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +**
      The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates +** the legacy file format flag. When activated, this flag causes all newly +** created database file to have a schema format version number (the 4-byte +** integer found at offset 44 into the database header) of 1. This in turn +** means that the resulting database file will be readable and writable by +** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, +** newly created databases are generally not understandable by SQLite versions +** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there +** is now scarcely any need to generated database files that are compatible +** all the way back to version 3.0.0, and so this setting is of little +** practical use, but is provided so that SQLite can continue to claim the +** ability to generate new database files that are compatible with version +** 3.0.0. +**

      Note that when the SQLITE_DBCONFIG_LEGACY_FILE_FORMAT setting is on, +** the [VACUUM] command will fail with an obscure error when attempting to +** process a table with generated columns and a descending index. This is +** not considered a bug since SQLite versions 3.3.0 and earlier do not support +** either generated columns or decending indexes. +**

      ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3319,7 +3374,9 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ #define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ +#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -3525,7 +3582,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the -** running statements reaches zero are interrupted as if they had been +** running statement count reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). @@ -3693,9 +3750,9 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** Cindy | 21 ** ** -** There are two column (M==2) and three rows (N==3). Thus the +** There are two columns (M==2) and three rows (N==3). Thus the ** result table has 8 entries. Suppose the result table is stored -** in an array names azResult. Then azResult holds this content: +** in an array named azResult. Then azResult holds this content: ** **
       **        azResult[0] = "Name";
      @@ -3788,7 +3845,7 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       **
       ** The SQLite core uses these three routines for all of its own
       ** internal memory allocation needs. "Core" in the previous sentence
      -** does not include operating-system specific VFS implementation.  The
      +** does not include operating-system specific [VFS] implementation.  The
       ** Windows VFS uses native malloc() and free() for some operations.
       **
       ** ^The sqlite3_malloc() routine returns a pointer to a block
      @@ -3849,19 +3906,6 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const cha
       ** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
       ** option is used.
       **
      -** In SQLite version 3.5.0 and 3.5.1, it was possible to define
      -** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
      -** implementation of these routines to be omitted.  That capability
      -** is no longer provided.  Only built-in memory allocators can be used.
      -**
      -** Prior to SQLite version 3.7.10, the Windows OS interface layer called
      -** the system malloc() and free() directly when converting
      -** filenames between the UTF-8 encoding used by SQLite
      -** and whatever filename encoding is used by the particular Windows
      -** installation.  Memory allocation errors were detected, but
      -** they were reported back as [SQLITE_CANTOPEN] or
      -** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
      -**
       ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
       ** must be either NULL or else pointers obtained from a prior
       ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
      @@ -3910,7 +3954,7 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int 
       ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
       ** select random [ROWID | ROWIDs] when inserting new records into a table that
       ** already uses the largest possible [ROWID].  The PRNG is also used for
      -** the build-in random() and randomblob() SQL functions.  This interface allows
      +** the built-in random() and randomblob() SQL functions.  This interface allows
       ** applications to access the same PRNG for other purposes.
       **
       ** ^A call to this routine stores N bytes of randomness into buffer P.
      @@ -4284,10 +4328,8 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int
       ** The sqlite3_open_v2() interface works like sqlite3_open()
       ** except that it accepts two additional parameters for additional control
       ** over the new database connection.  ^(The flags parameter to
      -** sqlite3_open_v2() can take one of
      -** the following three values, optionally combined with the 
      -** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
      -** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^
      +** sqlite3_open_v2() must include, at a minimum, one of the following
      +** three flag combinations:)^
       **
       ** 
      ** ^(
      [SQLITE_OPEN_READONLY]
      @@ -4305,23 +4347,51 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int ** sqlite3_open() and sqlite3_open16().)^ **
      ** +** In addition to the required flags, the following optional flags are +** also supported: +** +**
      +** ^(
      [SQLITE_OPEN_URI]
      +**
      The filename can be interpreted as a URI if this flag is set.
      )^ +** +** ^(
      [SQLITE_OPEN_MEMORY]
      +**
      The database will be opened as an in-memory database. The database +** is named by the "filename" argument for the purposes of cache-sharing, +** if shared cache mode is enabled, but the "filename" is otherwise ignored. +**
      )^ +** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 28 13:51:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D32622D8F0; Tue, 28 Jan 2020 13:51:54 +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 486Shp3djyz3yd4; Tue, 28 Jan 2020 13:51:54 +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 7812724027; Tue, 28 Jan 2020 13:51:54 +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 00SDpsDb053808; Tue, 28 Jan 2020 13:51:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SDprlX053805; Tue, 28 Jan 2020 13:51:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001281351.00SDprlX053805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Jan 2020 13:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357202 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 13:51:54 -0000 Author: trasz Date: Tue Jan 28 13:51:53 2020 New Revision: 357202 URL: https://svnweb.freebsd.org/changeset/base/357202 Log: Add compat.linux.ignore_ip_recverr sysctl. This is a workaround for missing IP_RECVERR setsockopt(2) support. Without it, DNS resolution is broken for glibc >= 2.30 (glibc BZ #24047). From the user point of view this fixes "yum update" on recent CentOS 8. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23234 Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_mib.c Tue Jan 28 13:51:53 2020 (r357202) @@ -62,6 +62,10 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); +int linux_ignore_ip_recverr = 1; +SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, + &linux_ignore_ip_recverr, 0, "Ignore enabling IP_RECVERR"); + int linux_preserve_vstatus = 0; SYSCTL_INT(_compat_linux, OID_AUTO, preserve_vstatus, CTLFLAG_RWTUN, &linux_preserve_vstatus, 0, "Preserve VSTATUS termios(4) flag"); Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_mib.h Tue Jan 28 13:51:53 2020 (r357202) @@ -62,6 +62,7 @@ int linux_kernver(struct thread *td); #define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000) +extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; #endif /* _LINUX_MIB_H_ */ Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_socket.c Tue Jan 28 13:51:53 2020 (r357202) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include #include @@ -1424,6 +1425,14 @@ linux_setsockopt(struct thread *td, struct linux_setso } break; case IPPROTO_IP: + if (args->optname == LINUX_IP_RECVERR && + linux_ignore_ip_recverr) { + /* + * XXX: This is a hack to unbreak DNS resolution + * with glibc 2.30 and above. + */ + return (0); + } name = linux_to_bsd_ip_sockopt(args->optname); break; case IPPROTO_IPV6: Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_socket.h Tue Jan 28 13:51:53 2020 (r357202) @@ -202,6 +202,7 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_IP_TTL 2 #define LINUX_IP_HDRINCL 3 #define LINUX_IP_OPTIONS 4 +#define LINUX_IP_RECVERR 11 #define LINUX_IP_MULTICAST_IF 32 #define LINUX_IP_MULTICAST_TTL 33 From owner-svn-src-all@freebsd.org Tue Jan 28 13:57:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91A6B22DAB1; Tue, 28 Jan 2020 13:57: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 486Sq93GWcz3ywy; Tue, 28 Jan 2020 13:57: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 6B55024068; Tue, 28 Jan 2020 13:57:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SDvPJR055860; Tue, 28 Jan 2020 13:57:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SDvPZC055856; Tue, 28 Jan 2020 13:57:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001281357.00SDvPZC055856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Jan 2020 13:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357203 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 13:57:25 -0000 Author: trasz Date: Tue Jan 28 13:57:24 2020 New Revision: 357203 URL: https://svnweb.freebsd.org/changeset/base/357203 Log: Add TCP_CORK support to linux(4). This fixes one of the things Nginx trips over. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23171 Modified: head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Jan 28 13:51:53 2020 (r357202) +++ head/sys/compat/linux/linux_socket.c Tue Jan 28 13:57:24 2020 (r357203) @@ -244,6 +244,8 @@ linux_to_bsd_tcp_sockopt(int opt) return (TCP_NODELAY); case LINUX_TCP_MAXSEG: return (TCP_MAXSEG); + case LINUX_TCP_CORK: + return (TCP_NOPUSH); case LINUX_TCP_KEEPIDLE: return (TCP_KEEPIDLE); case LINUX_TCP_KEEPINTVL: Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Tue Jan 28 13:51:53 2020 (r357202) +++ head/sys/compat/linux/linux_socket.h Tue Jan 28 13:57:24 2020 (r357203) @@ -237,6 +237,7 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_TCP_NODELAY 1 #define LINUX_TCP_MAXSEG 2 +#define LINUX_TCP_CORK 3 #define LINUX_TCP_KEEPIDLE 4 #define LINUX_TCP_KEEPINTVL 5 #define LINUX_TCP_KEEPCNT 6 From owner-svn-src-all@freebsd.org Tue Jan 28 15:34:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B724E2309A7; Tue, 28 Jan 2020 15:34:00 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486Vyc4TT3z46dx; Tue, 28 Jan 2020 15:34:00 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94F7825336; Tue, 28 Jan 2020 15:34:00 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SFY0qM016540; Tue, 28 Jan 2020 15:34:00 GMT (envelope-from dwmalone@FreeBSD.org) Received: (from dwmalone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SFY0Ba016539; Tue, 28 Jan 2020 15:34:00 GMT (envelope-from dwmalone@FreeBSD.org) Message-Id: <202001281534.00SFY0Ba016539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dwmalone set sender to dwmalone@FreeBSD.org using -f From: David Malone Date: Tue, 28 Jan 2020 15:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357204 - head/lib/geom/part X-SVN-Group: head X-SVN-Commit-Author: dwmalone X-SVN-Commit-Paths: head/lib/geom/part X-SVN-Commit-Revision: 357204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 15:34:00 -0000 Author: dwmalone Date: Tue Jan 28 15:34:00 2020 New Revision: 357204 URL: https://svnweb.freebsd.org/changeset/base/357204 Log: Add some missing articles. Use .Nm to format the utility name. Get the name of the GEOM class right. MFC after: 2 weeks Modified: head/lib/geom/part/gpart.8 Modified: head/lib/geom/part/gpart.8 ============================================================================== --- head/lib/geom/part/gpart.8 Tue Jan 28 13:57:24 2020 (r357203) +++ head/lib/geom/part/gpart.8 Tue Jan 28 15:34:00 2020 (r357204) @@ -158,7 +158,7 @@ The command accepts these options: .Bl -tag -width 12n .It Fl a Ar alignment -If specified, then +If specified, then the .Nm utility tries to align .Ar start @@ -407,7 +407,7 @@ The command accepts these options: .Bl -tag -width 12n .It Fl a Ar alignment -If specified, then +If specified, then the .Nm utility tries to align partition .Ar size @@ -704,8 +704,8 @@ for APM, for GPT, and 0x0904 for VTOC8. .El .Pp -Other symbolic names that can be used with -.Cm gpart +Other symbolic names that can be used with the +.Nm utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" .It Cm apple-apfs @@ -1215,8 +1215,8 @@ This variable overrides this restriction and allows ar within partitions created at offset 0). Some schemes have their own separate checks, for which see below. .It Va kern.geom.part.auto_resize : No 1 -This variable controls automatic resize behavior of -.Nm +This variable controls automatic resize behavior of the +.Nm PART GEOM class. When this variable is enable and new size of provider is detected, the schema metadata is resized but all changes are not saved to disk, until From owner-svn-src-all@freebsd.org Tue Jan 28 17:34:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5CC1234C7E; Tue, 28 Jan 2020 17:34:06 +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 486YdB5qwGz4Grg; Tue, 28 Jan 2020 17:34:06 +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 C38AC269B0; Tue, 28 Jan 2020 17:34:06 +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 00SHY6mW089218; Tue, 28 Jan 2020 17:34:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SHY6QV089216; Tue, 28 Jan 2020 17:34:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001281734.00SHY6QV089216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 28 Jan 2020 17:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r357205 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 357205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 17:34:07 -0000 Author: jhibbits Date: Tue Jan 28 17:34:05 2020 New Revision: 357205 URL: https://svnweb.freebsd.org/changeset/base/357205 Log: Welcome Alfredo Dal'Ava Junior (alfredo) to the ranks Alfredo has been too good, time to punish him with a src bit. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Jan 28 15:34:00 2020 (r357204) +++ svnadmin/conf/access Tue Jan 28 17:34:05 2020 (r357205) @@ -20,6 +20,7 @@ adrian ae alc +alfredo allanjude ambrisko andreast Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jan 28 15:34:00 2020 (r357204) +++ svnadmin/conf/mentors Tue Jan 28 17:34:05 2020 (r357205) @@ -10,6 +10,7 @@ # Sort by mentee login name. # Mentee Mentor Optional comment +alfredo jhibbits anish jhb brd allanjude Co-mentor: bapt chs imp From owner-svn-src-all@freebsd.org Tue Jan 28 17:39:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB09F235158; Tue, 28 Jan 2020 17:39:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486Ykv5kCjz4HK9; Tue, 28 Jan 2020 17:39:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF78D269C0; Tue, 28 Jan 2020 17:39:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SHd3bw089647; Tue, 28 Jan 2020 17:39:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SHd3cO089645; Tue, 28 Jan 2020 17:39:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001281739.00SHd3cO089645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 28 Jan 2020 17:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357206 - in stable/12: share/man/man4 sys/netgraph X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 357206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 17:39:03 -0000 Author: bz Date: Tue Jan 28 17:39:03 2020 New Revision: 357206 URL: https://svnweb.freebsd.org/changeset/base/357206 Log: MFC r353026,353030,354244 (glebius), r356386: Remove the compile time limit for number of links a ng_bridge node can handle. Instead using an array on node private data, use per-hook private data. Reestablish old ABI. PR: 240787 Submitted by: Lutz Donnerhacke (lutz donnerhacke.de) Modified: stable/12/share/man/man4/ng_bridge.4 stable/12/sys/netgraph/ng_bridge.c stable/12/sys/netgraph/ng_bridge.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ng_bridge.4 ============================================================================== --- stable/12/share/man/man4/ng_bridge.4 Tue Jan 28 17:34:05 2020 (r357205) +++ stable/12/share/man/man4/ng_bridge.4 Tue Jan 28 17:39:03 2020 (r357206) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2010 +.Dd October 2, 2019 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -76,9 +76,7 @@ Processing of IP packets via the .Xr ipfirewall 4 mechanism on a per-link basis is not yet implemented. .Sh HOOKS -This node type supports up to -.Dv NG_BRIDGE_MAX_LINKS -hooks. +This node type supports an unlimited number of hooks. Each connected hook represents a bridged link. The hooks are named .Dv link0 , @@ -106,7 +104,6 @@ as an argument: .Bd -literal -offset 0n /* Node configuration structure */ struct ng_bridge_config { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ uint32_t loopTimeout; /* link loopback mute time */ uint32_t maxStaleness; /* max host age before nuking */ @@ -114,11 +111,6 @@ struct ng_bridge_config { }; .Ed .Pp -The -.Dv ipfw -array enables -.Xr ipfirewall 4 -processing of IP packets received on the corresponding links. The .Dv debugLevel field sets the debug level on the node. Modified: stable/12/sys/netgraph/ng_bridge.c ============================================================================== --- stable/12/sys/netgraph/ng_bridge.c Tue Jan 28 17:34:05 2020 (r357205) +++ stable/12/sys/netgraph/ng_bridge.c Tue Jan 28 17:39:03 2020 (r357206) @@ -1,7 +1,3 @@ -/* - * ng_bridge.c - */ - /*- * Copyright (c) 2000 Whistle Communications, Inc. * All rights reserved. @@ -101,7 +97,6 @@ struct ng_bridge_link { /* Per-node private data */ struct ng_bridge_private { struct ng_bridge_bucket *tab; /* hash table bucket array */ - struct ng_bridge_link *links[NG_BRIDGE_MAX_LINKS]; struct ng_bridge_config conf; /* node configuration */ node_p node; /* netgraph node */ u_int numHosts; /* num entries in table */ @@ -132,9 +127,9 @@ static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); -static int ng_bridge_put(priv_p priv, const u_char *addr, int linkNum); +static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); -static void ng_bridge_remove_hosts(priv_p priv, int linkNum); +static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); static const char *ng_bridge_nodename(node_p node); @@ -142,9 +137,6 @@ static const char *ng_bridge_nodename(node_p node); static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -/* Store each hook's link number in the private field */ -#define LINK_NUM(hook) (*(u_int16_t *)(&(hook)->private)) - /* Compare Ethernet addresses using 32 and 16 bit words instead of bytewise */ #define ETHER_EQUAL(a,b) (((const u_int32_t *)(a))[0] \ == ((const u_int32_t *)(b))[0] \ @@ -200,16 +192,8 @@ static const struct ng_parse_type ng_bridge_host_ary_t }; /* Parse type for struct ng_bridge_config */ -static const struct ng_parse_fixedarray_info ng_bridge_ipfwary_type_info = { - &ng_parse_uint8_type, - NG_BRIDGE_MAX_LINKS -}; -static const struct ng_parse_type ng_bridge_ipfwary_type = { - &ng_parse_fixedarray_type, - &ng_bridge_ipfwary_type_info -}; static const struct ng_parse_struct_field ng_bridge_config_type_fields[] - = NG_BRIDGE_CONFIG_TYPE_INFO(&ng_bridge_ipfwary_type); + = NG_BRIDGE_CONFIG_TYPE_INFO; static const struct ng_parse_type ng_bridge_config_type = { &ng_parse_struct_type, &ng_bridge_config_type_fields @@ -352,26 +336,30 @@ ng_bridge_newhook(node_p node, hook_p hook, const char const priv_p priv = NG_NODE_PRIVATE(node); /* Check for a link hook */ - if (strncmp(name, NG_BRIDGE_HOOK_LINK_PREFIX, - strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) == 0) { - const char *cp; - char *eptr; - u_long linkNum; + if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; - cp = name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX); - if (!isdigit(*cp) || (cp[0] == '0' && cp[1] != '\0')) + /* primitive parsing */ + linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), + NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, + linkNum); + if (strcmp(linkName, name) != 0) return (EINVAL); - linkNum = strtoul(cp, &eptr, 10); - if (*eptr != '\0' || linkNum >= NG_BRIDGE_MAX_LINKS) - return (EINVAL); - if (priv->links[linkNum] != NULL) - return (EISCONN); - priv->links[linkNum] = malloc(sizeof(*priv->links[linkNum]), - M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO); - if (priv->links[linkNum] == NULL) + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, + M_WAITOK|M_ZERO); + if (link == NULL) return (ENOMEM); - priv->links[linkNum]->hook = hook; - NG_HOOK_SET_PRIVATE(hook, (void *)linkNum); + link->hook = hook; + NG_HOOK_SET_PRIVATE(hook, link); priv->numLinks++; return (0); } @@ -384,6 +372,18 @@ ng_bridge_newhook(node_p node, hook_p hook, const char * Receive a control message */ static int +ng_bridge_reset_link(hook_p hook, void *arg __unused) +{ + link_p priv = NG_HOOK_PRIVATE(hook); + + priv->loopCount = 0; + bzero(&priv->stats, sizeof(priv->stats)); + + return (1); +} + + +static int ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) { const priv_p priv = NG_NODE_PRIVATE(node); @@ -393,6 +393,72 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { +#ifdef NGM_BRIDGE_TABLE_ABI + case NGM_BRIDGE_COOKIE_TBL: + switch (msg->header.cmd) { + case NGM_BRIDGE_GET_CONFIG: + { + struct ng_bridge_config_tbl *conf; + + NG_MKRESPONSE(resp, msg, sizeof(*conf), + M_NOWAIT|M_ZERO); + if (resp == NULL) { + error = ENOMEM; + break; + } + conf = (struct ng_bridge_config_tbl *)resp->data; + conf->cfg = priv->conf; + break; + } + case NGM_BRIDGE_SET_CONFIG: + { + struct ng_bridge_config_tbl *conf; + + if (msg->header.arglen != sizeof(*conf)) { + error = EINVAL; + break; + } + conf = (struct ng_bridge_config_tbl *)msg->data; + priv->conf = conf->cfg; + break; + } + case NGM_BRIDGE_GET_TABLE: + { + struct ng_bridge_host_tbl_ary *ary; + struct ng_bridge_hent *hent; + int i, bucket; + + NG_MKRESPONSE(resp, msg, sizeof(*ary) + + (priv->numHosts * sizeof(*ary->hosts)), M_NOWAIT); + if (resp == NULL) { + error = ENOMEM; + break; + } + ary = (struct ng_bridge_host_tbl_ary *)resp->data; + ary->numHosts = priv->numHosts; + i = 0; + for (bucket = 0; bucket < priv->numBuckets; bucket++) { + SLIST_FOREACH(hent, &priv->tab[bucket], next) { + memcpy(ary->hosts[i].addr, + hent->host.addr, + sizeof(ary->hosts[i].addr)); + ary->hosts[i].age = hent->host.age; + ary->hosts[i].staleness = + hent->host.staleness; + ary->hosts[i].linkNum = strtol( + NG_HOOK_NAME(hent->host.link->hook) + + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), + NULL, 10); + i++; + } + } + break; + } + } + /* If already handled break, otherwise use new ABI. */ + if (resp != NULL || error != 0) + break; +#endif /* NGM_BRIDGE_TABLE_ABI */ case NGM_BRIDGE_COOKIE: switch (msg->header.cmd) { case NGM_BRIDGE_GET_CONFIG: @@ -412,7 +478,6 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last case NGM_BRIDGE_SET_CONFIG: { struct ng_bridge_config *conf; - int i; if (msg->header.arglen != sizeof(struct ng_bridge_config)) { @@ -421,48 +486,42 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last } conf = (struct ng_bridge_config *)msg->data; priv->conf = *conf; - for (i = 0; i < NG_BRIDGE_MAX_LINKS; i++) - priv->conf.ipfw[i] = !!priv->conf.ipfw[i]; break; } case NGM_BRIDGE_RESET: { - int i; + hook_p rethook; /* Flush all entries in the hash table */ - ng_bridge_remove_hosts(priv, -1); + ng_bridge_remove_hosts(priv, NULL); /* Reset all loop detection counters and stats */ - for (i = 0; i < NG_BRIDGE_MAX_LINKS; i++) { - if (priv->links[i] == NULL) - continue; - priv->links[i]->loopCount = 0; - bzero(&priv->links[i]->stats, - sizeof(priv->links[i]->stats)); - } + NG_NODE_FOREACH_HOOK(node, ng_bridge_reset_link, NULL, + rethook); break; } case NGM_BRIDGE_GET_STATS: case NGM_BRIDGE_CLR_STATS: case NGM_BRIDGE_GETCLR_STATS: { - struct ng_bridge_link *link; - int linkNum; - + hook_p hook; + link_p link; + char linkName[NG_HOOKSIZ]; + /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - linkNum = *((u_int32_t *)msg->data); - if (linkNum < 0 || linkNum >= NG_BRIDGE_MAX_LINKS) { - error = EINVAL; - break; - } - if ((link = priv->links[linkNum]) == NULL) { + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, + *((u_int32_t *)msg->data)); + + if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; break; } + link = NG_HOOK_PRIVATE(hook); /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { @@ -494,8 +553,17 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last ary = (struct ng_bridge_host_ary *)resp->data; ary->numHosts = priv->numHosts; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) - ary->hosts[i++] = hent->host; + SLIST_FOREACH(hent, &priv->tab[bucket], next) { + memcpy(ary->hosts[i].addr, + hent->host.addr, + sizeof(ary->hosts[i].addr)); + ary->hosts[i].age = hent->host.age; + ary->hosts[i].staleness = hent->host.staleness; + strncpy(ary->hosts[i].hook, + NG_HOOK_NAME(hent->host.link->hook), + sizeof(ary->hosts[i].hook)); + i++; + } } break; } @@ -523,64 +591,118 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p last /* * Receive data on a hook */ +struct ng_bridge_send_ctx { + link_p foundFirst, incoming; + struct mbuf * m; + int manycast, error; +}; + static int +ng_bridge_send_ctx(hook_p dst, void *arg) +{ + struct ng_bridge_send_ctx *ctx = arg; + link_p destLink = NG_HOOK_PRIVATE(dst); + struct mbuf *m2 = NULL; + int error = 0; + + /* Skip incoming link */ + if (destLink == ctx->incoming) { + return (1); + } + + if (ctx->foundFirst == NULL) { + /* + * This is the first usable link we have found. + * Reserve it for the originals. + * If we never find another we save a copy. + */ + ctx->foundFirst = destLink; + return (1); + } + + /* + * It's usable link but not the reserved (first) one. + * Copy mbuf info for sending. + */ + m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ + if (m2 == NULL) { + ctx->incoming->stats.memoryFailures++; + ctx->error = ENOBUFS; + return (0); /* abort loop */ + } + + + /* Update stats */ + destLink->stats.xmitPackets++; + destLink->stats.xmitOctets += m2->m_pkthdr.len; + switch (ctx->manycast) { + default: /* unknown unicast */ + break; + case 1: /* multicast */ + destLink->stats.xmitMulticasts++; + break; + case 2: /* broadcast */ + destLink->stats.xmitBroadcasts++; + break; + } + + /* Send packet */ + NG_SEND_DATA_ONLY(error, destLink->hook, m2); + if(error) + ctx->error = error; + return (1); +} + +static int ng_bridge_rcvdata(hook_p hook, item_p item) { const node_p node = NG_HOOK_NODE(hook); const priv_p priv = NG_NODE_PRIVATE(node); struct ng_bridge_host *host; - struct ng_bridge_link *link; struct ether_header *eh; - int error = 0, linkNum, linksSeen; - int manycast; - struct mbuf *m; - struct ng_bridge_link *firstLink; + struct ng_bridge_send_ctx ctx = { 0 }; + hook_p ret; - NGI_GET_M(item, m); - /* Get link number */ - linkNum = (intptr_t)NG_HOOK_PRIVATE(hook); - KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __func__, linkNum)); - link = priv->links[linkNum]; - KASSERT(link != NULL, ("%s: link%d null", __func__, linkNum)); + NGI_GET_M(item, ctx.m); + ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ - if (m->m_pkthdr.len < ETHER_HDR_LEN) { - link->stats.recvRunts++; + if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { + ctx.incoming->stats.recvRunts++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (EINVAL); } - if (m->m_len < ETHER_HDR_LEN && !(m = m_pullup(m, ETHER_HDR_LEN))) { - link->stats.memoryFailures++; + if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { + ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); return (ENOBUFS); } - eh = mtod(m, struct ether_header *); + eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - link->stats.recvInvalid++; + ctx.incoming->stats.recvInvalid++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (EINVAL); } /* Is link disabled due to a loopback condition? */ - if (link->loopCount != 0) { - link->stats.loopDrops++; + if (ctx.incoming->loopCount != 0) { + ctx.incoming->stats.loopDrops++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - link->stats.recvPackets++; - link->stats.recvOctets += m->m_pkthdr.len; - if ((manycast = (eh->ether_dhost[0] & 1)) != 0) { + ctx.incoming->stats.recvPackets++; + ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - link->stats.recvBroadcasts++; - manycast = 2; + ctx.incoming->stats.recvBroadcasts++; + ctx.manycast = 2; } else - link->stats.recvMulticasts++; + ctx.incoming->stats.recvMulticasts++; } /* Look up packet's source Ethernet address in hashtable */ @@ -590,7 +712,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->staleness = 0; /* Did host jump to a different link? */ - if (host->linkNum != linkNum) { + if (host->link != ctx.incoming) { /* * If the host's old link was recently established @@ -601,7 +723,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Log the problem */ if (priv->conf.debugLevel >= 2) { - struct ifnet *ifp = m->m_pkthdr.rcvif; + struct ifnet *ifp = ctx.m->m_pkthdr.rcvif; char suffix[32]; if (ifp != NULL) @@ -616,28 +738,28 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Mark link as linka non grata */ - link->loopCount = priv->conf.loopTimeout; - link->stats.loopDetects++; + ctx.incoming->loopCount = priv->conf.loopTimeout; + ctx.incoming->stats.loopDetects++; /* Forget all hosts on this link */ - ng_bridge_remove_hosts(priv, linkNum); + ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - link->stats.loopDrops++; + ctx.incoming->stats.loopDrops++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ } /* Move host over to new link */ - host->linkNum = linkNum; + host->link = ctx.incoming; host->age = 0; } } else { - if (!ng_bridge_put(priv, eh->ether_shost, linkNum)) { - link->stats.memoryFailures++; + if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { + ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (ENOMEM); } } @@ -653,109 +775,46 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * If unicast and destination host known, deliver to host's link, * unless it is the same link as the packet came in on. */ - if (!manycast) { + if (!ctx.manycast) { /* Determine packet destination link */ if ((host = ng_bridge_get(priv, eh->ether_dhost)) != NULL) { - struct ng_bridge_link *const destLink - = priv->links[host->linkNum]; + link_p destLink = host->link; /* If destination same as incoming link, do nothing */ - KASSERT(destLink != NULL, - ("%s: link%d null", __func__, host->linkNum)); - if (destLink == link) { + if (destLink == ctx.incoming) { NG_FREE_ITEM(item); - NG_FREE_M(m); + NG_FREE_M(ctx.m); return (0); } /* Deliver packet out the destination link */ destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m->m_pkthdr.len; - NG_FWD_NEW_DATA(error, item, destLink->hook, m); - return (error); + destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); + return (ctx.error); } /* Destination host is not known */ - link->stats.recvUnknown++; + ctx.incoming->stats.recvUnknown++; } /* Distribute unknown, multicast, broadcast pkts to all other links */ - firstLink = NULL; - for (linkNum = linksSeen = 0; linksSeen <= priv->numLinks; linkNum++) { - struct ng_bridge_link *destLink; - struct mbuf *m2 = NULL; + NG_NODE_FOREACH_HOOK(node, ng_bridge_send_ctx, &ctx, ret); - /* - * If we have checked all the links then now - * send the original on its reserved link - */ - if (linksSeen == priv->numLinks) { - /* If we never saw a good link, leave. */ - if (firstLink == NULL) { - NG_FREE_ITEM(item); - NG_FREE_M(m); - return (0); - } - destLink = firstLink; - } else { - destLink = priv->links[linkNum]; - if (destLink != NULL) - linksSeen++; - /* Skip incoming link and disconnected links */ - if (destLink == NULL || destLink == link) { - continue; - } - if (firstLink == NULL) { - /* - * This is the first usable link we have found. - * Reserve it for the originals. - * If we never find another we save a copy. - */ - firstLink = destLink; - continue; - } - - /* - * It's usable link but not the reserved (first) one. - * Copy mbuf info for sending. - */ - m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ - if (m2 == NULL) { - link->stats.memoryFailures++; - NG_FREE_ITEM(item); - NG_FREE_M(m); - return (ENOBUFS); - } - } - - /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m->m_pkthdr.len; - switch (manycast) { - case 0: /* unicast */ - break; - case 1: /* multicast */ - destLink->stats.xmitMulticasts++; - break; - case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; - break; - } - - /* Send packet */ - if (destLink == firstLink) { - /* - * If we've sent all the others, send the original - * on the first link we found. - */ - NG_FWD_NEW_DATA(error, item, destLink->hook, m); - break; /* always done last - not really needed. */ - } else { - NG_SEND_DATA_ONLY(error, destLink->hook, m2); - } + /* If we never saw a good link, leave. */ + if (ctx.foundFirst == NULL || ctx.error != 0) { + NG_FREE_ITEM(item); + NG_FREE_M(ctx.m); + return (ctx.error); } - return (error); + + /* + * If we've sent all the others, send the original + * on the first link we found. + */ + NG_FWD_NEW_DATA(ctx.error, item, ctx.foundFirst->hook, ctx.m); + return (ctx.error); } /* @@ -791,20 +850,13 @@ static int ng_bridge_disconnect(hook_p hook) { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); - int linkNum; + link_p link = NG_HOOK_PRIVATE(hook); - /* Get link number */ - linkNum = (intptr_t)NG_HOOK_PRIVATE(hook); - KASSERT(linkNum >= 0 && linkNum < NG_BRIDGE_MAX_LINKS, - ("%s: linkNum=%u", __func__, linkNum)); - /* Remove all hosts associated with this link */ - ng_bridge_remove_hosts(priv, linkNum); + ng_bridge_remove_hosts(priv, link); /* Free associated link information */ - KASSERT(priv->links[linkNum] != NULL, ("%s: no link", __func__)); - free(priv->links[linkNum], M_NETGRAPH_BRIDGE); - priv->links[linkNum] = NULL; + free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; /* If no more hooks, go away */ @@ -849,7 +901,7 @@ ng_bridge_get(priv_p priv, const u_char *addr) * was a memory allocation failure. */ static int -ng_bridge_put(priv_p priv, const u_char *addr, int linkNum) +ng_bridge_put(priv_p priv, const u_char *addr, link_p link) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -867,7 +919,7 @@ ng_bridge_put(priv_p priv, const u_char *addr, int lin if (hent == NULL) return (0); bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); - hent->host.linkNum = linkNum; + hent->host.link = link; hent->host.staleness = 0; hent->host.age = 0; @@ -943,12 +995,13 @@ ng_bridge_rehash(priv_p priv) MISC FUNCTIONS ******************************************************************/ + /* * Remove all hosts associated with a specific link from the hashtable. * If linkNum == -1, then remove all hosts in the table. */ static void -ng_bridge_remove_hosts(priv_p priv, int linkNum) +ng_bridge_remove_hosts(priv_p priv, link_p link) { int bucket; @@ -958,7 +1011,7 @@ ng_bridge_remove_hosts(priv_p priv, int linkNum) while (*hptr != NULL) { struct ng_bridge_hent *const hent = *hptr; - if (linkNum == -1 || hent->host.linkNum == linkNum) { + if (link == NULL || hent->host.link == link) { *hptr = SLIST_NEXT(hent, next); free(hent, M_NETGRAPH_BRIDGE); priv->numHosts--; @@ -974,13 +1027,33 @@ ng_bridge_remove_hosts(priv_p priv, int linkNum) * a detected loopback condition, and we remove any hosts from * the hashtable whom we haven't heard from in a long while. */ +static int +ng_bridge_unmute(hook_p hook, void *arg) +{ + link_p link = NG_HOOK_PRIVATE(hook); + node_p node = NG_HOOK_NODE(hook); + priv_p priv = NG_NODE_PRIVATE(node); + int *counter = arg; + + if (link->loopCount != 0) { + link->loopCount--; + if (link->loopCount == 0 && priv->conf.debugLevel >= 2) { + log(LOG_INFO, "ng_bridge: %s:" + " restoring looped back %s\n", + ng_bridge_nodename(node), NG_HOOK_NAME(hook)); + } + } + (*counter)++; + return (1); +} + static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) { const priv_p priv = NG_NODE_PRIVATE(node); int bucket; int counter = 0; - int linkNum; + hook_p ret; /* Update host time counters and remove stale entries */ for (bucket = 0; bucket < priv->numBuckets; bucket++) { @@ -989,12 +1062,6 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1 while (*hptr != NULL) { struct ng_bridge_hent *const hent = *hptr; - /* Make sure host's link really exists */ - KASSERT(priv->links[hent->host.linkNum] != NULL, - ("%s: host %6D on nonexistent link %d\n", - __func__, hent->host.addr, ":", - hent->host.linkNum)); - /* Remove hosts we haven't heard from in a while */ if (++hent->host.staleness >= priv->conf.maxStaleness) { *hptr = SLIST_NEXT(hent, next); @@ -1015,22 +1082,8 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1 ng_bridge_rehash(priv); /* Decrease loop counter on muted looped back links */ - for (counter = linkNum = 0; linkNum < NG_BRIDGE_MAX_LINKS; linkNum++) { - struct ng_bridge_link *const link = priv->links[linkNum]; - - if (link != NULL) { - if (link->loopCount != 0) { - link->loopCount--; - if (link->loopCount == 0 - && priv->conf.debugLevel >= 2) { - log(LOG_INFO, "ng_bridge: %s:" - " restoring looped back link%d\n", - ng_bridge_nodename(node), linkNum); - } - } - counter++; - } - } + counter = 0; + NG_NODE_FOREACH_HOOK(node, ng_bridge_unmute, &counter, ret); KASSERT(priv->numLinks == counter, ("%s: links: %d != %d", __func__, priv->numLinks, counter)); Modified: stable/12/sys/netgraph/ng_bridge.h ============================================================================== --- stable/12/sys/netgraph/ng_bridge.h Tue Jan 28 17:34:05 2020 (r357205) +++ stable/12/sys/netgraph/ng_bridge.h Tue Jan 28 17:39:03 2020 (r357206) @@ -43,29 +43,45 @@ #ifndef _NETGRAPH_NG_BRIDGE_H_ #define _NETGRAPH_NG_BRIDGE_H_ +/* + * Support the older ABI based on fixed size tables. + * ABI is deprecated, to be removed in releases > 12 + * Please note: There is no API support! + * You canno create new messages using the old API but messages conforming the + * old ABI are understood. + */ +#define NGM_BRIDGE_TABLE_ABI + /* Node type name and magic cookie */ #define NG_BRIDGE_NODE_TYPE "bridge" -#define NGM_BRIDGE_COOKIE 967239368 +#define NGM_BRIDGE_COOKIE 1569321993 +#ifdef NGM_BRIDGE_TABLE_ABI +#define NGM_BRIDGE_COOKIE_TBL 967239368 +#define NG_BRIDGE_MAX_LINKS 32 +#endif /* NGM_BRIDGE_TABLE_ABI */ + /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ -/* Maximum number of supported links */ -#define NG_BRIDGE_MAX_LINKS 32 - /* Node configuration structure */ struct ng_bridge_config { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ u_int32_t loopTimeout; /* link loopback mute time */ u_int32_t maxStaleness; /* max host age before nuking */ u_int32_t minStableAge; /* min time for a stable host */ }; +#ifdef NGM_BRIDGE_TABLE_ABI +struct ng_bridge_config_tbl { + u_char ipfw[NG_BRIDGE_MAX_LINKS]; + struct ng_bridge_config cfg; +}; +#endif /* NGM_BRIDGE_TABLE_ABI */ + /* Keep this in sync with the above structure definition */ -#define NG_BRIDGE_CONFIG_TYPE_INFO(ainfo) { \ - { "ipfw", (ainfo) }, \ +#define NG_BRIDGE_CONFIG_TYPE_INFO { \ { "debugLevel", &ng_parse_uint8_type }, \ { "loopTimeout", &ng_parse_uint32_type }, \ { "maxStaleness", &ng_parse_uint32_type }, \ @@ -110,18 +126,37 @@ struct ng_bridge_link_stats { { NULL } \ } +struct ng_bridge_link; +typedef struct ng_bridge_link *link_p; /* Structure describing a single host */ struct ng_bridge_host { u_char addr[6]; /* ethernet address */ + link_p link; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ +}; + +#ifdef NGM_BRIDGE_TABLE_ABI +struct ng_bridge_host_tbl { + u_char addr[6]; /* ethernet address */ u_int16_t linkNum; /* link where addr can be found */ u_int16_t age; /* seconds ago entry was created */ u_int16_t staleness; /* seconds ago host last heard from */ }; +#endif /* NGM_BRIDGE_TABLE_ABI */ +/* external representation of the host */ +struct ng_bridge_hostent { + u_char addr[6]; /* ethernet address */ + char hook[NG_HOOKSIZ]; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ +}; + /* Keep this in sync with the above structure definition */ #define NG_BRIDGE_HOST_TYPE_INFO(entype) { \ { "addr", (entype) }, \ - { "linkNum", &ng_parse_uint16_type }, \ + { "hook", &ng_parse_hookbuf_type }, \ { "age", &ng_parse_uint16_type }, \ { "staleness", &ng_parse_uint16_type }, \ { NULL } \ @@ -129,8 +164,8 @@ struct ng_bridge_host { /* Structure returned by NGM_BRIDGE_GET_TABLE */ struct ng_bridge_host_ary { - u_int32_t numHosts; - struct ng_bridge_host hosts[]; + u_int32_t numHosts; + struct ng_bridge_hostent hosts[]; }; /* Keep this in sync with the above structure definition */ @@ -139,6 +174,19 @@ struct ng_bridge_host_ary { { "hosts", (harytype) }, \ { NULL } \ } + +#ifdef NGM_BRIDGE_TABLE_ABI +struct ng_bridge_hostent_tbl { + u_char addr[6]; /* ethernet address */ + u_int16_t linkNum; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ +}; +struct ng_bridge_host_tbl_ary { + u_int32_t numHosts; + struct ng_bridge_hostent_tbl hosts[]; +}; +#endif /* NGM_BRIDGE_TABLE_ABI */ /* Netgraph control messages */ enum { From owner-svn-src-all@freebsd.org Tue Jan 28 17:48:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72DFA2357AD; Tue, 28 Jan 2020 17:48:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486YxW2K6Lz4J12; Tue, 28 Jan 2020 17:48:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DCCC26BA7; Tue, 28 Jan 2020 17:48:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SHmFSQ095396; Tue, 28 Jan 2020 17:48:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SHmFM3095395; Tue, 28 Jan 2020 17:48:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001281748.00SHmFM3095395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 28 Jan 2020 17:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357207 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 357207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 17:48:15 -0000 Author: bz Date: Tue Jan 28 17:48:14 2020 New Revision: 357207 URL: https://svnweb.freebsd.org/changeset/base/357207 Log: MFC r356662: nd6_rtr: constantly use __func__ for nd6log() Over time one or two hard coded function names did not match the actual function anymore. Consistently use __func__ for nd6log() calls and re-wrap/re-format some messages for consitency. Modified: stable/12/sys/netinet6/nd6_rtr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/12/sys/netinet6/nd6_rtr.c Tue Jan 28 17:39:03 2020 (r357206) +++ stable/12/sys/netinet6/nd6_rtr.c Tue Jan 28 17:48:14 2020 (r357207) @@ -171,7 +171,7 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, - "nd6_rs_input: invalid hlim (%d) from %s to %s on %s\n", + "%s: invalid hlim (%d) from %s to %s on %s\n", __func__, ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), ip6_sprintf(ip6bufd, &ip6->ip6_dst), if_name(ifp))); goto bad; @@ -199,7 +199,7 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) nd6_option_init(nd_rs + 1, icmp6len, &ndopts); if (nd6_options(&ndopts) < 0) { nd6log((LOG_INFO, - "nd6_rs_input: invalid ND option, ignored\n")); + "%s: invalid ND option, ignored\n", __func__)); /* nd6_options have incremented stats */ goto freeit; } @@ -213,9 +213,8 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log((LOG_INFO, - "nd6_rs_input: lladdrlen mismatch for %s " - "(if %d, RS packet %d)\n", - ip6_sprintf(ip6bufs, &saddr6), + "%s: lladdrlen mismatch for %s (if %d, RS packet %d)\n", + __func__, ip6_sprintf(ip6bufs, &saddr6), ifp->if_addrlen, lladdrlen - 2)); goto bad; } @@ -267,7 +266,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, - "nd6_ra_input: invalid hlim (%d) from %s to %s on %s\n", + "%s: invalid hlim (%d) from %s to %s on %s\n", __func__, ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), ip6_sprintf(ip6bufd, &ip6->ip6_dst), if_name(ifp))); goto bad; @@ -276,7 +275,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) saddr6 = ip6->ip6_src; if (!IN6_IS_ADDR_LINKLOCAL(&saddr6)) { nd6log((LOG_ERR, - "nd6_ra_input: src %s is not link-local\n", + "%s: src %s is not link-local\n", __func__, ip6_sprintf(ip6bufs, &saddr6))); goto bad; } @@ -295,7 +294,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) nd6_option_init(nd_ra + 1, icmp6len, &ndopts); if (nd6_options(&ndopts) < 0) { nd6log((LOG_INFO, - "nd6_ra_input: invalid ND option, ignored\n")); + "%s: invalid ND option, ignored\n", __func__)); /* nd6_options have incremented stats */ goto freeit; } @@ -369,26 +368,25 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) if (pi->nd_opt_pi_len != 4) { nd6log((LOG_INFO, - "nd6_ra_input: invalid option " - "len %d for prefix information option, " - "ignored\n", pi->nd_opt_pi_len)); + "%s: invalid option len %d for prefix " + "information option, ignored\n", __func__, + pi->nd_opt_pi_len)); continue; } if (128 < pi->nd_opt_pi_prefix_len) { nd6log((LOG_INFO, - "nd6_ra_input: invalid prefix " - "len %d for prefix information option, " - "ignored\n", pi->nd_opt_pi_prefix_len)); + "%s: invalid prefix len %d for prefix " + "information option, ignored\n", __func__, + pi->nd_opt_pi_prefix_len)); continue; } if (IN6_IS_ADDR_MULTICAST(&pi->nd_opt_pi_prefix) || IN6_IS_ADDR_LINKLOCAL(&pi->nd_opt_pi_prefix)) { nd6log((LOG_INFO, - "nd6_ra_input: invalid prefix " - "%s, ignored\n", - ip6_sprintf(ip6bufs, + "%s: invalid prefix %s, ignored\n", + __func__, ip6_sprintf(ip6bufs, &pi->nd_opt_pi_prefix))); continue; } @@ -425,8 +423,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) /* lower bound */ if (mtu < IPV6_MMTU) { - nd6log((LOG_INFO, "nd6_ra_input: bogus mtu option " - "mtu=%lu sent from %s, ignoring\n", + nd6log((LOG_INFO, "%s: bogus mtu option mtu=%lu sent " + "from %s, ignoring\n", __func__, mtu, ip6_sprintf(ip6bufs, &ip6->ip6_src))); goto skip; } @@ -444,9 +442,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) rt_updatemtu(ifp); } } else { - nd6log((LOG_INFO, "nd6_ra_input: bogus mtu " - "mtu=%lu sent from %s; " - "exceeds maxmtu %lu, ignoring\n", + nd6log((LOG_INFO, "%s: bogus mtu=%lu sent from %s; " + "exceeds maxmtu %lu, ignoring\n", __func__, mtu, ip6_sprintf(ip6bufs, &ip6->ip6_src), maxmtu)); } } @@ -467,8 +464,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log((LOG_INFO, - "nd6_ra_input: lladdrlen mismatch for %s " - "(if %d, RA packet %d)\n", ip6_sprintf(ip6bufs, &saddr6), + "%s: lladdrlen mismatch for %s (if %d, RA packet %d)\n", + __func__, ip6_sprintf(ip6bufs, &saddr6), ifp->if_addrlen, lladdrlen - 2)); goto bad; } @@ -1135,9 +1132,9 @@ in6_ifadd(struct nd_prefixctl *pr, int mcast) plen0 = in6_mask2len(&ib->ia_prefixmask.sin6_addr, NULL); if (prefixlen != plen0) { ifa_free(ifa); - nd6log((LOG_INFO, "in6_ifadd: wrong prefixlen for %s " - "(prefix=%d ifid=%d)\n", - if_name(ifp), prefixlen, 128 - plen0)); + nd6log((LOG_INFO, + "%s: wrong prefixlen for %s (prefix=%d ifid=%d)\n", + __func__, if_name(ifp), prefixlen, 128 - plen0)); return NULL; } @@ -1190,7 +1187,7 @@ in6_ifadd(struct nd_prefixctl *pr, int mcast) updateflags |= IN6_IFAUPDATE_DADDELAY; if ((error = in6_update_ifa(ifp, &ifra, NULL, updateflags)) != 0) { nd6log((LOG_ERR, - "in6_ifadd: failed to make ifaddr %s on %s (errno=%d)\n", + "%s: failed to make ifaddr %s on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &ifra.ifra_addr.sin6_addr), if_name(ifp), error)); return (NULL); /* ifaddr must not have been allocated. */ @@ -1292,8 +1289,8 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_def if (new->ndpr_raf_onlink) { ND6_ONLINK_LOCK(); if ((error = nd6_prefix_onlink(new)) != 0) { - nd6log((LOG_ERR, "nd6_prelist_add: failed to make " - "the prefix %s/%d on-link on %s (errno=%d)\n", + nd6log((LOG_ERR, "%s: failed to make the prefix %s/%d " + "on-link on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), error)); /* proceed anyway. XXX: is it correct? */ @@ -1349,8 +1346,8 @@ nd6_prefix_del(struct nd_prefix *pr) ND6_ONLINK_LOCK(); if ((e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, - "nd6_prefix_del: failed to make %s/%d offlink " - "on %s, errno=%d\n", + "%s: failed to make the prefix %s/%d offlink on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), e)); /* what should we do? */ @@ -1421,9 +1418,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_def ND6_ONLINK_LOCK(); if ((error = nd6_prefix_onlink(pr)) != 0) { nd6log((LOG_ERR, - "prelist_update: failed to make " - "the prefix %s/%d on-link on %s " - "(errno=%d)\n", + "%s: failed to make the prefix %s/%d " + "on-link on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), @@ -1443,8 +1439,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_def error = nd6_prelist_add(new, dr, &pr); if (error != 0) { - nd6log((LOG_NOTICE, "prelist_update: " - "nd6_prelist_add failed for %s/%d on %s errno=%d\n", + nd6log((LOG_NOTICE, "%s: nd6_prelist_add() failed for " + "the prefix %s/%d on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), new->ndpr_plen, if_name(new->ndpr_ifp), error)); goto end; /* we should just give up in this case. */ @@ -1644,9 +1640,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_def } if (ifidlen + pr->ndpr_plen != 128) { nd6log((LOG_INFO, - "prelist_update: invalid prefixlen " - "%d for %s, ignored\n", - pr->ndpr_plen, if_name(ifp))); + "%s: invalid prefixlen %d for %s, ignored\n", + __func__, pr->ndpr_plen, if_name(ifp))); goto end; } @@ -1672,10 +1667,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_def if (V_ip6_use_tempaddr) { int e; if ((e = in6_tmpifadd(ia6, 1, 1)) != 0) { - nd6log((LOG_NOTICE, "prelist_update: " - "failed to create a temporary " - "address, errno=%d\n", - e)); + nd6log((LOG_NOTICE, "%s: failed to " + "create a temporary address " + "(errno=%d)\n", __func__, e)); } } ifa_free(&ia6->ia_ifa); @@ -1838,16 +1832,16 @@ restart: if ((flags & NDPRF_ONLINK) != 0 && (e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, - "pfxlist_onlink_check: failed to " - "make %s/%d offlink, errno=%d\n", + "%s: failed to make %s/%d offlink " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); } else if ((flags & NDPRF_ONLINK) == 0 && (e = nd6_prefix_onlink(pr)) != 0) { nd6log((LOG_ERR, - "pfxlist_onlink_check: failed to " - "make %s/%d onlink, errno=%d\n", + "%s: failed to make %s/%d onlink " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); @@ -1980,9 +1974,9 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; - nd6log((LOG_ERR, "nd6_prefix_onlink: failed to add " + nd6log((LOG_ERR, "%s: failed to add " "route for a prefix (%s/%d) on %s, gw=%s, mask=%s, " - "flags=%lx errno = %d\n", + "flags=%lx errno = %d\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), ip6_sprintf(ip6bufg, &sin6->sin6_addr), @@ -2073,8 +2067,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) * interface. This should, of course, be rare though. */ nd6log((LOG_NOTICE, - "nd6_prefix_onlink: failed to find any ifaddr" - " to add route for a prefix(%s/%d) on %s\n", + "%s: failed to find any ifaddr to add route for a " + "prefix(%s/%d) on %s\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp))); return (0); @@ -2173,10 +2167,9 @@ restart: ND6_RUNLOCK(); if ((e = nd6_prefix_onlink(opr)) != 0) { nd6log((LOG_ERR, - "nd6_prefix_offlink: failed to " - "recover a prefix %s/%d from %s " - "to %s (errno = %d)\n", - ip6_sprintf(ip6buf, + "%s: failed to recover a prefix " + "%s/%d from %s to %s (errno=%d)\n", + __func__, ip6_sprintf(ip6buf, &opr->ndpr_prefix.sin6_addr), opr->ndpr_plen, if_name(ifp), if_name(opr->ndpr_ifp), e)); @@ -2191,10 +2184,9 @@ restart: } else { /* XXX: can we still set the NDPRF_ONLINK flag? */ nd6log((LOG_ERR, - "nd6_prefix_offlink: failed to delete route: " - "%s/%d on %s (errno = %d)\n", - ip6_sprintf(ip6buf, &sa6.sin6_addr), pr->ndpr_plen, - if_name(ifp), error)); + "%s: failed to delete route: %s/%d on %s (errno=%d)\n", + __func__, ip6_sprintf(ip6buf, &sa6.sin6_addr), + pr->ndpr_plen, if_name(ifp), error)); } if (a_failure) @@ -2230,8 +2222,8 @@ in6_tmpifadd(const struct in6_ifaddr *ia0, int forcege again: if (in6_get_tmpifid(ifp, (u_int8_t *)randid, (const u_int8_t *)&ia0->ia_addr.sin6_addr.s6_addr[8], forcegen)) { - nd6log((LOG_NOTICE, "in6_tmpifadd: failed to find a good " - "random IFID\n")); + nd6log((LOG_NOTICE, "%s: failed to find a good random IFID\n", + __func__)); return (EINVAL); } ifra.ifra_addr.sin6_addr.s6_addr32[2] |= @@ -2253,8 +2245,8 @@ in6_tmpifadd(const struct in6_ifaddr *ia0, int forcege } /* Give up. Something strange should have happened. */ - nd6log((LOG_NOTICE, "in6_tmpifadd: failed to " - "find a unique random IFID\n")); + nd6log((LOG_NOTICE, "%s: failed to find a unique random IFID\n", + __func__)); return (EEXIST); } @@ -2307,8 +2299,8 @@ in6_tmpifadd(const struct in6_ifaddr *ia0, int forcege newia = in6ifa_ifpwithaddr(ifp, &ifra.ifra_addr.sin6_addr); if (newia == NULL) { /* XXX: can it happen? */ nd6log((LOG_ERR, - "in6_tmpifadd: ifa update succeeded, but we got " - "no ifaddr\n")); + "%s: ifa update succeeded, but we got no ifaddr\n", + __func__)); return (EINVAL); /* XXX */ } newia->ia6_ndpr = ia0->ia6_ndpr; From owner-svn-src-all@freebsd.org Tue Jan 28 17:48:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 555812357EF; Tue, 28 Jan 2020 17:48: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 486YxZ1YTRz4J2B; Tue, 28 Jan 2020 17:48: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 2CF7226BA8; Tue, 28 Jan 2020 17:48: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 00SHmHYD095446; Tue, 28 Jan 2020 17:48:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SHmHtY095445; Tue, 28 Jan 2020 17:48:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001281748.00SHmHtY095445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 28 Jan 2020 17:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357208 - 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: 357208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 17:48:18 -0000 Author: mjg Date: Tue Jan 28 17:48:17 2020 New Revision: 357208 URL: https://svnweb.freebsd.org/changeset/base/357208 Log: amd64: revamp memcmp Borrow the trick from memset and memmove and use the scale/index/base addressing to avoid branches. If a mismatch is found, the routine has to calculate the difference. Make sure there is always up to 8 bytes to inspect. This replaces the previous loop which would operate over up to 16 bytes with an unrolled list of 8 tests. Speed varies a lot, but this is a net win over the previous routine with probably a lot more to gain. Validated with glibc test suite. Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue Jan 28 17:48:14 2020 (r357207) +++ head/sys/amd64/amd64/support.S Tue Jan 28 17:48:17 2020 (r357208) @@ -111,92 +111,191 @@ END(sse2_pagezero) */ ENTRY(memcmp) PUSH_FRAME_POINTER + + xorl %eax,%eax +10: cmpq $16,%rdx - jae 5f + ja 101632f + +100816: + cmpb $8,%dl + jl 100408f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 1f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10081608f + POP_FRAME_POINTER + ret +100408: + cmpb $4,%dl + jl 100204f + movl (%rsi),%r8d + movl (%rdi),%r9d + cmpl %r8d,%r9d + jne 1f + movl -4(%rsi,%rdx),%r8d + movl -4(%rdi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f + POP_FRAME_POINTER + ret +100204: + cmpb $2,%dl + jl 100001f + movzwl (%rsi),%r8d + movzwl (%rdi),%r9d + cmpl %r8d,%r9d + jne 1f + movzwl -2(%rsi,%rdx),%r8d + movzwl -2(%rdi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f + POP_FRAME_POINTER + ret +100001: + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%r8d + movzbl (%rsi),%r9d + cmpb %r8b,%r9b + jne 1f +100000: + POP_FRAME_POINTER + ret +ALIGN_TEXT +101632: + cmpq $32,%rdx + ja 103200f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 1f + movq 8(%rdi),%r8 + movq 8(%rsi),%r9 + cmpq %r8,%r9 + jne 10163208f + movq -16(%rdi,%rdx),%r8 + movq -16(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163216f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163224f + POP_FRAME_POINTER + ret +ALIGN_TEXT +103200: + movq (%rdi),%r8 + movq 8(%rdi),%r9 + subq (%rsi),%r8 + subq 8(%rsi),%r9 + or %r8,%r9 + jnz 10320000f + + movq 16(%rdi),%r8 + movq 24(%rdi),%r9 + subq 16(%rsi),%r8 + subq 24(%rsi),%r9 + or %r8,%r9 + jnz 10320016f + + leaq 32(%rdi),%rdi + leaq 32(%rsi),%rsi + subq $32,%rdx + cmpq $32,%rdx + jae 103200b + cmpb $0,%dl + jne 10b + POP_FRAME_POINTER + ret + +10320016: + leaq 16(%rdi),%rdi + leaq 16(%rsi),%rsi +10320000: +/* + * Mismatch was found within a 16 bytes range. The part of the routine + * which calculates it only operates on sizes up to 8 bytes. Find the + * right part. + */ + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 1f + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 1f +10163224: + leaq -8(%rdi,%rdx),%rdi + leaq -8(%rsi,%rdx),%rsi + jmp 1f +10163216: + leaq -16(%rdi,%rdx),%rdi + leaq -16(%rsi,%rdx),%rsi + jmp 1f +10163208: +10081608: + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 1f + +/* + * Mismatch was found. We have no more than 8 bytes to inspect. + */ +ALIGN_TEXT 1: - testq %rdx,%rdx - je 3f - xorl %ecx,%ecx -2: - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d + movzbl (%rdi),%eax + movzbl (%rsi),%r8d cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d + jne 2f + + movzbl 1(%rdi),%eax + movzbl 1(%rsi),%r8d cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d + jne 2f + + movzbl 2(%rdi),%eax + movzbl 2(%rsi),%r8d cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d + jne 2f + + movzbl 3(%rdi),%eax + movzbl 3(%rsi),%r8d cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jne 2b -3: + jne 2f + + movzbl 4(%rdi),%eax + movzbl 4(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 5(%rdi),%eax + movzbl 5(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 6(%rdi),%eax + movzbl 6(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 7(%rdi),%eax + movzbl 7(%rsi),%r8d + cmpb %r8b,%al + jne 2f + xorl %eax,%eax POP_FRAME_POINTER ret -4: +2: subl %r8d,%eax POP_FRAME_POINTER ret -5: - cmpq $32,%rdx - jae 7f -6: - /* - * 8 bytes - */ - movq (%rdi),%r8 - movq (%rsi),%r9 - cmpq %r8,%r9 - jne 1b - leaq 8(%rdi),%rdi - leaq 8(%rsi),%rsi - subq $8,%rdx - cmpq $8,%rdx - jae 6b - jl 1b - jmp 3b -7: - /* - * 32 bytes - */ - movq (%rsi),%r8 - movq 8(%rsi),%r9 - subq (%rdi),%r8 - subq 8(%rdi),%r9 - or %r8,%r9 - jnz 1b - - movq 16(%rsi),%r8 - movq 24(%rsi),%r9 - subq 16(%rdi),%r8 - subq 24(%rdi),%r9 - or %r8,%r9 - jnz 1b - - leaq 32(%rdi),%rdi - leaq 32(%rsi),%rsi - subq $32,%rdx - cmpq $32,%rdx - jae 7b - jnz 1b - jmp 3b END(memcmp) /* From owner-svn-src-all@freebsd.org Tue Jan 28 18:08:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3711A235F94; Tue, 28 Jan 2020 18:08:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486ZPN0jXzz4KCM; Tue, 28 Jan 2020 18:08:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13A3426F4F; Tue, 28 Jan 2020 18:08:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SI8tiw007707; Tue, 28 Jan 2020 18:08:55 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SI8rcV007696; Tue, 28 Jan 2020 18:08:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001281808.00SI8rcV007696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 28 Jan 2020 18:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357210 - in stable/12: libexec/rc/rc.d sys/dev/cxgbe/tom sys/netinet sys/netinet/tcp_stacks sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: libexec/rc/rc.d sys/dev/cxgbe/tom sys/netinet sys/netinet/tcp_stacks sys/netinet6 X-SVN-Commit-Revision: 357210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:08:56 -0000 Author: bz Date: Tue Jan 28 18:08:53 2020 New Revision: 357210 URL: https://svnweb.freebsd.org/changeset/base/357210 Log: MFC r356527-356528: vnet: virtualise more network stack sysctls. Virtualise tcp_always_keepalive, TCP and UDP log_in_vain. All three are set in the netoptions startup script, which we would love to run for VNETs as well. While virtualising the log_in_vain sysctls seems pointles at first for as long as the kernel message buffer is not virtualised, it at least allows an administrator to debug the base system or an individual jail if needed without turning the logging on for all jails running on a system. Run netoptions startup script in vnet jails. People use rc.conf inside vnet jails to configure networking setups. Presumably because some sysctl were not virtualised up until r356527 the script was not run for vnet jails leaving the rc.conf options without effect for non-obvious reasons. Run the netoptions startup script also for VNET jails now to make the rc.conf options work. PR: 243193 Modified: stable/12/libexec/rc/rc.d/netoptions stable/12/sys/dev/cxgbe/tom/t4_tom.c stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_timer.h stable/12/sys/netinet/tcp_var.h stable/12/sys/netinet/udp_usrreq.c stable/12/sys/netinet/udp_var.h stable/12/sys/netinet6/udp6_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/netoptions ============================================================================== --- stable/12/libexec/rc/rc.d/netoptions Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/libexec/rc/rc.d/netoptions Tue Jan 28 18:08:53 2020 (r357210) @@ -6,7 +6,7 @@ # PROVIDE: netoptions # REQUIRE: FILESYSTEMS # BEFORE: netif -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/dev/cxgbe/tom/t4_tom.c Tue Jan 28 18:08:53 2020 (r357210) @@ -1131,7 +1131,7 @@ init_conn_params(struct vi_info *vi , struct offload_s cp->nagle = tp->t_flags & TF_NODELAY ? 0 : 1; /* TCP Keepalive. */ - if (tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE) + if (V_tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE) cp->keepalive = 1; else cp->keepalive = 0; Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_input.c Tue Jan 28 18:08:53 2020 (r357210) @@ -129,9 +129,9 @@ __FBSDID("$FreeBSD$"); const int tcprexmtthresh = 3; -int tcp_log_in_vain = 0; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW, - &tcp_log_in_vain, 0, +VNET_DEFINE(int, tcp_log_in_vain) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_log_in_vain), 0, "Log all incoming TCP segments to closed ports"); VNET_DEFINE(int, blackhole) = 0; @@ -886,8 +886,8 @@ findpcb: * Log communication attempts to ports that are not * in use. */ - if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) || - tcp_log_in_vain == 2) { + if ((V_tcp_log_in_vain == 1 && (thflags & TH_SYN)) || + V_tcp_log_in_vain == 2) { if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6))) log(LOG_INFO, "%s; %s: Connection attempt " "to closed port\n", s, __func__); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_stacks/rack.c Tue Jan 28 18:08:53 2020 (r357210) @@ -2357,7 +2357,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc */ if ((hpts_timeout == 0) && (slot == 0)) { - if ((tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((V_tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)) { /* * Ok we have no timer (persists, rack, tlp, rxt or @@ -2789,7 +2789,7 @@ rack_timeout_keepalive(struct tcpcb *tp, struct tcp_ra TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((V_tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; @@ -6546,7 +6546,7 @@ rack_timer_audit(struct tcpcb *tp, struct tcp_rack *ra * of nothing outstanding and the RXT up (and the hptsi timer). */ return; - } else if (((tcp_always_keepalive || + } else if (((V_tcp_always_keepalive || rack->rc_inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)) && (tmr_up == PACE_TMR_KEEP) && @@ -6861,7 +6861,7 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th if (((rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK) == 0) && (SEQ_GT(tp->snd_max, tp->snd_una) || (tp->t_flags & TF_DELACK) || - ((tcp_always_keepalive || rack->rc_inp->inp_socket->so_options & SO_KEEPALIVE) && + ((V_tcp_always_keepalive || rack->rc_inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)))) { /* We could not send (probably in the hpts but stopped the timer earlier)? */ if ((tp->snd_max == tp->snd_una) && Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_subr.c Tue Jan 28 18:08:53 2020 (r357210) @@ -3108,7 +3108,7 @@ tcp_log_vain(struct in_conninfo *inc, struct tcphdr *t { /* Is logging enabled? */ - if (tcp_log_in_vain == 0) + if (V_tcp_log_in_vain == 0) return (NULL); return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_timer.c Tue Jan 28 18:08:53 2020 (r357210) @@ -125,9 +125,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -int tcp_always_keepalive = 1; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, - &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +VNET_DEFINE(int, tcp_always_keepalive) = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_VNET|CTLFLAG_RW, + &VNET_NAME(tcp_always_keepalive) , 0, + "Assume SO_KEEPALIVE on all TCP connections"); int tcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -431,7 +432,7 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((tcp_always_keepalive || + if ((V_tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_timer.h Tue Jan 28 18:08:53 2020 (r357210) @@ -203,10 +203,11 @@ extern int tcp_backoff[]; extern int tcp_totbackoff; extern int tcp_rexmit_drop_options; -extern int tcp_always_keepalive; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; +VNET_DECLARE(int, tcp_always_keepalive); +#define V_tcp_always_keepalive VNET(tcp_always_keepalive) VNET_DECLARE(int, tcp_pmtud_blackhole_detect); #define V_tcp_pmtud_blackhole_detect VNET(tcp_pmtud_blackhole_detect) VNET_DECLARE(int, tcp_pmtud_blackhole_mss); Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/tcp_var.h Tue Jan 28 18:08:53 2020 (r357210) @@ -745,7 +745,8 @@ SYSCTL_DECL(_net_inet_tcp_sack); MALLOC_DECLARE(M_TCPLOG); #endif -extern int tcp_log_in_vain; +VNET_DECLARE(int, tcp_log_in_vain); +#define V_tcp_log_in_vain VNET(tcp_log_in_vain) /* * Global TCP tunables shared between different stacks. Modified: stable/12/sys/netinet/udp_usrreq.c ============================================================================== --- stable/12/sys/netinet/udp_usrreq.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/udp_usrreq.c Tue Jan 28 18:08:53 2020 (r357210) @@ -116,9 +116,9 @@ VNET_DEFINE(int, udp_cksum) = 1; SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(udp_cksum), 0, "compute udp checksum"); -int udp_log_in_vain = 0; -SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW, - &udp_log_in_vain, 0, "Log all incoming UDP packets"); +VNET_DEFINE(int, udp_log_in_vain) = 0; +SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(udp_log_in_vain), 0, "Log all incoming UDP packets"); VNET_DEFINE(int, udp_blackhole) = 0; SYSCTL_INT(_net_inet_udp, OID_AUTO, blackhole, CTLFLAG_VNET | CTLFLAG_RW, @@ -688,7 +688,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, ifp, m); if (inp == NULL) { - if (udp_log_in_vain) { + if (V_udp_log_in_vain) { char src[INET_ADDRSTRLEN]; char dst[INET_ADDRSTRLEN]; Modified: stable/12/sys/netinet/udp_var.h ============================================================================== --- stable/12/sys/netinet/udp_var.h Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet/udp_var.h Tue Jan 28 18:08:53 2020 (r357210) @@ -149,9 +149,10 @@ extern u_long udp_sendspace; extern u_long udp_recvspace; VNET_DECLARE(int, udp_cksum); VNET_DECLARE(int, udp_blackhole); +VNET_DECLARE(int, udp_log_in_vain); #define V_udp_cksum VNET(udp_cksum) #define V_udp_blackhole VNET(udp_blackhole) -extern int udp_log_in_vain; +#define V_udp_log_in_vain VNET(udp_log_in_vain) static __inline struct inpcbinfo * udp_get_inpcbinfo(int protocol) Modified: stable/12/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/12/sys/netinet6/udp6_usrreq.c Tue Jan 28 18:04:17 2020 (r357209) +++ stable/12/sys/netinet6/udp6_usrreq.c Tue Jan 28 18:08:53 2020 (r357210) @@ -483,7 +483,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif, m); if (inp == NULL) { - if (udp_log_in_vain) { + if (V_udp_log_in_vain) { char ip6bufs[INET6_ADDRSTRLEN]; char ip6bufd[INET6_ADDRSTRLEN]; From owner-svn-src-all@freebsd.org Tue Jan 28 18:32:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9027236B01; Tue, 28 Jan 2020 18:32:19 +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 486ZwM5wSHz4Lvv; Tue, 28 Jan 2020 18:32:19 +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 C673F274D7; Tue, 28 Jan 2020 18:32:19 +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 00SIWJaY024991; Tue, 28 Jan 2020 18:32:19 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIWJ5F024990; Tue, 28 Jan 2020 18:32:19 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202001281832.00SIWJ5F024990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Jan 2020 18:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357211 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 357211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:32:20 -0000 Author: asomers Date: Tue Jan 28 18:32:19 2020 New Revision: 357211 URL: https://svnweb.freebsd.org/changeset/base/357211 Log: geli: add a test case for attaching multiple providers with 1 command Reviewed by: cem MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D23400 Modified: head/tests/sys/geom/class/eli/attach_test.sh Modified: head/tests/sys/geom/class/eli/attach_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/attach_test.sh Tue Jan 28 18:08:53 2020 (r357210) +++ head/tests/sys/geom/class/eli/attach_test.sh Tue Jan 28 18:32:19 2020 (r357211) @@ -68,6 +68,36 @@ attach_r_cleanup() geli_test_cleanup } +atf_test_case attach_multiple cleanup +attach_multiple_head() +{ + atf_set "descr" "geli attach can attach multiple providers" + atf_set "require.user" "root" +} +attach_multiple_body() +{ + geli_test_setup + + sectors=100 + md0=$(attach_md -t malloc -s `expr $sectors + 1`) + md1=$(attach_md -t malloc -s `expr $sectors + 1`) + md2=$(attach_md -t malloc -s `expr $sectors + 1`) + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md0} + atf_check geli init -B none -P -K keyfile ${md1} + atf_check geli init -B none -P -K keyfile ${md2} + atf_check geli attach -p -k keyfile ${md0} ${md1} ${md2} + # verify that it did create all 3 geli devices + atf_check -s exit:0 test -c /dev/${md0}.eli + atf_check -s exit:0 test -c /dev/${md1}.eli + atf_check -s exit:0 test -c /dev/${md2}.eli +} +attach_multiple_cleanup() +{ + geli_test_cleanup +} + atf_test_case nokey cleanup nokey_head() { @@ -95,5 +125,6 @@ atf_init_test_cases() { atf_add_test_case attach_d atf_add_test_case attach_r + atf_add_test_case attach_multiple atf_add_test_case nokey } From owner-svn-src-all@freebsd.org Tue Jan 28 18:37:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 811E4236F41; Tue, 28 Jan 2020 18:37:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486b272kKwz4M6Y; Tue, 28 Jan 2020 18:37:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58A0927505; Tue, 28 Jan 2020 18:37:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIbJmJ026004; Tue, 28 Jan 2020 18:37:19 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIbJ9d026003; Tue, 28 Jan 2020 18:37:19 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281837.00SIbJ9d026003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357212 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 357212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:37:19 -0000 Author: gordon Date: Tue Jan 28 18:37:18 2020 New Revision: 357212 URL: https://svnweb.freebsd.org/changeset/base/357212 Log: Fix urldecode buffer overrun. Reported by: Duncan Overbruck Security: CVE-2020-7450 Modified: head/lib/libfetch/fetch.c Modified: head/lib/libfetch/fetch.c ============================================================================== --- head/lib/libfetch/fetch.c Tue Jan 28 18:32:19 2020 (r357211) +++ head/lib/libfetch/fetch.c Tue Jan 28 18:37:18 2020 (r357212) @@ -332,6 +332,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -381,11 +383,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; From owner-svn-src-all@freebsd.org Tue Jan 28 18:40:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C84AD2370F6; Tue, 28 Jan 2020 18:40:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486b6H4y5xz4MJR; Tue, 28 Jan 2020 18:40:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A532827536; Tue, 28 Jan 2020 18:40:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIetCC028515; Tue, 28 Jan 2020 18:40:55 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIet6B028514; Tue, 28 Jan 2020 18:40:55 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281840.00SIet6B028514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357213 - stable/12/lib/libfetch X-SVN-Group: stable-12 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: stable/12/lib/libfetch X-SVN-Commit-Revision: 357213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:40:55 -0000 Author: gordon Date: Tue Jan 28 18:40:55 2020 New Revision: 357213 URL: https://svnweb.freebsd.org/changeset/base/357213 Log: MFC 357212. Fix urldecode buffer overrun. Reported by: Duncan Overbruck Approved by: so Security: FreeBSD-SA-20:01.libfetch Security: CVE-2020-7450 Modified: stable/12/lib/libfetch/fetch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libfetch/fetch.c ============================================================================== --- stable/12/lib/libfetch/fetch.c Tue Jan 28 18:37:18 2020 (r357212) +++ stable/12/lib/libfetch/fetch.c Tue Jan 28 18:40:55 2020 (r357213) @@ -330,6 +330,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -377,11 +379,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; From owner-svn-src-all@freebsd.org Tue Jan 28 18:42:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20B4A23725D; Tue, 28 Jan 2020 18:42:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486b7g06r7z4Mhk; Tue, 28 Jan 2020 18:42:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3A24276CF; Tue, 28 Jan 2020 18:42:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIg6F1030091; Tue, 28 Jan 2020 18:42:06 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIg6so030090; Tue, 28 Jan 2020 18:42:06 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281842.00SIg6so030090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357214 - stable/11/lib/libfetch X-SVN-Group: stable-11 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: stable/11/lib/libfetch X-SVN-Commit-Revision: 357214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:42:07 -0000 Author: gordon Date: Tue Jan 28 18:42:06 2020 New Revision: 357214 URL: https://svnweb.freebsd.org/changeset/base/357214 Log: MFC 357212. Fix urldecode buffer overrun. Reported by: Duncan Overbruck Approved by: so Security: FreeBSD-SA-20:01.libfetch Security: CVE-2020-7450 Modified: stable/11/lib/libfetch/fetch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libfetch/fetch.c ============================================================================== --- stable/11/lib/libfetch/fetch.c Tue Jan 28 18:40:55 2020 (r357213) +++ stable/11/lib/libfetch/fetch.c Tue Jan 28 18:42:06 2020 (r357214) @@ -328,6 +328,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -375,11 +377,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; From owner-svn-src-all@freebsd.org Tue Jan 28 18:53:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5536237B04; Tue, 28 Jan 2020 18:53:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bNW5rVcz4NGv; Tue, 28 Jan 2020 18:53:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1D40278BF; Tue, 28 Jan 2020 18:53:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIrF0g037604; Tue, 28 Jan 2020 18:53:15 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIrF0T037601; Tue, 28 Jan 2020 18:53:15 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281853.00SIrF0T037601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357215 - in releng: 11.3/lib/libc/secure 12.0/lib/libc/secure 12.1/lib/libc/secure X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/lib/libc/secure 12.0/lib/libc/secure 12.1/lib/libc/secure X-SVN-Commit-Revision: 357215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:53:16 -0000 Author: gordon Date: Tue Jan 28 18:53:14 2020 New Revision: 357215 URL: https://svnweb.freebsd.org/changeset/base/357215 Log: Fix imprecise ordering of SSP canary initialization Submitted by: Kyle Evans Approved by: so Security: FreeBSD-EN-20:01.ssp Modified: releng/11.3/lib/libc/secure/stack_protector.c releng/12.0/lib/libc/secure/stack_protector.c releng/12.1/lib/libc/secure/stack_protector.c Modified: releng/11.3/lib/libc/secure/stack_protector.c ============================================================================== --- releng/11.3/lib/libc/secure/stack_protector.c Tue Jan 28 18:42:06 2020 (r357214) +++ releng/11.3/lib/libc/secure/stack_protector.c Tue Jan 28 18:53:14 2020 (r357215) @@ -40,11 +40,29 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" +/* + * We give __guard_setup a defined priority early on so that statically linked + * applications have a defined priority at which __stack_chk_guard will be + * getting initialized. This will not matter to most applications, because + * they're either not usually statically linked or they simply don't do things + * in constructors that would be adversely affected by their positioning with + * respect to this initialization. + * + * This conditional should be removed when GCC 4.2 is removed. + */ +#if __has_attribute(__constructor__) || __GNUC_PREREQ__(4, 3) +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__ (200), __used__)); +#else +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__, __used__)); +#endif + extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static void __guard_setup(void) __attribute__((__constructor__, __used__)); +static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; static void __fail(const char *); void __stack_chk_fail(void); void __chk_fail(void); Modified: releng/12.0/lib/libc/secure/stack_protector.c ============================================================================== --- releng/12.0/lib/libc/secure/stack_protector.c Tue Jan 28 18:42:06 2020 (r357214) +++ releng/12.0/lib/libc/secure/stack_protector.c Tue Jan 28 18:53:14 2020 (r357215) @@ -40,11 +40,29 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" +/* + * We give __guard_setup a defined priority early on so that statically linked + * applications have a defined priority at which __stack_chk_guard will be + * getting initialized. This will not matter to most applications, because + * they're either not usually statically linked or they simply don't do things + * in constructors that would be adversely affected by their positioning with + * respect to this initialization. + * + * This conditional should be removed when GCC 4.2 is removed. + */ +#if __has_attribute(__constructor__) || __GNUC_PREREQ__(4, 3) +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__ (200), __used__)); +#else +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__, __used__)); +#endif + extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static void __guard_setup(void) __attribute__((__constructor__, __used__)); +static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; static void __fail(const char *); void __stack_chk_fail(void); void __chk_fail(void); Modified: releng/12.1/lib/libc/secure/stack_protector.c ============================================================================== --- releng/12.1/lib/libc/secure/stack_protector.c Tue Jan 28 18:42:06 2020 (r357214) +++ releng/12.1/lib/libc/secure/stack_protector.c Tue Jan 28 18:53:14 2020 (r357215) @@ -40,11 +40,29 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" +/* + * We give __guard_setup a defined priority early on so that statically linked + * applications have a defined priority at which __stack_chk_guard will be + * getting initialized. This will not matter to most applications, because + * they're either not usually statically linked or they simply don't do things + * in constructors that would be adversely affected by their positioning with + * respect to this initialization. + * + * This conditional should be removed when GCC 4.2 is removed. + */ +#if __has_attribute(__constructor__) || __GNUC_PREREQ__(4, 3) +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__ (200), __used__)); +#else +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__, __used__)); +#endif + extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static void __guard_setup(void) __attribute__((__constructor__, __used__)); +static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; static void __fail(const char *); void __stack_chk_fail(void); void __chk_fail(void); From owner-svn-src-all@freebsd.org Tue Jan 28 18:54:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F22F5237C08; Tue, 28 Jan 2020 18:54:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bPg6Bf0z4NPq; Tue, 28 Jan 2020 18:54:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFC0A278C0; Tue, 28 Jan 2020 18:54:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIsFt3037697; Tue, 28 Jan 2020 18:54:15 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIsFLG037695; Tue, 28 Jan 2020 18:54:15 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281854.00SIsFLG037695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357216 - in releng: 11.3/sys/kern 12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/kern 12.0/sys/kern X-SVN-Commit-Revision: 357216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:54:16 -0000 Author: gordon Date: Tue Jan 28 18:54:15 2020 New Revision: 357216 URL: https://svnweb.freebsd.org/changeset/base/357216 Log: Fix nmount invalid pointer dereference Submitted by: Andrew Turner Approved by: so Security: FreeBSD-EN-20:02.nmount Modified: releng/11.3/sys/kern/vfs_mount.c releng/12.0/sys/kern/vfs_mount.c Modified: releng/11.3/sys/kern/vfs_mount.c ============================================================================== --- releng/11.3/sys/kern/vfs_mount.c Tue Jan 28 18:53:14 2020 (r357215) +++ releng/11.3/sys/kern/vfs_mount.c Tue Jan 28 18:54:15 2020 (r357216) @@ -591,7 +591,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -599,7 +599,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); Modified: releng/12.0/sys/kern/vfs_mount.c ============================================================================== --- releng/12.0/sys/kern/vfs_mount.c Tue Jan 28 18:53:14 2020 (r357215) +++ releng/12.0/sys/kern/vfs_mount.c Tue Jan 28 18:54:15 2020 (r357216) @@ -603,7 +603,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -611,7 +611,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); From owner-svn-src-all@freebsd.org Tue Jan 28 18:55:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C16C6237CE0; Tue, 28 Jan 2020 18:55:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bQm3c6kz4NX3; Tue, 28 Jan 2020 18:55:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00SIt8qH043468 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 Jan 2020 10:55:08 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00SIt8W2043467; Tue, 28 Jan 2020 10:55:08 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 Jan 2020 10:55:08 -0800 From: Gleb Smirnoff To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357203 - head/sys/compat/linux Message-ID: <20200128185508.GZ1268@FreeBSD.org> References: <202001281357.00SDvPZC055856@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001281357.00SDvPZC055856@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 486bQm3c6kz4NX3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:55:12 -0000 On Tue, Jan 28, 2020 at 01:57:25PM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Tue Jan 28 13:57:24 2020 E> New Revision: 357203 E> URL: https://svnweb.freebsd.org/changeset/base/357203 E> E> Log: E> Add TCP_CORK support to linux(4). This fixes one of the things Nginx E> trips over. E> E> MFC after: 2 weeks E> Sponsored by: The FreeBSD Foundation E> Differential Revision: https://reviews.freebsd.org/D23171 Again, out of curiosity: what is any good reason to run linux nginx binary on FreeBSD? To lose all the nice features of FreeBSD kernel that nginx supports? Don't read me as if I'm against adding TCP_CORK support to linux(4). -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Jan 28 18:55:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C174237D4E; Tue, 28 Jan 2020 18:55:26 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bR23g6rz4NfF; Tue, 28 Jan 2020 18:55:26 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EA45278C1; Tue, 28 Jan 2020 18:55:26 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SItQE9037832; Tue, 28 Jan 2020 18:55:26 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SItPh4037830; Tue, 28 Jan 2020 18:55:25 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281855.00SItPh4037830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357217 - in releng: 11.3/lib/libfetch 12.0/lib/libfetch 12.1/lib/libfetch X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/lib/libfetch 12.0/lib/libfetch 12.1/lib/libfetch X-SVN-Commit-Revision: 357217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:55:26 -0000 Author: gordon Date: Tue Jan 28 18:55:25 2020 New Revision: 357217 URL: https://svnweb.freebsd.org/changeset/base/357217 Log: Fix libfetch buffer overflow Reported by: Duncan Overbruck Approved by: so Security: FreeBSD-SA-20:01.libfetch Security: CVE-2020-7450 Modified: releng/11.3/lib/libfetch/fetch.c releng/12.0/lib/libfetch/fetch.c releng/12.1/lib/libfetch/fetch.c Modified: releng/11.3/lib/libfetch/fetch.c ============================================================================== --- releng/11.3/lib/libfetch/fetch.c Tue Jan 28 18:54:15 2020 (r357216) +++ releng/11.3/lib/libfetch/fetch.c Tue Jan 28 18:55:25 2020 (r357217) @@ -328,6 +328,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -375,11 +377,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; Modified: releng/12.0/lib/libfetch/fetch.c ============================================================================== --- releng/12.0/lib/libfetch/fetch.c Tue Jan 28 18:54:15 2020 (r357216) +++ releng/12.0/lib/libfetch/fetch.c Tue Jan 28 18:55:25 2020 (r357217) @@ -330,6 +330,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -377,11 +379,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; Modified: releng/12.1/lib/libfetch/fetch.c ============================================================================== --- releng/12.1/lib/libfetch/fetch.c Tue Jan 28 18:54:15 2020 (r357216) +++ releng/12.1/lib/libfetch/fetch.c Tue Jan 28 18:55:25 2020 (r357217) @@ -330,6 +330,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -377,11 +379,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; From owner-svn-src-all@freebsd.org Tue Jan 28 18:56:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C649C237E0F; Tue, 28 Jan 2020 18:56:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bSZ4rTKz4Nmt; Tue, 28 Jan 2020 18:56:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17BF278C2; Tue, 28 Jan 2020 18:56:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIukDw037934; Tue, 28 Jan 2020 18:56:46 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIukjv037933; Tue, 28 Jan 2020 18:56:46 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281856.00SIukjv037933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357218 - releng/12.0/sys/netipsec X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.0/sys/netipsec X-SVN-Commit-Revision: 357218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:56:46 -0000 Author: gordon Date: Tue Jan 28 18:56:46 2020 New Revision: 357218 URL: https://svnweb.freebsd.org/changeset/base/357218 Log: Fix missing IPsec anti-replay window check Reported by: Jean-Francois HREN Approved by: so Security: FreeBSD-SA-20:02.ipsec Security: CVE-2019-5613 Modified: releng/12.0/sys/netipsec/ipsec.c Modified: releng/12.0/sys/netipsec/ipsec.c ============================================================================== --- releng/12.0/sys/netipsec/ipsec.c Tue Jan 28 18:55:25 2020 (r357217) +++ releng/12.0/sys/netipsec/ipsec.c Tue Jan 28 18:56:46 2020 (r357218) @@ -1318,6 +1318,8 @@ ok: __func__, replay->overflow, ipsec_sa2str(sav, buf, sizeof(buf)))); } + + replay->count++; return (0); } From owner-svn-src-all@freebsd.org Tue Jan 28 18:57:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E5B5237ECD; Tue, 28 Jan 2020 18:57:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bTj6gvHz4Ntm; Tue, 28 Jan 2020 18:57:45 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0912278C4; Tue, 28 Jan 2020 18:57:45 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIvj4n038020; Tue, 28 Jan 2020 18:57:45 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIvjeF038017; Tue, 28 Jan 2020 18:57:45 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281857.00SIvjeF038017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357219 - in releng: 11.3/sys/kern 12.0/sys/kern 12.1/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/kern 12.0/sys/kern 12.1/sys/kern X-SVN-Commit-Revision: 357219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:57:46 -0000 Author: gordon Date: Tue Jan 28 18:57:45 2020 New Revision: 357219 URL: https://svnweb.freebsd.org/changeset/base/357219 Log: Fix kernel stack data disclosure Reported by: Ilja Van Sprundel Approved by: so Security: FreeBSD-SA-20:03.thrmisc Security: CVE-2019-15875 Modified: releng/11.3/sys/kern/imgact_elf.c releng/12.0/sys/kern/imgact_elf.c releng/12.1/sys/kern/imgact_elf.c Modified: releng/11.3/sys/kern/imgact_elf.c ============================================================================== --- releng/11.3/sys/kern/imgact_elf.c Tue Jan 28 18:56:46 2020 (r357218) +++ releng/11.3/sys/kern/imgact_elf.c Tue Jan 28 18:57:45 2020 (r357219) @@ -2007,7 +2007,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_ td = (struct thread *)arg; if (sb != NULL) { KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); - bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + bzero(&thrmisc, sizeof(thrmisc)); strcpy(thrmisc.pr_tname, td->td_name); sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } Modified: releng/12.0/sys/kern/imgact_elf.c ============================================================================== --- releng/12.0/sys/kern/imgact_elf.c Tue Jan 28 18:56:46 2020 (r357218) +++ releng/12.0/sys/kern/imgact_elf.c Tue Jan 28 18:57:45 2020 (r357219) @@ -2022,7 +2022,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_ td = (struct thread *)arg; if (sb != NULL) { KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); - bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + bzero(&thrmisc, sizeof(thrmisc)); strcpy(thrmisc.pr_tname, td->td_name); sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } Modified: releng/12.1/sys/kern/imgact_elf.c ============================================================================== --- releng/12.1/sys/kern/imgact_elf.c Tue Jan 28 18:56:46 2020 (r357218) +++ releng/12.1/sys/kern/imgact_elf.c Tue Jan 28 18:57:45 2020 (r357219) @@ -2211,7 +2211,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_ td = (struct thread *)arg; if (sb != NULL) { KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); - bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + bzero(&thrmisc, sizeof(thrmisc)); strcpy(thrmisc.pr_tname, td->td_name); sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } From owner-svn-src-all@freebsd.org Tue Jan 28 18:58:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47255238011; Tue, 28 Jan 2020 18:58:39 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bVl17Pdz4P2f; Tue, 28 Jan 2020 18:58:39 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2213A278C6; Tue, 28 Jan 2020 18:58:39 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SIwdx6038108; Tue, 28 Jan 2020 18:58:39 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SIwbQL038100; Tue, 28 Jan 2020 18:58:37 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202001281858.00SIwbQL038100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 28 Jan 2020 18:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r357220 - in releng: 11.3 11.3/sys/conf 12.0 12.0/sys/conf 12.1 12.1/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3 11.3/sys/conf 12.0 12.0/sys/conf 12.1 12.1/sys/conf X-SVN-Commit-Revision: 357220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:58:39 -0000 Author: gordon Date: Tue Jan 28 18:58:37 2020 New Revision: 357220 URL: https://svnweb.freebsd.org/changeset/base/357220 Log: Add UPDATING entries and bump version. Approved by: so Modified: releng/11.3/UPDATING releng/11.3/sys/conf/newvers.sh releng/12.0/UPDATING releng/12.0/sys/conf/newvers.sh releng/12.1/UPDATING releng/12.1/sys/conf/newvers.sh Modified: releng/11.3/UPDATING ============================================================================== --- releng/11.3/UPDATING Tue Jan 28 18:57:45 2020 (r357219) +++ releng/11.3/UPDATING Tue Jan 28 18:58:37 2020 (r357220) @@ -16,6 +16,19 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200128 p6 FreeBSD-EN-20:01.ssp + FreeBSD-EN-20:02.nmount + FreeBSD-SA-20:01.libfetch + FreeBSD-SA-20:03.thrmisc + + Fix imprecise ordering of SSP canary initialization [EN-20:01.ssp] + + Fix nmount invalid pointer dereference [EN-20:02.nmount] + + Fix libfetch buffer overflow [SA-20:01.libfetch] + + Fix kernel stack data disclosure [SA-20:03.thrmisc] + 20191112 p5 FreeBSD-SA-19:25.mcepsc Fix Machine Check Exception on Page Size Change [SA-19:25.mcepsc] Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Tue Jan 28 18:57:45 2020 (r357219) +++ releng/11.3/sys/conf/newvers.sh Tue Jan 28 18:58:37 2020 (r357220) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.0/UPDATING ============================================================================== --- releng/12.0/UPDATING Tue Jan 28 18:57:45 2020 (r357219) +++ releng/12.0/UPDATING Tue Jan 28 18:58:37 2020 (r357220) @@ -16,6 +16,22 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200128 p13 FreeBSD-EN-20:01.ssp + FreeBSD-EN-20:02.nmount + FreeBSD-SA-20:01.libfetch + FreeBSD-SA-20:02.ipsec + FreeBSD-SA-20:03.thrmisc + + Fix imprecise ordering of SSP canary initialization [EN-20:01.ssp] + + Fix nmount invalid pointer dereference [EN-20:02.nmount] + + Fix libfetch buffer overflow [SA-20:01.libfetch] + + Fix missing IPsec anti-replay window check [SA-20:02.ipsec] + + Fix kernel stack data disclosure [SA-20:03.thrmisc] + 20191112 p12 FreeBSD-EN-19:19.loader FreeBSD-SA-19:25.mcepsc Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- releng/12.0/sys/conf/newvers.sh Tue Jan 28 18:57:45 2020 (r357219) +++ releng/12.0/sys/conf/newvers.sh Tue Jan 28 18:58:37 2020 (r357220) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="RELEASE-p12" +BRANCH="RELEASE-p13" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.1/UPDATING ============================================================================== --- releng/12.1/UPDATING Tue Jan 28 18:57:45 2020 (r357219) +++ releng/12.1/UPDATING Tue Jan 28 18:58:37 2020 (r357220) @@ -16,6 +16,16 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200128 p2 FreeBSD-EN-20:01.ssp + FreeBSD-SA-20:01.libfetch + FreeBSD-SA-20:03.thrmisc + + Fix imprecise ordering of SSP canary initialization [EN-20:01.ssp] + + Fix libfetch buffer overflow [SA-20:01.libfetch] + + Fix kernel stack data disclosure [SA-20:03.thrmisc] + 20191112 p1 FreeBSD-EN-19:19.loader FreeBSD-SA-19:25.mcepsc Modified: releng/12.1/sys/conf/newvers.sh ============================================================================== --- releng/12.1/sys/conf/newvers.sh Tue Jan 28 18:57:45 2020 (r357219) +++ releng/12.1/sys/conf/newvers.sh Tue Jan 28 18:58:37 2020 (r357220) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Tue Jan 28 20:05:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F1BD23AD5F; Tue, 28 Jan 2020 20:05:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486czp2gCQz4T5W; Tue, 28 Jan 2020 20:05:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 569C9631; Tue, 28 Jan 2020 20:05:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SK5Qd1079940; Tue, 28 Jan 2020 20:05:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SK5QcB079939; Tue, 28 Jan 2020 20:05:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282005.00SK5QcB079939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 20:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357223 - head/libexec/rbootd X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/libexec/rbootd X-SVN-Commit-Revision: 357223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:05:26 -0000 Author: dim Date: Tue Jan 28 20:05:25 2020 New Revision: 357223 URL: https://svnweb.freebsd.org/changeset/base/357223 Log: Merge r357222 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in rbootd: libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced] filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; ~ ^ MFC after: 3 days Modified: head/libexec/rbootd/rmpproto.c Directory Properties: head/ (props changed) Modified: head/libexec/rbootd/rmpproto.c ============================================================================== --- head/libexec/rbootd/rmpproto.c Tue Jan 28 19:19:55 2020 (r357222) +++ head/libexec/rbootd/rmpproto.c Tue Jan 28 20:05:25 2020 (r357223) @@ -332,7 +332,8 @@ SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, c * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; + filename = strrchr(filepath,'/'); + filename = filename? filename + 1: filepath; /* * Check that this is a valid boot file name. From owner-svn-src-all@freebsd.org Tue Jan 28 20:11:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7766023B1C9; Tue, 28 Jan 2020 20:11:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486d6m2d3Xz4Tc8; Tue, 28 Jan 2020 20:11:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5556C7AB; Tue, 28 Jan 2020 20:11:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKBSS0084987; Tue, 28 Jan 2020 20:11:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKBS5S084986; Tue, 28 Jan 2020 20:11:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282011.00SKBS5S084986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 20:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357226 - head/contrib/binutils/bfd X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/binutils/bfd X-SVN-Commit-Revision: 357226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:11:28 -0000 Author: dim Date: Tue Jan 28 20:11:27 2020 New Revision: 357226 URL: https://svnweb.freebsd.org/changeset/base/357226 Log: Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ MFC after: 3 days Modified: head/contrib/binutils/bfd/peicode.h Directory Properties: head/ (props changed) head/contrib/binutils/ (props changed) Modified: head/contrib/binutils/bfd/peicode.h ============================================================================== --- head/contrib/binutils/bfd/peicode.h Tue Jan 28 20:10:26 2020 (r357225) +++ head/contrib/binutils/bfd/peicode.h Tue Jan 28 20:11:27 2020 (r357226) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-all@freebsd.org Tue Jan 28 20:12:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41A4123B40C; Tue, 28 Jan 2020 20:12:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486d7y0zJVz4V4h; Tue, 28 Jan 2020 20:12:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CC70805; Tue, 28 Jan 2020 20:12:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKCTIq086039; Tue, 28 Jan 2020 20:12:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKCT3v086038; Tue, 28 Jan 2020 20:12:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282012.00SKCT3v086038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 20:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357227 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 357227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:12:30 -0000 Author: dim Date: Tue Jan 28 20:12:29 2020 New Revision: 357227 URL: https://svnweb.freebsd.org/changeset/base/357227 Log: Merge r357225 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in newfs_msdos: sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (o.align) { ^ sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here if (argc < 1 || argc > 2) ^ MFC after: 3 days Modified: head/sbin/newfs_msdos/newfs_msdos.c Directory Properties: head/ (props changed) Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Tue Jan 28 20:11:27 2020 (r357226) +++ head/sbin/newfs_msdos/newfs_msdos.c Tue Jan 28 20:12:29 2020 (r357227) @@ -178,10 +178,10 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1 || argc > 2) usage(); - if (o.align) { - if (o.reserved_sectors) - errx(1, "align (-A) is incompatible with -r"); - } + if (o.align) { + if (o.reserved_sectors) + errx(1, "align (-A) is incompatible with -r"); + } fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); From owner-svn-src-all@freebsd.org Tue Jan 28 20:53:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 117A523FBFD; Tue, 28 Jan 2020 20:53:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486f2v6dq4z4cG8; Tue, 28 Jan 2020 20:53:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE9E6FCC; Tue, 28 Jan 2020 20:53:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKrBw8009926; Tue, 28 Jan 2020 20:53:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKrBcf009925; Tue, 28 Jan 2020 20:53:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001282053.00SKrBcf009925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 28 Jan 2020 20:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357228 - stable/11/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/hardware X-SVN-Commit-Revision: 357228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:53:12 -0000 Author: gjb Date: Tue Jan 28 20:53:11 2020 New Revision: 357228 URL: https://svnweb.freebsd.org/changeset/base/357228 Log: Fix build after removal of the mobile list. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Jan 28 20:12:29 2020 (r357227) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Jan 28 20:53:11 2020 (r357228) @@ -232,9 +232,7 @@ as sound, graphics, power management, and PCCARD expansion slots. These features tend to vary in idiosyncratic ways between machines, and frequently require special-case support - in &os; to work around hardware bugs or other oddities. When - in doubt, a search of the archives of the &a.mobile; may be - useful. + in &os; to work around hardware bugs or other oddities. Most modern laptops (as well as many desktops) use the Advanced Configuration and Power Management (ACPI) standard. From owner-svn-src-all@freebsd.org Tue Jan 28 20:53:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8DE223FCBC; Tue, 28 Jan 2020 20:53:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486f3F1qNvz4cNV; Tue, 28 Jan 2020 20:53:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19CDBFCE; Tue, 28 Jan 2020 20:53:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKrS60009985; Tue, 28 Jan 2020 20:53:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKrSUp009984; Tue, 28 Jan 2020 20:53:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001282053.00SKrSUp009984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 28 Jan 2020 20:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357229 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 357229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:53:29 -0000 Author: gjb Date: Tue Jan 28 20:53:28 2020 New Revision: 357229 URL: https://svnweb.freebsd.org/changeset/base/357229 Log: Document EN-20:01-02, SA-20:01-03. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue Jan 28 20:53:11 2020 (r357228) +++ stable/11/release/doc/share/xml/errata.xml Tue Jan 28 20:53:28 2020 (r357229) @@ -54,6 +54,21 @@ Timezone database information update + + + FreeBSD-EN-20:01.ssp + 28 January 2020 + Imprecise orderring of canary + initialization + + + + FreeBSD-EN-20:02.nmount + 28 January 2020 + Invalid pointer dereference + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Jan 28 20:53:11 2020 (r357228) +++ stable/11/release/doc/share/xml/security.xml Tue Jan 28 20:53:28 2020 (r357229) @@ -125,6 +125,20 @@ 12 November 2019 Intel CPU Microcode Update + + + FreeBSD-SA-20:01.libfetch + 28 January 2020 + &man.fetch.3; buffer overflow + + + + FreeBSD-SA-20:03.thrmisc + 28 January 2020 + Kennel stack data disclosure + From owner-svn-src-all@freebsd.org Tue Jan 28 20:56:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C710723FF03; Tue, 28 Jan 2020 20:56:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486f6x4xh9z4cYD; Tue, 28 Jan 2020 20:56:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4BFCFD1; Tue, 28 Jan 2020 20:56:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKufsM010212; Tue, 28 Jan 2020 20:56:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKufbA010210; Tue, 28 Jan 2020 20:56:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001282056.00SKufbA010210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 28 Jan 2020 20:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357230 - in stable/11/release/doc/en_US.ISO8859-1: errata hardware X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/release/doc/en_US.ISO8859-1: errata hardware X-SVN-Commit-Revision: 357230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:56:41 -0000 Author: gjb Date: Tue Jan 28 20:56:40 2020 New Revision: 357230 URL: https://svnweb.freebsd.org/changeset/base/357230 Log: Bump copyright years after recent edits. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jan 28 20:53:28 2020 (r357229) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jan 28 20:56:40 2020 (r357230) @@ -24,7 +24,7 @@ $FreeBSD$ - 2019 + 2020 The &os; Documentation Project Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Jan 28 20:53:28 2020 (r357229) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Tue Jan 28 20:56:40 2020 (r357230) @@ -40,6 +40,8 @@ 2016 2017 2018 + 2019 + 2020 The &os; Documentation Project From owner-svn-src-all@freebsd.org Tue Jan 28 21:47:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46469242140; Tue, 28 Jan 2020 21:47:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486gF01413z3BxT; Tue, 28 Jan 2020 21:47:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EFF1A14; Tue, 28 Jan 2020 21:46:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SLkxmw040625; Tue, 28 Jan 2020 21:46:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SLkxKv040624; Tue, 28 Jan 2020 21:46:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282146.00SLkxKv040624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 21:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357232 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 357232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 21:47:00 -0000 Author: dim Date: Tue Jan 28 21:46:59 2020 New Revision: 357232 URL: https://svnweb.freebsd.org/changeset/base/357232 Log: Merge r357231 from the clang1000-import branch: Work around assembler error from clang 10.0.0 in gptboot: stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes. jmp MEM_JMP # Start BTX ^ Use the same construct as in stand/i386/boot2/boot1.S, which ensures the jump distance does not become too large. MFC after: 3 days Modified: head/stand/i386/gptboot/gptldr.S Directory Properties: head/ (props changed) Modified: head/stand/i386/gptboot/gptldr.S ============================================================================== --- head/stand/i386/gptboot/gptldr.S Tue Jan 28 21:41:37 2020 (r357231) +++ head/stand/i386/gptboot/gptldr.S Tue Jan 28 21:46:59 2020 (r357232) @@ -138,5 +138,5 @@ seta20.3: sti # Enable interrupts * Save drive number from BIOS so boot2 can see it and start BTX. */ movb %dl,MEM_ARG - jmp MEM_JMP # Start BTX + jmp start+MEM_JMP-MEM_ORG # Start BTX end: From owner-svn-src-all@freebsd.org Tue Jan 28 22:44:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 157FE2447BD; Tue, 28 Jan 2020 22:44:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486hWF6KX8z3H0q; Tue, 28 Jan 2020 22:44:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C142C25A7; Tue, 28 Jan 2020 22:44:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SMiP9Q077449; Tue, 28 Jan 2020 22:44:25 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SMiPrb077446; Tue, 28 Jan 2020 22:44:25 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001282244.00SMiPrb077446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 28 Jan 2020 22:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357233 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 22:44:26 -0000 Author: kp Date: Tue Jan 28 22:44:24 2020 New Revision: 357233 URL: https://svnweb.freebsd.org/changeset/base/357233 Log: epair: Do not abuse params to register the second interface if_epair used the 'params' argument to pass a pointer to the b interface through if_clone_create(). This pointer can be controlled by userspace, which means it could be abused to trigger a panic. While this requires PRIV_NET_IFCREATE privileges those are assigned to vnet jails, which means that vnet jails could panic the system. Reported by: Ilja Van Sprundel MFC after: 3 days Modified: head/sys/net/if_clone.c head/sys/net/if_clone.h head/sys/net/if_epair.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Tue Jan 28 21:46:59 2020 (r357232) +++ head/sys/net/if_clone.c Tue Jan 28 22:44:24 2020 (r357233) @@ -211,6 +211,18 @@ if_clone_create(char *name, size_t len, caddr_t params return (if_clone_createif(ifc, name, len, params)); } +void +if_clone_addif(struct if_clone *ifc, struct ifnet *ifp) +{ + + if ((ifc->ifc_flags & IFC_NOGROUP) == 0) + if_addgroup(ifp, ifc->ifc_name); + + IF_CLONE_LOCK(ifc); + IFC_IFLIST_INSERT(ifc, ifp); + IF_CLONE_UNLOCK(ifc); +} + /* * Create a clone network interface. */ @@ -233,12 +245,7 @@ if_clone_createif(struct if_clone *ifc, char *name, si if (ifp == NULL) panic("%s: lookup failed for %s", __func__, name); - if ((ifc->ifc_flags & IFC_NOGROUP) == 0) - if_addgroup(ifp, ifc->ifc_name); - - IF_CLONE_LOCK(ifc); - IFC_IFLIST_INSERT(ifc, ifp); - IF_CLONE_UNLOCK(ifc); + if_clone_addif(ifc, ifp); } return (err); Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Tue Jan 28 21:46:59 2020 (r357232) +++ head/sys/net/if_clone.h Tue Jan 28 22:44:24 2020 (r357233) @@ -79,7 +79,8 @@ int if_clone_list(struct if_clonereq *); struct if_clone *if_clone_findifc(struct ifnet *); void if_clone_addgroup(struct ifnet *, struct if_clone *); -/* The below interface used only by epair(4). */ +/* The below interfaces are used only by epair(4). */ +void if_clone_addif(struct if_clone *, struct ifnet *); int if_clone_destroyif(struct if_clone *, struct ifnet *); #endif /* _KERNEL */ Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue Jan 28 21:46:59 2020 (r357232) +++ head/sys/net/if_epair.c Tue Jan 28 22:44:24 2020 (r357233) @@ -711,6 +711,21 @@ epair_clone_match(struct if_clone *ifc, const char *na return (1); } +static void +epair_clone_add(struct if_clone *ifc, struct epair_softc *scb) +{ + struct ifnet *ifp; + uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ + + ifp = scb->ifp; + /* Copy epairNa etheraddr and change the last byte. */ + memcpy(eaddr, scb->oifp->if_hw_addr, ETHER_ADDR_LEN); + eaddr[5] = 0x0b; + ether_ifattach(ifp, eaddr); + + if_clone_addif(ifc, ifp); +} + static int epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { @@ -723,24 +738,6 @@ epair_clone_create(struct if_clone *ifc, char *name, s uint32_t hash; uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ - /* - * We are abusing params to create our second interface. - * Actually we already created it and called if_clone_create() - * for it to do the official insertion procedure the moment we knew - * it cannot fail anymore. So just do attach it here. - */ - if (params) { - scb = (struct epair_softc *)params; - ifp = scb->ifp; - /* Copy epairNa etheraddr and change the last byte. */ - memcpy(eaddr, scb->oifp->if_hw_addr, ETHER_ADDR_LEN); - eaddr[5] = 0x0b; - ether_ifattach(ifp, eaddr); - /* Correctly set the name for the cloner list. */ - strlcpy(name, ifp->if_xname, len); - return (0); - } - /* Try to see if a special unit was requested. */ error = ifc_name2unit(name, &unit); if (error != 0) @@ -891,10 +888,11 @@ epair_clone_create(struct if_clone *ifc, char *name, s if_setsendqready(ifp); /* We need to play some tricks here for the second interface. */ strlcpy(name, epairname, len); - error = if_clone_create(name, len, (caddr_t)scb); - if (error) - panic("%s: if_clone_create() for our 2nd iface failed: %d", - __func__, error); + + /* Correctly set the name for the cloner list. */ + strlcpy(name, scb->ifp->if_xname, len); + epair_clone_add(ifc, scb); + scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; From owner-svn-src-all@freebsd.org Tue Jan 28 22:46:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FF85244926; Tue, 28 Jan 2020 22:46:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486hZ36jn8z3H9X; Tue, 28 Jan 2020 22:46:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1BED25AA; Tue, 28 Jan 2020 22:46:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SMkpVr077620; Tue, 28 Jan 2020 22:46:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SMkpQN077618; Tue, 28 Jan 2020 22:46:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001282246.00SMkpQN077618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 28 Jan 2020 22:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357234 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 357234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 22:46:52 -0000 Author: kp Date: Tue Jan 28 22:46:51 2020 New Revision: 357234 URL: https://svnweb.freebsd.org/changeset/base/357234 Log: tests: Test for an epair panic if_epair abused the ifr_data field to insert its second interface in IFC_IFLIST. If userspace provides a value for ifr_data it would get dereferenced by the kernel leading to a panic. Reported by: Ilja Van Sprundel MFC after: 3 days Added: head/tests/sys/net/if_epair.c (contents, props changed) Modified: head/tests/sys/net/Makefile Modified: head/tests/sys/net/Makefile ============================================================================== --- head/tests/sys/net/Makefile Tue Jan 28 22:44:24 2020 (r357233) +++ head/tests/sys/net/Makefile Tue Jan 28 22:46:51 2020 (r357234) @@ -9,6 +9,7 @@ ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan +ATF_TESTS_C+= if_epair TESTS_SUBDIRS+= routing @@ -18,7 +19,7 @@ TESTS_SUBDIRS+= routing TEST_METADATA+= is_exclusive=true MAN= -PROG= randsleep +PROGS+= randsleep WARNS?= 6 Added: head/tests/sys/net/if_epair.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/net/if_epair.c Tue Jan 28 22:46:51 2020 (r357234) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2020 Kristof Provost + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +ATF_TC(params); +ATF_TC_HEAD(params, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(params, tc) +{ + struct ifreq ifr; + int s; + + s = kldload("if_epair"); + if (s != 0) + atf_tc_fail("Failed to load if_epair"); + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) + atf_tc_fail("Failed to create socket"); + + bzero(&ifr, sizeof(ifr)); + ifr.ifr_data = (caddr_t)-1; + (void) strlcpy(ifr.ifr_name, "epair", sizeof(ifr.ifr_name)); + + ioctl(s, SIOCIFCREATE2, &ifr); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, params); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Tue Jan 28 23:07:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6748B245121; Tue, 28 Jan 2020 23:07:32 +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 486j1w27SFz3JBd; Tue, 28 Jan 2020 23:07:32 +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 449052968; Tue, 28 Jan 2020 23:07:32 +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 00SN7W8h089566; Tue, 28 Jan 2020 23:07:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SN7WZk089565; Tue, 28 Jan 2020 23:07:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202001282307.00SN7WZk089565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 28 Jan 2020 23:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357235 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 357235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 23:07:32 -0000 Author: asomers Date: Tue Jan 28 23:07:31 2020 New Revision: 357235 URL: https://svnweb.freebsd.org/changeset/base/357235 Log: Speed up "zpool import" in the presence of many zvols By default, zpools may not be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does. This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots. PR: 241083 Reported by: Martin Birgmeier Reviewed by: mav, Ryan Moeller MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D22077 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Jan 28 22:46:51 2020 (r357234) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Jan 28 23:07:31 2020 (r357235) @@ -1244,12 +1244,20 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importarg avl_tree_t slice_cache; rdsk_node_t *slice; void *cookie; + boolean_t skip_zvols = B_FALSE; + int value; + size_t size = sizeof(value); if (dirs == 0) { dirs = 1; dir = &default_dir; } + if (sysctlbyname("vfs.zfs.vol.recursive", &value, &size, NULL, 0) == 0 + && value == 0) { + skip_zvols = B_TRUE; + } + /* * Go through and read the label configuration information from every * possible device, organizing the information according to pool GUID @@ -1314,6 +1322,10 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importarg } LIST_FOREACH(mp, &mesh.lg_class, lg_class) { + if (skip_zvols && + strcmp(mp->lg_name, "ZFS::ZVOL") == 0) { + continue; + } LIST_FOREACH(gp, &mp->lg_geom, lg_geom) { LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { slice = zfs_alloc(hdl, sizeof (rdsk_node_t)); From owner-svn-src-all@freebsd.org Wed Jan 29 00:28:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08DDE2476FD; Wed, 29 Jan 2020 00:28:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486kqk6RTjz3N4g; Wed, 29 Jan 2020 00:28:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D83C939E7; Wed, 29 Jan 2020 00:28:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T0SovM037300; Wed, 29 Jan 2020 00:28:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T0SoXf037299; Wed, 29 Jan 2020 00:28:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001290028.00T0SoXf037299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 29 Jan 2020 00:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357236 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 357236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 00:28:51 -0000 Author: imp Date: Wed Jan 29 00:28:50 2020 New Revision: 357236 URL: https://svnweb.freebsd.org/changeset/base/357236 Log: Fix spelling of removable Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jan 28 23:07:31 2020 (r357235) +++ head/sys/cam/scsi/scsi_da.c Wed Jan 29 00:28:50 2020 (r357236) @@ -1796,7 +1796,7 @@ daclose(struct disk *dp) } /* - * If we've got removeable media, mark the blocksize as + * If we've got removable media, mark the blocksize as * unavailable, since it could change when new media is * inserted. */ From owner-svn-src-all@freebsd.org Wed Jan 29 01:51:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 771331B1EE9; Wed, 29 Jan 2020 01:51: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 486mfy2ZMWz3whn; Wed, 29 Jan 2020 01:51: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 52C58495C; Wed, 29 Jan 2020 01:51: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 00T1pM5S085401; Wed, 29 Jan 2020 01:51:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T1pMHu085400; Wed, 29 Jan 2020 01:51:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001290151.00T1pMHu085400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 29 Jan 2020 01:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357237 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 01:51:22 -0000 Author: mjg Date: Wed Jan 29 01:51:21 2020 New Revision: 357237 URL: https://svnweb.freebsd.org/changeset/base/357237 Log: vfs: add VNPASS macro and augment VNASSERT to print more about the assert Sample out put now instead of mere VNASSERT failed: VNASSERT failed: vp->v_holdcnt == 1234 not true at /usr/src/sys/kern/vfs_subr.c:3148 (vputx) Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23396 Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Jan 29 00:28:50 2020 (r357236) +++ head/sys/sys/systm.h Wed Jan 29 01:51:21 2020 (r357237) @@ -107,15 +107,23 @@ void kassert_panic(const char *fmt, ...) __printflike } while (0) #define VNASSERT(exp, vp, msg) do { \ if (__predict_false(!(exp))) { \ - vn_printf(vp, "VNASSERT failed\n"); \ + vn_printf(vp, "VNASSERT failed: %s not true at %s:%d (%s)\n",\ + #exp, __FILE__, __LINE__, __func__); \ kassert_panic msg; \ } \ } while (0) +#define VNPASS(exp, vp) do { \ + const char *_exp = #exp; \ + VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ + _exp, __FILE__, __LINE__, __func__)); \ +} while (0) #else #define KASSERT(exp,msg) do { \ } while (0) #define VNASSERT(exp, vp, msg) do { \ +} while (0) +#define VNPASS(exp, vp) do { \ } while (0) #endif From owner-svn-src-all@freebsd.org Wed Jan 29 01:52:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1241A1B2186; Wed, 29 Jan 2020 01:52: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 486mhC6mnLz3x2H; Wed, 29 Jan 2020 01:52:27 +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 E3EFD4AEF; Wed, 29 Jan 2020 01:52:27 +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 00T1qRiZ090236; Wed, 29 Jan 2020 01:52:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T1qRfT090235; Wed, 29 Jan 2020 01:52:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001290152.00T1qRfT090235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 29 Jan 2020 01:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357238 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 357238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 01:52:28 -0000 Author: mjg Date: Wed Jan 29 01:52:27 2020 New Revision: 357238 URL: https://svnweb.freebsd.org/changeset/base/357238 Log: libc: remove forward compat added in r356830 for F_ISUNIONSTACK Modified: head/lib/libc/gen/opendir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Wed Jan 29 01:51:21 2020 (r357237) +++ head/lib/libc/gen/opendir.c Wed Jan 29 01:52:27 2020 (r357238) @@ -35,8 +35,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include -#include -#include #include #include @@ -276,7 +274,6 @@ _filldir(DIR *dirp, bool use_current_pos) static bool is_unionstack(int fd) { - struct statfs sfb; int unionstack; unionstack = _fcntl(fd, F_ISUNIONSTACK, 0); @@ -284,12 +281,10 @@ is_unionstack(int fd) return (unionstack); /* - * Temporary compat for kernels which don't provide F_ISUNIONSTACK. + * Should not happen unless running on a kernel without the op, + * but no use rendering the system useless in such a case. */ - if (_fstatfs(fd, &sfb) < 0) - return (true); - return (strcmp(sfb.f_fstypename, "unionfs") == 0 || - (sfb.f_flags & MNT_UNION)); + return (0); } /* From owner-svn-src-all@freebsd.org Wed Jan 29 01:57:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D89B1B2486; Wed, 29 Jan 2020 01:57:08 +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 486mnc1mNbz3xJT; Wed, 29 Jan 2020 01:57:08 +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 37BB64AFB; Wed, 29 Jan 2020 01:57:08 +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 00T1v8HD090523; Wed, 29 Jan 2020 01:57:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T1v8rp090522; Wed, 29 Jan 2020 01:57:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001290157.00T1v8rp090522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 29 Jan 2020 01:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357239 - head/lib/libc/amd64/string X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/amd64/string X-SVN-Commit-Revision: 357239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 01:57:08 -0000 Author: mjg Date: Wed Jan 29 01:57:07 2020 New Revision: 357239 URL: https://svnweb.freebsd.org/changeset/base/357239 Log: amd64: sync up libc memcmp with the kernel version (r357208) Modified: head/lib/libc/amd64/string/memcmp.S Modified: head/lib/libc/amd64/string/memcmp.S ============================================================================== --- head/lib/libc/amd64/string/memcmp.S Wed Jan 29 01:52:27 2020 (r357238) +++ head/lib/libc/amd64/string/memcmp.S Wed Jan 29 01:57:07 2020 (r357239) @@ -31,91 +31,185 @@ #include __FBSDID("$FreeBSD$"); +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + ENTRY(memcmp) - cmpq $16,%rdx - jae 5f -1: - testq %rdx,%rdx - je 3f - xorl %ecx,%ecx -2: - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jz 3f - movzbl (%rdi,%rcx,1),%eax - movzbl (%rsi,%rcx,1),%r8d - cmpb %r8b,%al - jne 4f - addq $1,%rcx - cmpq %rcx,%rdx - jne 2b -3: xorl %eax,%eax +10: + cmpq $16,%rdx + ja 101632f + +100816: + cmpb $8,%dl + jl 100408f + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 1f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10081608f ret -4: - subl %r8d,%eax +100408: + cmpb $4,%dl + jl 100204f + movl (%rsi),%r8d + movl (%rdi),%r9d + cmpl %r8d,%r9d + jne 1f + movl -4(%rsi,%rdx),%r8d + movl -4(%rdi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f ret -5: +100204: + cmpb $2,%dl + jl 100001f + movzwl (%rsi),%r8d + movzwl (%rdi),%r9d + cmpl %r8d,%r9d + jne 1f + movzwl -2(%rsi,%rdx),%r8d + movzwl -2(%rdi,%rdx),%r9d + cmpl %r8d,%r9d + jne 1f + ret +100001: + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%r8d + movzbl (%rsi),%r9d + cmpb %r8b,%r9b + jne 1f +100000: + ret +ALIGN_TEXT +101632: cmpq $32,%rdx - jae 7f -6: - /* - * 8 bytes - */ + ja 103200f movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1b - leaq 8(%rdi),%rdi - leaq 8(%rsi),%rsi - subq $8,%rdx - cmpq $8,%rdx - jae 6b - jl 1b - jmp 3b -7: - /* - * 32 bytes - */ - movq (%rsi),%r8 + jne 1f + movq 8(%rdi),%r8 movq 8(%rsi),%r9 - subq (%rdi),%r8 - subq 8(%rdi),%r9 + cmpq %r8,%r9 + jne 10163208f + movq -16(%rdi,%rdx),%r8 + movq -16(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163216f + movq -8(%rdi,%rdx),%r8 + movq -8(%rsi,%rdx),%r9 + cmpq %r8,%r9 + jne 10163224f + ret +ALIGN_TEXT +103200: + movq (%rdi),%r8 + movq 8(%rdi),%r9 + subq (%rsi),%r8 + subq 8(%rsi),%r9 or %r8,%r9 - jnz 1b + jnz 10320000f - movq 16(%rsi),%r8 - movq 24(%rsi),%r9 - subq 16(%rdi),%r8 - subq 24(%rdi),%r9 - or %r8,%r9 - jnz 1b + movq 16(%rdi),%r8 + movq 24(%rdi),%r9 + subq 16(%rsi),%r8 + subq 24(%rsi),%r9 + or %r8,%r9 + jnz 10320016f leaq 32(%rdi),%rdi leaq 32(%rsi),%rsi subq $32,%rdx cmpq $32,%rdx - jae 7b - jnz 1b - jmp 3b + jae 103200b + cmpb $0,%dl + jne 10b + ret + +10320016: + leaq 16(%rdi),%rdi + leaq 16(%rsi),%rsi +10320000: +/* + * Mismatch was found within a 16 bytes range. The part of the routine + * which calculates it only operates on sizes up to 8 bytes. Find the + * right part. + */ + movq (%rdi),%r8 + movq (%rsi),%r9 + cmpq %r8,%r9 + jne 1f + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 1f +10163224: + leaq -8(%rdi,%rdx),%rdi + leaq -8(%rsi,%rdx),%rsi + jmp 1f +10163216: + leaq -16(%rdi,%rdx),%rdi + leaq -16(%rsi,%rdx),%rsi + jmp 1f +10163208: +10081608: + leaq 8(%rdi),%rdi + leaq 8(%rsi),%rsi + jmp 1f + +/* + * Mismatch was found. We have no more than 8 bytes to inspect. + */ +ALIGN_TEXT +1: + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 1(%rdi),%eax + movzbl 1(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 2(%rdi),%eax + movzbl 2(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 3(%rdi),%eax + movzbl 3(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 4(%rdi),%eax + movzbl 4(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 5(%rdi),%eax + movzbl 5(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 6(%rdi),%eax + movzbl 6(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + movzbl 7(%rdi),%eax + movzbl 7(%rsi),%r8d + cmpb %r8b,%al + jne 2f + + xorl %eax,%eax + ret +2: + subl %r8d,%eax + ret END(memcmp) .section .note.GNU-stack,"",%progbits From owner-svn-src-all@freebsd.org Wed Jan 29 03:15:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A864F1B4DAF; Wed, 29 Jan 2020 03:15:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486pX740Cgz42P6; Wed, 29 Jan 2020 03:15:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8439C5A9A; Wed, 29 Jan 2020 03:15:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T3FZjf039774; Wed, 29 Jan 2020 03:15:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T3FZGd039773; Wed, 29 Jan 2020 03:15:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290315.00T3FZGd039773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 03:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357240 - in head/sys: kern x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern x86/cpufreq X-SVN-Commit-Revision: 357240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 03:15:35 -0000 Author: cem Date: Wed Jan 29 03:15:34 2020 New Revision: 357240 URL: https://svnweb.freebsd.org/changeset/base/357240 Log: hwpstate_intel(4): Silence/fix Coverity reports These were all introduced in the initial import of hwpstate_intel(4). Reported by: Coverity CIDs: 1413161, 1413164, 1413165, 1413167 X-MFC-With: r357002 Modified: head/sys/kern/kern_cpu.c head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Wed Jan 29 01:57:07 2020 (r357239) +++ head/sys/kern/kern_cpu.c Wed Jan 29 03:15:34 2020 (r357240) @@ -473,11 +473,12 @@ cf_get_method(device_t dev, struct cf_level *level) * first try the driver and if that fails, fall back to * estimating. */ - if (CPUFREQ_DRV_GET(sc->cf_drv_dev, &set) != 0) - goto estimate; - sc->curr_level.total_set = set; - CF_DEBUG("get returning immediate freq %d\n", curr_set->freq); - goto out; + if (CPUFREQ_DRV_GET(sc->cf_drv_dev, &set) == 0) { + sc->curr_level.total_set = set; + CF_DEBUG("get returning immediate freq %d\n", + curr_set->freq); + goto out; + } } else if (curr_set->freq != CPUFREQ_VAL_UNKNOWN) { CF_DEBUG("get returning known freq %d\n", curr_set->freq); error = 0; @@ -522,9 +523,6 @@ cf_get_method(device_t dev, struct cf_level *level) CF_DEBUG("get matched freq %d from drivers\n", curr_set->freq); goto out; } - -estimate: - CF_MTX_ASSERT(&sc->lock); /* * We couldn't find an exact match, so attempt to estimate and then Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Wed Jan 29 01:57:07 2020 (r357239) +++ head/sys/x86/cpufreq/hwpstate_intel.c Wed Jan 29 03:15:34 2020 (r357240) @@ -147,17 +147,19 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "\tLowest Performance: %03ju\n", (data >> 24) & 0xff); rdmsr_safe(MSR_IA32_HWP_REQUEST, &data); - if (sc->hwp_pkg_ctrl && (data & IA32_HWP_REQUEST_PACKAGE_CONTROL)) { + data2 = 0; + if (sc->hwp_pkg_ctrl && (data & IA32_HWP_REQUEST_PACKAGE_CONTROL)) rdmsr_safe(MSR_IA32_HWP_REQUEST_PKG, &data2); - } sbuf_putc(sb, '\n'); -#define pkg_print(x, name, offset) do { \ - if (!sc->hwp_pkg_ctrl || (data & x) != 0) \ - sbuf_printf(sb, "\t%s: %03ju\n", name, (data >> offset) & 0xff);\ - else \ - sbuf_printf(sb, "\t%s: %03ju\n", name, (data2 >> offset) & 0xff);\ +#define pkg_print(x, name, offset) do { \ + if (!sc->hwp_pkg_ctrl || (data & x) != 0) \ + sbuf_printf(sb, "\t%s: %03u\n", name, \ + (unsigned)(data >> offset) & 0xff); \ + else \ + sbuf_printf(sb, "\t%s: %03u\n", name, \ + (unsigned)(data2 >> offset) & 0xff); \ } while (0) pkg_print(IA32_HWP_REQUEST_EPP_VALID, @@ -413,7 +415,7 @@ intel_hwpstate_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "epp", CTLTYPE_INT | CTLFLAG_RWTUN, dev, sizeof(dev), + "epp", CTLTYPE_INT | CTLFLAG_RWTUN, dev, 0, sysctl_epp_select, "I", "Efficiency/Performance Preference " "(range from 0, most performant, through 100, most efficient)"); From owner-svn-src-all@freebsd.org Wed Jan 29 04:31:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A1041B7880; Wed, 29 Jan 2020 04:31:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486rCg2trxz45kV; Wed, 29 Jan 2020 04:31:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E73668CA; Wed, 29 Jan 2020 04:31:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T4VRLJ086343; Wed, 29 Jan 2020 04:31:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T4VRCF086342; Wed, 29 Jan 2020 04:31:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290431.00T4VRCF086342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 04:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357241 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 357241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:31:27 -0000 Author: cem Date: Wed Jan 29 04:31:26 2020 New Revision: 357241 URL: https://svnweb.freebsd.org/changeset/base/357241 Log: libpmc: jevents: Partial style(9) pass Sort headers, move includes up to the top of the file, function return types on their own line; no functional change. Modified: head/lib/libpmc/pmu-events/jevents.c Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Wed Jan 29 03:15:34 2020 (r357240) +++ head/lib/libpmc/pmu-events/jevents.c Wed Jan 29 04:31:26 2020 (r357241) @@ -35,18 +35,22 @@ #include /* getrlimit */ #include #include /* getrlimit */ + #include #include #include +#include +#include #include #include #include +#include #include #include #include #include #include -#include + #include "list.h" #include "jsmn.h" #include "json.h" @@ -56,12 +60,11 @@ static int nftw_ordered(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int nfds, int ftwflags); -_Noreturn void _Exit(int); - int verbose; static char *prog; -int eprintf(int level, int var, const char *fmt, ...) +int +eprintf(int level, int var, const char *fmt, ...) { int ret; @@ -79,13 +82,14 @@ int eprintf(int level, int var, const char *fmt, ...) return ret; } -__attribute__((weak)) char *get_cpu_str(void) +__attribute__((weak)) char * +get_cpu_str(void) { return NULL; } -static void addfield(char *map, char **dst, const char *sep, - const char *a, jsmntok_t *bt) +static void +addfield(char *map, char **dst, const char *sep, const char *a, jsmntok_t *bt) { unsigned int len = strlen(a) + 1 + strlen(sep); int olen = *dst ? strlen(*dst) : 0; @@ -108,13 +112,15 @@ static void addfield(char *map, char **dst, const char strncat(*dst, map + bt->start, blen); } -static void fixname(char *s) +static void +fixname(char *s) { for (; *s; s++) *s = tolower(*s); } -static void fixdesc(char *s) +static void +fixdesc(char *s) { char *e = s + strlen(s); @@ -127,7 +133,8 @@ static void fixdesc(char *s) } /* Add escapes for '\' so they are proper C strings. */ -static char *fixregex(char *s) +static char * +fixregex(char *s) { int len = 0; int esc_count = 0; @@ -191,7 +198,8 @@ static struct field { { NULL, NULL } }; -static void cut_comma(char *map, jsmntok_t *newval) +static void +cut_comma(char *map, jsmntok_t *newval) { int i; @@ -202,8 +210,8 @@ static void cut_comma(char *map, jsmntok_t *newval) } } -static int match_field(char *map, jsmntok_t *field, int nz, - char **event, jsmntok_t *val) +static int +match_field(char *map, jsmntok_t *field, int nz, char **event, jsmntok_t *val) { struct field *f; jsmntok_t newval = *val; @@ -217,7 +225,8 @@ static int match_field(char *map, jsmntok_t *field, in return 0; } -static struct msrmap *lookup_msr(char *map, jsmntok_t *val) +static struct msrmap * +lookup_msr(char *map, jsmntok_t *val) { jsmntok_t newval = *val; static bool warned; @@ -246,7 +255,8 @@ static struct map { {} }; -static const char *field_to_perf(struct map *table, char *map, jsmntok_t *val) +static const char * +field_to_perf(struct map *table, char *map, jsmntok_t *val) { int i; @@ -270,7 +280,8 @@ static const char *field_to_perf(struct map *table, ch static char *topic; -static char *get_topic(void) +static char * +get_topic(void) { char *tp; int i; @@ -296,7 +307,8 @@ static char *get_topic(void) return tp; } -static int add_topic(const char *bname) +static int +add_topic(const char *bname) { free(topic); topic = strdup(bname); @@ -315,17 +327,17 @@ struct perf_entry_data { static int close_table; -static void print_events_table_prefix(FILE *fp, const char *tblname) +static void +print_events_table_prefix(FILE *fp, const char *tblname) { fprintf(fp, "static struct pmu_event %s[] = {\n", tblname); close_table = 1; } -static int print_events_table_entry(void *data, char *name, const char *event, - char *desc, char *long_desc, - char *pmu, char *unit, char *perpkg, - char *metric_expr, - char *metric_name, char *metric_group) +static int +print_events_table_entry(void *data, char *name, const char *event, char *desc, + char *long_desc, char *pmu, char *unit, char *perpkg, char *metric_expr, + char *metric_name, char *metric_group) { struct perf_entry_data *pd = data; FILE *outfp = pd->outfp; @@ -405,7 +417,8 @@ struct event_struct { static LIST_HEAD(arch_std_events); -static void free_arch_std_events(void) +static void +free_arch_std_events(void) { struct event_struct *es, *next; @@ -416,10 +429,10 @@ static void free_arch_std_events(void) } } -static int save_arch_std_events(void *data __unused, char *name, const char *event, - char *desc, char *long_desc, char *pmu, - char *unit, char *perpkg, char *metric_expr, - char *metric_name, char *metric_group) +static int +save_arch_std_events(void *data __unused, char *name, const char *event, + char *desc, char *long_desc, char *pmu, char *unit, char *perpkg, + char *metric_expr, char *metric_name, char *metric_group) { struct event_struct *es; @@ -436,7 +449,8 @@ out_free: return -ENOMEM; } -static void print_events_table_suffix(FILE *outfp) +static void +print_events_table_suffix(FILE *outfp) { fprintf(outfp, "{\n"); @@ -464,7 +478,8 @@ static struct fixed { /* * Handle different fixed counter encodings between JSON and perf. */ -static const char *real_event(const char *name, char *event) +static const char * +real_event(const char *name, char *event) { int i; @@ -479,9 +494,9 @@ static const char *real_event(const char *name, char * static int try_fixup(const char *fn, char *arch_std, char **event, char **desc, - char **name, char **long_desc, char **pmu, char **filter __unused, - char **perpkg, char **unit, char **metric_expr, char **metric_name, - char **metric_group, unsigned long long eventcode) + char **name, char **long_desc, char **pmu, char **filter __unused, + char **perpkg, char **unit, char **metric_expr, char **metric_name, + char **metric_group, unsigned long long eventcode) { /* try to find matching event from arch standard values */ struct event_struct *es; @@ -504,7 +519,8 @@ try_fixup(const char *fn, char *arch_std, char **event } /* Call func with each event in the json file */ -int json_events(const char *fn, +int +json_events(const char *fn, int (*func)(void *data, char *name, const char *event, char *desc, char *long_desc, char *pmu, char *unit, char *perpkg, @@ -692,7 +708,8 @@ out_free: return err; } -static char *file_name_to_table_name(const char *fname) +static char * +file_name_to_table_name(const char *fname) { unsigned int i; int n; @@ -734,12 +751,14 @@ static char *file_name_to_table_name(const char *fname return tblname; } -static void print_mapping_table_prefix(FILE *outfp) +static void +print_mapping_table_prefix(FILE *outfp) { fprintf(outfp, "struct pmu_events_map pmu_events_map[] = {\n"); } -static void print_mapping_table_suffix(FILE *outfp) +static void +print_mapping_table_suffix(FILE *outfp) { /* * Print the terminating, NULL entry. @@ -755,7 +774,8 @@ static void print_mapping_table_suffix(FILE *outfp) fprintf(outfp, "};\n"); } -static int process_mapfile(FILE *outfp, char *fpath) +static int +process_mapfile(FILE *outfp, char *fpath) { int n = 16384; FILE *mapfp; @@ -838,7 +858,8 @@ out: * table. This would at least allow perf to build even if we can't find/use * the aliases. */ -static void create_empty_mapping(const char *output_file) +static void +create_empty_mapping(const char *output_file) { FILE *outfp; @@ -857,7 +878,8 @@ static void create_empty_mapping(const char *output_fi fclose(outfp); } -static int get_maxfds(void) +static int +get_maxfds(void) { struct rlimit rlim; @@ -877,7 +899,8 @@ static int get_maxfds(void) static FILE *eventsfp; static char *mapfile; -static int is_leaf_dir(const char *fpath) +static int +is_leaf_dir(const char *fpath) { DIR *d; struct dirent *dir; @@ -914,7 +937,8 @@ static int is_leaf_dir(const char *fpath) return res; } -static int is_json_file(const char *name) +static int +is_json_file(const char *name) { const char *suffix; @@ -928,8 +952,9 @@ static int is_json_file(const char *name) return 0; } -static int preprocess_arch_std_files(const char *fpath, const struct stat *sb, - int typeflag, struct FTW *ftwbuf) +static int +preprocess_arch_std_files(const char *fpath, const struct stat *sb, + int typeflag, struct FTW *ftwbuf) { int level = ftwbuf->level; int is_file = typeflag == FTW_F; @@ -940,8 +965,9 @@ static int preprocess_arch_std_files(const char *fpath return 0; } -static int process_one_file(const char *fpath, const struct stat *sb, - int typeflag, struct FTW *ftwbuf) +static int +process_one_file(const char *fpath, const struct stat *sb, int typeflag, + struct FTW *ftwbuf) { char *tblname; const char *bname; @@ -1070,7 +1096,8 @@ static int process_one_file(const char *fpath, const s * * Write out the PMU events tables and the mapping table to pmu-event.c. */ -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { int rc; int maxfds; @@ -1171,8 +1198,6 @@ empty_map: free_arch_std_events(); return 0; } - -#include static int fts_compare(const FTSENT * const *a, const FTSENT * const *b) From owner-svn-src-all@freebsd.org Wed Jan 29 04:32:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EC3E1B790B; Wed, 29 Jan 2020 04:32:07 +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 486rDR2GRhz45v5; Wed, 29 Jan 2020 04:32:07 +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 49148690D; Wed, 29 Jan 2020 04:32:07 +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 00T4W7fi086422; Wed, 29 Jan 2020 04:32:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T4W7cd086421; Wed, 29 Jan 2020 04:32:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001290432.00T4W7cd086421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 29 Jan 2020 04:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357242 - head/lib/csu/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/csu/powerpc64 X-SVN-Commit-Revision: 357242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:32:07 -0000 Author: jhibbits Date: Wed Jan 29 04:32:06 2020 New Revision: 357242 URL: https://svnweb.freebsd.org/changeset/base/357242 Log: powerpc64/csu: Rename dummy asm file to force use of 'cc' Implicit make rules build .S asm files with the compiler, rather than the assembler. r356889 removed GNU as from the build for powerpc targets, causing '.s' asm files to fail to build, due to a missing 'as'. Rename the one dummy asm file we have to a '.S' to force the implicit rules to build with the compiler rather than the assembler. Reported by: Francis Little Modified: head/lib/csu/powerpc64/Makefile Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Wed Jan 29 04:31:26 2020 (r357241) +++ head/lib/csu/powerpc64/Makefile Wed Jan 29 04:32:06 2020 (r357242) @@ -18,7 +18,7 @@ FILESDIR= ${LIBDIR} .undef LIBRARIES_ONLY CLEANFILES= ${OBJS} -CLEANFILES+= crt1.s crtsavres.s gcrt1.s Scrt1.s +CLEANFILES+= crt1.s crtsavres.S gcrt1.s Scrt1.s # See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not # directly compiled to .o files. @@ -28,7 +28,7 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} # On powerpc64 crtsavres is an empty file -crtsavres.s: +crtsavres.S: touch ${.TARGET} crt1.o: crt1.s From owner-svn-src-all@freebsd.org Wed Jan 29 04:33:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 504F71B79F2; Wed, 29 Jan 2020 04:33:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486rGL1Q12z46Jq; Wed, 29 Jan 2020 04:33:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA996933; Wed, 29 Jan 2020 04:33:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T4XkWI087271; Wed, 29 Jan 2020 04:33:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T4XkI8087270; Wed, 29 Jan 2020 04:33:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290433.00T4XkI8087270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 04:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357243 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 357243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:33:46 -0000 Author: cem Date: Wed Jan 29 04:33:45 2020 New Revision: 357243 URL: https://svnweb.freebsd.org/changeset/base/357243 Log: libpmc: jevents: Go ahead and use snprintf(3) Reported by: Coverity CID: 1391362 Modified: head/lib/libpmc/pmu-events/jevents.c Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Wed Jan 29 04:32:06 2020 (r357242) +++ head/lib/libpmc/pmu-events/jevents.c Wed Jan 29 04:33:45 2020 (r357243) @@ -921,7 +921,8 @@ is_leaf_dir(const char *fpath) char path[PATH_MAX]; struct stat st; - sprintf(path, "%s/%s", fpath, dir->d_name); + snprintf(path, sizeof(path), "%s/%s", fpath, + dir->d_name); if (stat(path, &st)) break; @@ -1080,10 +1081,6 @@ process_one_file(const char *fpath, const struct stat return err; } -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - /* * Starting in directory 'start_dirname', find the "mapfile.csv" and * the set of JSON files for the architecture 'arch'. @@ -1128,7 +1125,7 @@ main(int argc, char *argv[]) return 2; } - sprintf(ldirname, "%s/%s", start_dirname, arch); + snprintf(ldirname, sizeof(ldirname), "%s/%s", start_dirname, arch); /* If architecture does not have any event lists, bail out */ if (stat(ldirname, &stbuf) < 0) { From owner-svn-src-all@freebsd.org Wed Jan 29 04:41:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17DD51B7DFE; Wed, 29 Jan 2020 04:41:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486rRB6r77z46lP; Wed, 29 Jan 2020 04:41:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E60766987; Wed, 29 Jan 2020 04:41:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T4fQxS087696; Wed, 29 Jan 2020 04:41:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T4fQMR087695; Wed, 29 Jan 2020 04:41:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290441.00T4fQMR087695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 04:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357244 - head/sys/dev/qlxgb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/qlxgb X-SVN-Commit-Revision: 357244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:41:27 -0000 Author: cem Date: Wed Jan 29 04:41:26 2020 New Revision: 357244 URL: https://svnweb.freebsd.org/changeset/base/357244 Log: qlxgb(4): Use defined evaluation order Reported by: Coverity CID: 1193717 Modified: head/sys/dev/qlxgb/qla_os.c Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Wed Jan 29 04:33:45 2020 (r357243) +++ head/sys/dev/qlxgb/qla_os.c Wed Jan 29 04:41:26 2020 (r357244) @@ -226,7 +226,7 @@ qla_watchdog(void *arg) taskqueue_enqueue(ha->tx_tq, &ha->tx_task); } } - ha->watchdog_ticks = ha->watchdog_ticks++ % 1000; + ha->watchdog_ticks = (ha->watchdog_ticks + 1) % 1000; callout_reset(&ha->tx_callout, QLA_WATCHDOG_CALLOUT_TICKS, qla_watchdog, ha); } From owner-svn-src-all@freebsd.org Wed Jan 29 04:42:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD5DE1B7EE8; Wed, 29 Jan 2020 04:42:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486rSk53mlz46xt; Wed, 29 Jan 2020 04:42:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8D786AF9; Wed, 29 Jan 2020 04:42:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T4gkox093294; Wed, 29 Jan 2020 04:42:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T4gkKj093293; Wed, 29 Jan 2020 04:42:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290442.00T4gkKj093293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 04:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357245 - head/sys/dev/qlxge X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/qlxge X-SVN-Commit-Revision: 357245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:42:46 -0000 Author: cem Date: Wed Jan 29 04:42:46 2020 New Revision: 357245 URL: https://svnweb.freebsd.org/changeset/base/357245 Log: qlxge(4): Ditto r357244 Reported by: Coverity CID: 1193716 Modified: head/sys/dev/qlxge/qls_os.c Modified: head/sys/dev/qlxge/qls_os.c ============================================================================== --- head/sys/dev/qlxge/qls_os.c Wed Jan 29 04:41:26 2020 (r357244) +++ head/sys/dev/qlxge/qls_os.c Wed Jan 29 04:42:46 2020 (r357245) @@ -321,7 +321,7 @@ qls_watchdog(void *arg) ha->qla_watchdog_paused = 1; } - ha->watchdog_ticks = ha->watchdog_ticks++ % 1000; + ha->watchdog_ticks = (ha->watchdog_ticks + 1) % 1000; callout_reset(&ha->tx_callout, QLA_WATCHDOG_CALLOUT_TICKS, qls_watchdog, ha); From owner-svn-src-all@freebsd.org Wed Jan 29 04:57:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB5F1C04EB for ; Wed, 29 Jan 2020 04:57:04 +0000 (UTC) (envelope-from susi@miguelito.website) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 486rnC5rBZz47RR for ; Wed, 29 Jan 2020 04:57:03 +0000 (UTC) (envelope-from susi@miguelito.website) Received: by mail-wr1-x441.google.com with SMTP id z7so18579819wrl.13 for ; Tue, 28 Jan 2020 20:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=miguelito-website.20150623.gappssmtp.com; s=20150623; h=date:from:to:message-id:in-reply-to:references:subject:mime-version; bh=P47GdvmgsU5J/fpf38vba55E6pTvKybvz1UjihrlJPk=; b=IVDJqhmoWDAjkwWXnVTMPZb61CxBgc/Pt7wlH4MVVDznb5FKHD8FZ7ya3aIT6OjAL9 yBQm4HNp5PID3UlLEptrbzT2FChn82BMFiPEQeJQ2pu6qShLnLtMUoJ8JqVVCiRrm9FX NNw+f3tL1J8RxbgrGsyDCvrFwWLxA0YsH5HGW83hTZ+GCuq8Gf3i1itJCj3Kun8KD6Rh dlycut5v/XS9YrsiskxjIctd1o35kRUl2It4u1dKtMyDXfgPKvSGDA4hWVl24Y6akDvd 7TeW+IO/Ul9EwRM4l6sAcN9QwgwbBb7KCzd4XcGf8noKnVuUdNHy1cUKaZneAtpSZP7O W9Bg== 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:message-id:in-reply-to:references :subject:mime-version; bh=P47GdvmgsU5J/fpf38vba55E6pTvKybvz1UjihrlJPk=; b=prnofZmv1nqOGw6QCTq+iF7HM9WgGl7iEWNvtSP5DrzyVJy9c9JyyyZv7+ZFsC3UXM DJZ/ofjOOzvwjVWna1puZ2qbVacj41rDkYNWqq5oGtTrEEfvzTGcQpwL/gJLxpOeG/fd aWq2zamsunTgpfS3u6r7PGlhW/CiJj+Qanf1g2iAyKcHrW+yNazVxAouiR2R4rjU2MHb huUFMm+hdpcd7xdE0oqcdjXbaaKxhbR6Qj03spLCNObdhiUfsPXZeNM669Pi04C102iV kJNbz64QA98z4Hm7VH2dIPW80oXeSxh0yYUt8mJxuCINLq9vqtYLshF+qFU//1AiCDWl 3k8g== X-Gm-Message-State: APjAAAX4fBIzmG+JacFIy6hNRxozFTP32gcfzmXfREV64MmMPFmoIRcx Dp9PJNQCucPEcz8bDzYV1exurpZ7+d8= X-Google-Smtp-Source: APXvYqyb8WDrYGFw6Ah5Y0fv/6muRW56dWS33nFFGhON/S0pzHGIu9o2Z6DyAwxU3teJopQrqmEDcw== X-Received: by 2002:adf:e812:: with SMTP id o18mr32104337wrm.127.1580273821358; Tue, 28 Jan 2020 20:57:01 -0800 (PST) Received: from b3.cedeliverynet.com (b3.cedeliverynet.com. [149.56.250.122]) by smtp.gmail.com with ESMTPSA id e18sm1192016wrw.70.2020.01.28.20.57.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jan 2020 20:57:00 -0800 (PST) Date: Wed, 29 Jan 2020 05:56:58 +0100 (CET) From: Susi Miguelito To: "svn-src-all@freebsd.org" Message-ID: <918325884.452554.1580273820719@cea0f62d0c75> In-Reply-To: <720903372.401171.1580013732628@cea0f62d0c75> References: <720903372.401171.1580013732628@cea0f62d0c75> Subject: Re: A question from Susi (for gcu-squad.org) MIME-Version: 1.0 X-Rspamd-Queue-Id: 486rnC5rBZz47RR X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=miguelito-website.20150623.gappssmtp.com header.s=20150623 header.b=IVDJqhmo; dmarc=none; spf=none (mx1.freebsd.org: domain of susi@miguelito.website has no SPF policy when checking 2a00:1450:4864:20::441) smtp.mailfrom=susi@miguelito.website X-Spamd-Result: default: False [-1.17 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[miguelito-website.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.99)[-0.986,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[miguelito.website]; URI_COUNT_ODD(1.00)[1]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.39)[ip: (2.41), ipnet: 2a00:1450::/32(-2.52), asn: 15169(-1.78), country: US(-0.05)]; DKIM_TRACE(0.00)[miguelito-website.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.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]; TO_DN_EQ_ADDR_ALL(0.00)[]; R_SPF_NA(0.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:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 04:57:04 -0000 Hi there,=C2=A0=20 I hope you are having a great day! I was wondering if you have received my= previous email because I haven't got a reply.=C2=A0 Any update? :)=20 Can we possibly do the posting in your site? =3D=3D=3D Thank you, Susi Mig= uelito=20 =20 From: Susi Miguelito Date: Sun Jan 26 11:42:09 CET 2020 To: "svn-src-all@freebsd.org" Subject: A question from Susi (for gcu-squad.org) Greetings! I=E2=80=99m Susi, editor at one of the internet=E2=80=99s best-= loved adult review sites. I=E2=80=99ve been reading through your site, and = I=E2=80=99d love to work with you =E2=80=93 ideally by buying a guest post.= In return, I can guarantee: A well-written, engaging post, created by indu= stry-leading copywriters.=C2=A0 A flexible approach; if you=E2=80=99ve got = a topic in mind, we can work with it. Otherwise, we=E2=80=99re happy to com= e up with the goods. SEO optimisation, with explicit or non-explicit keywor= ds covered. If this sounds like something you=E2=80=99d be up for, let me k= now. I look forward to discussing things further. =3D=3D=3D Thank you, Susi= Miguelito=20 From owner-svn-src-all@freebsd.org Wed Jan 29 05:25:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0C0D1C1392; Wed, 29 Jan 2020 05:25:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486sPr5fJJz48br; Wed, 29 Jan 2020 05:25:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB7557231; Wed, 29 Jan 2020 05:25:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T5PKfe017114; Wed, 29 Jan 2020 05:25:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T5PKKh017113; Wed, 29 Jan 2020 05:25:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290525.00T5PKKh017113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 05:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357246 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 357246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 05:25:20 -0000 Author: cem Date: Wed Jan 29 05:25:20 2020 New Revision: 357246 URL: https://svnweb.freebsd.org/changeset/base/357246 Log: qmath(3) test: Replace overcomplicated abomination with arc4random(3) The horrific GENRAND construction bent over backwards to construct 64-bit signed integers from the 31-bit output of random(3) for about 20 numbers per test. Reproducibility wasn't a goal: random(3) was seeded with srandomdev(3). Speed is not a factor for generating 20 integers with arc4random(3). Range is not a factor: all uses did not bound the range beyond that of the full [INT64_MIN, INT64_MAX]. Just use arc4random(3). Reported by: Coverity CIDs: 1404809, 1404817, 1404838, 1404840 and about 6x other identical reports of dubious code relating to the construction Modified: head/tests/sys/sys/qmath_test.c Modified: head/tests/sys/sys/qmath_test.c ============================================================================== --- head/tests/sys/sys/qmath_test.c Wed Jan 29 04:42:46 2020 (r357245) +++ head/tests/sys/sys/qmath_test.c Wed Jan 29 05:25:20 2020 (r357246) @@ -47,25 +47,7 @@ #define QTEST_QITRUNC(q, iv) ((iv) >> Q_RPSHFT(q)) #define QTEST_FFACTOR 32.0 -#define bitsperrand 31 -#define GENRAND(a, lb, ub) \ -({ \ - int _rembits; \ - do { \ - _rembits = Q_BITSPERBASEUP(ub) + Q_LTZ(lb); \ - *(a) = (__typeof(*(a)))0; \ - while (_rembits > 0) { \ - *(a) |= (((uint64_t)random()) & \ - ((1ULL << (_rembits > bitsperrand ? \ - bitsperrand : _rembits)) - 1)); \ - *(a) <<= (_rembits - (_rembits > bitsperrand ? \ - bitsperrand : _rembits)); \ - _rembits -= bitsperrand; \ - } \ - *(a) += lb; \ - } while (*(a) < (lb) || (uint64_t)*(a) > (ub)); \ - *(a); \ -}) +#define GENRAND(a) arc4random_buf((a), sizeof(*(a))) /* * Smoke tests for basic qmath operations, such as initialization @@ -213,11 +195,9 @@ ATF_TC_BODY(qmulq_s64q, tc) #endif int error; - srandomdev(); - for (int i = 0; i < 10;) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXX: We cheat a bit, to stand any chance of multiplying @@ -278,12 +258,9 @@ ATF_TC_BODY(qdivq_s64q, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/240219"); - - srandomdev(); - for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -324,11 +301,9 @@ ATF_TC_BODY(qaddq_s64q, tc) double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; int error; - srandomdev(); - for (int i = 0; i < 10;) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -372,11 +347,9 @@ ATF_TC_BODY(qsubq_s64q, tc) double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; int error; - srandomdev(); - for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -418,11 +391,9 @@ ATF_TC_BODY(qfraci_s64q, tc) int64_t a_int, b_int; int error; - srandomdev(); - for (int i = 0; i < 10;) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -465,11 +436,9 @@ ATF_TC_BODY(qmuli_s64q, tc) int64_t a_int, b_int; int error; - srandomdev(); - for (int i = 0; i < 10;) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -512,11 +481,9 @@ ATF_TC_BODY(qaddi_s64q, tc) int64_t a_int, b_int; int error; - srandomdev(); - for (int i = 0; i < 10;) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -563,11 +530,9 @@ ATF_TC_BODY(qsubi_s64q, tc) int64_t a_int, b_int; int error; - srandomdev(); - for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); - GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&a_s64q); + GENRAND(&b_s64q); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. From owner-svn-src-all@freebsd.org Wed Jan 29 05:31:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 280C41C15DD; Wed, 29 Jan 2020 05:31:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486sY90J70z4903; Wed, 29 Jan 2020 05:31:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0585F73AD; Wed, 29 Jan 2020 05:31:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T5VePM022144; Wed, 29 Jan 2020 05:31:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T5VeT1022143; Wed, 29 Jan 2020 05:31:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290531.00T5VeT1022143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 05:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357247 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 357247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 05:31:41 -0000 Author: cem Date: Wed Jan 29 05:31:40 2020 New Revision: 357247 URL: https://svnweb.freebsd.org/changeset/base/357247 Log: ixgbe(4): Eliminate bogus sizeof() expressions All of these uses of sizeof() were on the wrong type in relation to the pointer passed to SYSCTL_ADD_PROC as arg1. Fortunately, none of the handlers actually use arg2. So just don't pass a (non-zero) arg2. Reported by: Coverity CID: 1007701 Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Jan 29 05:25:20 2020 (r357246) +++ head/sys/dev/ixgbe/if_ix.c Wed Jan 29 05:31:40 2020 (r357247) @@ -1550,10 +1550,10 @@ ixgbe_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", - CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, 0, ixgbe_sysctl_tdh_handler, "IU", "Transmit Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail", - CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), + CTLTYPE_UINT | CTLFLAG_RD, txr, 0, ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tso_tx", CTLFLAG_RD, &txr->tso_tx, "TSO"); @@ -1570,18 +1570,17 @@ ixgbe_add_hw_stats(struct adapter *adapter) queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLTYPE_UINT | CTLFLAG_RW, &adapter->rx_queues[i], - sizeof(&adapter->rx_queues[i]), + CTLTYPE_UINT | CTLFLAG_RW, &adapter->rx_queues[i], 0, ixgbe_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "irqs", CTLFLAG_RD, &(adapter->rx_queues[i].irqs), "irqs on this queue"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head", - CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, 0, ixgbe_sysctl_rdh_handler, "IU", "Receive Descriptor Head"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail", - CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), + CTLTYPE_UINT | CTLFLAG_RD, rxr, 0, ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", CTLFLAG_RD, &rxr->rx_packets, "Queue Packets Received"); From owner-svn-src-all@freebsd.org Wed Jan 29 05:42:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24D141C1C58; Wed, 29 Jan 2020 05:42:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486snY06ywz49Tx; Wed, 29 Jan 2020 05:42:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F399D75C8; Wed, 29 Jan 2020 05:42:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T5gOb5028646; Wed, 29 Jan 2020 05:42:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T5gO3k028645; Wed, 29 Jan 2020 05:42:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290542.00T5gO3k028645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 05:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357248 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 357248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 05:42:25 -0000 Author: cem Date: Wed Jan 29 05:42:24 2020 New Revision: 357248 URL: https://svnweb.freebsd.org/changeset/base/357248 Log: bnxt(4): Eliminate wrong sizeof() expression in memset() While here, clean up magic numbers. The memset(,0,) (and M_ZERO!) can just be removed; the bit_alloc() API already zeros the allocation. No functional change. Reported by: Coverity CID: 1378286 Modified: head/sys/dev/bnxt/bnxt_hwrm.c Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Wed Jan 29 05:31:40 2020 (r357247) +++ head/sys/dev/bnxt/bnxt_hwrm.c Wed Jan 29 05:42:24 2020 (r357248) @@ -1778,16 +1778,14 @@ int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc uint32_t *events; int i; - async_events_bmap = bit_alloc(256, M_DEVBUF, M_WAITOK|M_ZERO); - events = (uint32_t *)async_events_bmap; +#define AE_BMAP_SZ_BITS 256 + async_events_bmap = bit_alloc(AE_BMAP_SZ_BITS, M_DEVBUF, M_WAITOK); bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR); req.enables = htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD); - memset(async_events_bmap, 0, sizeof(256 / 8)); - bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE); bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD); bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED); @@ -1801,8 +1799,12 @@ int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc } } - for (i = 0; i < 8; i++) +#define AE_BMAP_SZ_WORDS (AE_BMAP_SZ_BITS / 8 / sizeof(uint32_t)) + events = (uint32_t *)async_events_bmap; + for (i = 0; i < AE_BMAP_SZ_WORDS; i++) req.async_event_fwd[i] |= htole32(events[i]); +#undef AE_BMAP_SZ_WORDS +#undef AE_BMAP_SZ_BITS free(async_events_bmap, M_DEVBUF); From owner-svn-src-all@freebsd.org Wed Jan 29 05:59:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFED51C21B8; Wed, 29 Jan 2020 05:59:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486t965sS1z4B97; Wed, 29 Jan 2020 05:59:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F0177A2; Wed, 29 Jan 2020 05:59:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T5xM97035309; Wed, 29 Jan 2020 05:59:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T5xM4I035308; Wed, 29 Jan 2020 05:59:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001290559.00T5xM4I035308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 05:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357249 - head/usr.sbin/ypldap X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/ypldap X-SVN-Commit-Revision: 357249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 05:59:23 -0000 Author: cem Date: Wed Jan 29 05:59:22 2020 New Revision: 357249 URL: https://svnweb.freebsd.org/changeset/base/357249 Log: ypldap(8): Fix absent va_end() in 'goto fail' path In this path, we used va_start() without pairing it with va_end(). Add the va_end(). (va_start() without paired va_end() is undefined behavior per the C standard.) "In many implementations, [va_end] is a do-nothing operation; but those implementations that need it probably need it badly." - Rationale for the ANSI C Programming Language, § 4.8.1.3. Reported by: Coverity CID: 1340539 Modified: head/usr.sbin/ypldap/ber.c Modified: head/usr.sbin/ypldap/ber.c ============================================================================== --- head/usr.sbin/ypldap/ber.c Wed Jan 29 05:42:24 2020 (r357248) +++ head/usr.sbin/ypldap/ber.c Wed Jan 29 05:59:22 2020 (r357249) @@ -621,6 +621,7 @@ ber_printf_elements(struct ber_element *ber, char *fmt return (ber); fail: + va_end(ap); return (NULL); } From owner-svn-src-all@freebsd.org Wed Jan 29 08:46:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 558001C724B; Wed, 29 Jan 2020 08:46:36 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486xt41Xztz4Jh6; Wed, 29 Jan 2020 08:46:36 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 302C6968B; Wed, 29 Jan 2020 08:46:36 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T8kaqV036052; Wed, 29 Jan 2020 08:46:36 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T8kaaw036051; Wed, 29 Jan 2020 08:46:36 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <202001290846.00T8kaaw036051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 29 Jan 2020 08:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357250 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 357250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 08:46:36 -0000 Author: ganbold Date: Wed Jan 29 08:46:35 2020 New Revision: 357250 URL: https://svnweb.freebsd.org/changeset/base/357250 Log: Add USB3 related clock definitions for Rockchip RK3328 SoC. Reviewed by: manu Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Jan 29 05:59:22 2020 (r357249) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Jan 29 08:46:35 2020 (r357250) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); /* GATES */ +#define SCLK_USB3OTG_REF 96 +#define ACLK_USB3OTG 132 #define ACLK_PERI 153 #define PCLK_GPIO0 200 #define PCLK_GPIO1 201 @@ -61,6 +63,9 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C2 207 #define PCLK_I2C3 208 #define PCLK_TSADC 213 +#define PCLK_USB3PHY_OTG 224 +#define PCLK_USB3PHY_PIPE 225 +#define PCLK_USB3_GRF 226 #define HCLK_SDMMC 317 #define HCLK_SDIO 318 #define HCLK_EMMC 319 @@ -76,6 +81,7 @@ static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON4 */ CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0) CRU_GATE(0, "cpll_peri", "cpll", 0x210, 1) + CRU_GATE(SCLK_USB3OTG_REF, "clk_usb3otg_ref", "xin24m", 0x210, 7) /* CRU_CLKGATE_CON8 */ CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3) @@ -98,13 +104,21 @@ static struct rk_cru_gate rk3328_gates[] = { CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9) CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_bus", 0x240, 10) + /* CRU_CLKGATE_CON17 */ + CRU_GATE(PCLK_USB3_GRF, "pclk_usb3_grf", "pclk_phy_pre", 0x244, 2) + /* CRU_CLKGATE_CON19 */ CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0) CRU_GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0x24C, 1) CRU_GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0x24C, 2) CRU_GATE(0, "hclk_peri_niu", "hclk_peri", 0x24C, 12) CRU_GATE(0, "pclk_peri_niu", "hclk_peri", 0x24C, 13) + CRU_GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0x24C, 14) CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15) + + /* CRU_CLKGATE_CON28 */ + CRU_GATE(PCLK_USB3PHY_OTG, "pclk_usb3phy_otg", "pclk_phy_pre", 0x270, 1) + CRU_GATE(PCLK_USB3PHY_PIPE, "pclk_usb3phy_pipe", "pclk_phy_pre", 0x270, 2) }; /* @@ -991,6 +1005,78 @@ static struct rk_clk_composite_def i2c3 = { .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, }; +#define SCLK_USB3_REF 72 +#define SCLK_USB3_SUSPEND 73 +#define SCLK_USB3PHY_REF 94 +#define SCLK_REF_USB3OTG 95 +#define SCLK_USB3OTG_SUSPEND 97 +#define SCLK_REF_USB3OTG_SRC 98 + +static const char *ref_usb3otg_parents[] = { "xin24m", "clk_usb3otg_ref" }; + +static struct rk_clk_composite_def ref_usb3otg = { + .clkdef = { + .id = SCLK_REF_USB3OTG, + .name = "clk_ref_usb3otg", + .parent_names = ref_usb3otg_parents, + .parent_cnt = nitems(ref_usb3otg_parents), + }, + .muxdiv_offset = 0x1B4, + + .mux_shift = 8, + .mux_width = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX, +}; + +static const char *usb3otg_suspend_parents[] = { "xin24m"/*, "clk_rtc32k" */}; + +static struct rk_clk_composite_def usb3otg_suspend = { + .clkdef = { + .id = SCLK_USB3OTG_SUSPEND, + .name = "clk_usb3otg_suspend", + .parent_names = usb3otg_suspend_parents, + .parent_cnt = nitems(usb3otg_suspend_parents), + }, + .muxdiv_offset = 0x184, + + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 0, + .div_width = 10, + + /* CRU_CLKGATE_CON4 */ + .gate_offset = 0x210, + .gate_shift = 8, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static const char *ref_usb3otg_src_parents[] = { "cpll", "gpll" }; + +static struct rk_clk_composite_def ref_usb3otg_src = { + .clkdef = { + .id = SCLK_REF_USB3OTG_SRC, + .name = "clk_ref_usb3otg_src", + .parent_names = ref_usb3otg_src_parents, + .parent_cnt = nitems(ref_usb3otg_src_parents), + }, + .muxdiv_offset = 0x1B4, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 7, + + /* CRU_CLKGATE_CON4 */ + .gate_offset = 0x210, + .gate_shift = 9, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + static struct rk_clk rk3328_clks[] = { { .type = RK3328_CLK_PLL, @@ -1075,6 +1161,19 @@ static struct rk_clk rk3328_clks[] = { { .type = RK_CLK_COMPOSITE, .clk.composite = &i2c3 + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &ref_usb3otg + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &ref_usb3otg_src + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &usb3otg_suspend }, }; From owner-svn-src-all@freebsd.org Wed Jan 29 09:20:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69C611D05F5 for ; Wed, 29 Jan 2020 09:20:31 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) Received: from mm9.iaires.com (mm9.iaires.com [202.162.243.57]) by mx1.freebsd.org (Postfix) with ESMTP id 486ydB4vNFz4LSq for ; Wed, 29 Jan 2020 09:20:30 +0000 (UTC) (envelope-from campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com) To: svn-src-all@freebsd.org From: Kiran - trade data Reply-To: marketing@indiatradedata.com Subject: Worldwide Trade Database Message-ID: <20084336681632121@indiatradedata.com> Feedback-ID: 331:14483:20200129144954:nczc MIME-Version: 1.0 Date: Wed, 29 Jan 2020 14:50:30 +0530 X-Rspamd-Queue-Id: 486ydB4vNFz4LSq X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com designates 202.162.243.57 as permitted sender) smtp.mailfrom=campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com X-Spamd-Result: default: False [3.76 / 15.00]; HAS_REPLYTO(0.00)[marketing@indiatradedata.com]; R_SPF_ALLOW(-0.20)[+ip4:202.162.224.0/19:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; FORGED_SENDER(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; RCVD_COUNT_ZERO(0.00)[0]; IP_SCORE(0.31)[asn: 33480(1.61), country: US(-0.05)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:33480, ipnet:202.162.243.0/24, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[marketing@indiatradedata.com,campaign-indiatradedata-14483-331-1632121-svn-src-all=freebsd.org@email.indiatradedata.com]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_BAD_CTE_7BIT(1.05)[7bit,utf8]; HAS_PHPMAILER_SIG(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; FORGED_SENDER_VERP_SRS(0.00)[]; NEURAL_SPAM_MEDIUM(0.73)[0.731,0]; DMARC_NA(0.00)[indiatradedata.com]; NEURAL_SPAM_LONG(0.98)[0.975,0]; ENVFROM_VERP(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 09:20:31 -0000 Dear Sir/Ma’am, Hope you are doing well. We are an ISO certified Market research Company and helping those people who are seeking trade information for Export Import business around the globe. We provide authentic global export import data and trade intelligence reports. Our database is 100 % authentic and accurate as it is directly collected from the Custom source, Port Authorities, Shipping and Logistic Companies, Trade Associations and Government Bodies. With the help of our data, you can easily reach to the competitor's shipments, check current price of your commodities, understand demand and supply gap, find new and potential buyers, increase your Export sales revenue etc. I would like to inform you that currently below countries’ data is available with importer/exporter details – Asian countries - India, Pakistan, China, Sri Lanka, Indonesia, Philippines, Vietnam, Mongolia African countries - Ethiopia, Uganda, Tanzania, Kenya, Malawi, Burundi, DRC Congo, Zambia, Rwanda, Ghana Import, Botswana, Liberia European countries - Russia, Ukraine CIS Countries - Kazakhstan, Uzbekistan Latin and north American countries - Mexico, Brazil, United states, Argentina, Costa-Rica, Columbia, Chile, Ecuador, Panama, Paraguay, Peru, Uruguay, Venezuela Please note, Vietnam report is also available with the contact details. As per your requirements, We can send you the sample report of your products. If you are not the concerned person please forward this mail to the concerned person in your team. I'm sure it will be very helpful for them for their R&D. If you have any query feel free to contact on the below contact numbers. Thanks & Regards KIRAN BUSINESS DEVELOPMENT OFFICER 2nd Floor, C-7/224-225 Sector-7, Rohini, New Delhi India -110085 Mob. +91-7428509626 Ph. +91-11-47048013, Extn 112 Skype:kiran@exportgenius.in From owner-svn-src-all@freebsd.org Wed Jan 29 09:33:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F15861D115A; Wed, 29 Jan 2020 09:33:40 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486ywN65shz4Mcd; Wed, 29 Jan 2020 09:33:40 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B294F9FFB; Wed, 29 Jan 2020 09:33:40 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T9XeZj065962; Wed, 29 Jan 2020 09:33:40 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T9Xerx065961; Wed, 29 Jan 2020 09:33:40 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202001290933.00T9Xerx065961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 29 Jan 2020 09:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357251 - stable/12/sys/x86/xen X-SVN-Group: stable-12 X-SVN-Commit-Author: royger X-SVN-Commit-Paths: stable/12/sys/x86/xen X-SVN-Commit-Revision: 357251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 09:33:41 -0000 Author: royger Date: Wed Jan 29 09:33:40 2020 New Revision: 357251 URL: https://svnweb.freebsd.org/changeset/base/357251 Log: MFC r354637: xen: fix dispatching of NMIs Modified: stable/12/sys/x86/xen/xen_apic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/xen/xen_apic.c ============================================================================== --- stable/12/sys/x86/xen/xen_apic.c Wed Jan 29 08:46:35 2020 (r357250) +++ stable/12/sys/x86/xen/xen_apic.c Wed Jan 29 09:33:40 2020 (r357251) @@ -72,7 +72,6 @@ static driver_filter_t xen_invlcache; static driver_filter_t xen_ipi_bitmap_handler; static driver_filter_t xen_cpustop_handler; static driver_filter_t xen_cpususpend_handler; -static driver_filter_t xen_cpustophard_handler; #endif /*---------------------------------- Macros ----------------------------------*/ @@ -96,7 +95,6 @@ static struct xen_ipi_handler xen_ipis[] = [IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler, "b" }, [IPI_TO_IDX(IPI_STOP)] = { xen_cpustop_handler, "st" }, [IPI_TO_IDX(IPI_SUSPEND)] = { xen_cpususpend_handler, "sp" }, - [IPI_TO_IDX(IPI_STOP_HARD)] = { xen_cpustophard_handler, "sth" }, }; #endif @@ -259,12 +257,52 @@ xen_pv_lapic_ipi_raw(register_t icrlo, u_int dest) XEN_APIC_UNSUPPORTED; } +#define PCPU_ID_GET(id, field) (pcpu_find(id)->pc_##field) static void +send_nmi(int dest) +{ + unsigned int cpu; + + /* + * NMIs are not routed over event channels, and instead delivered as on + * native using the exception vector (#2). Triggering them can be done + * using the local APIC, or an hypercall as a shortcut like it's done + * below. + */ + switch(dest) { + case APIC_IPI_DEST_SELF: + HYPERVISOR_vcpu_op(VCPUOP_send_nmi, PCPU_GET(vcpu_id), NULL); + break; + case APIC_IPI_DEST_ALL: + CPU_FOREACH(cpu) + HYPERVISOR_vcpu_op(VCPUOP_send_nmi, + PCPU_ID_GET(cpu, vcpu_id), NULL); + break; + case APIC_IPI_DEST_OTHERS: + CPU_FOREACH(cpu) + if (cpu != PCPU_GET(cpuid)) + HYPERVISOR_vcpu_op(VCPUOP_send_nmi, + PCPU_ID_GET(cpu, vcpu_id), NULL); + break; + default: + HYPERVISOR_vcpu_op(VCPUOP_send_nmi, + PCPU_ID_GET(apic_cpuid(dest), vcpu_id), NULL); + break; + } +} +#undef PCPU_ID_GET + +static void xen_pv_lapic_ipi_vectored(u_int vector, int dest) { xen_intr_handle_t *ipi_handle; int ipi_idx, to_cpu, self; + if (vector >= IPI_NMI_FIRST) { + send_nmi(dest); + return; + } + ipi_idx = IPI_TO_IDX(vector); if (ipi_idx >= nitems(xen_ipis)) panic("IPI out of range"); @@ -519,14 +557,6 @@ xen_cpususpend_handler(void *arg) { cpususpend_handler(); - return (FILTER_HANDLED); -} - -static int -xen_cpustophard_handler(void *arg) -{ - - ipi_nmi_handler(); return (FILTER_HANDLED); } From owner-svn-src-all@freebsd.org Wed Jan 29 09:36:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E03071D128E; Wed, 29 Jan 2020 09:36:59 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486z0C5Zbcz4MmP; Wed, 29 Jan 2020 09:36:59 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B66679FFD; Wed, 29 Jan 2020 09:36:59 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00T9axMA066159; Wed, 29 Jan 2020 09:36:59 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00T9axp3066158; Wed, 29 Jan 2020 09:36:59 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <202001290936.00T9axp3066158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 29 Jan 2020 09:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357252 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 357252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 09:36:59 -0000 Author: ganbold Date: Wed Jan 29 09:36:59 2020 New Revision: 357252 URL: https://svnweb.freebsd.org/changeset/base/357252 Log: Enable USB3 support for Rockchip RK3328 SoC. Reviewed by: manu Modified: head/sys/arm64/rockchip/rk_dwc3.c Modified: head/sys/arm64/rockchip/rk_dwc3.c ============================================================================== --- head/sys/arm64/rockchip/rk_dwc3.c Wed Jan 29 09:33:40 2020 (r357251) +++ head/sys/arm64/rockchip/rk_dwc3.c Wed Jan 29 09:36:59 2020 (r357252) @@ -54,8 +54,14 @@ __FBSDID("$FreeBSD$"); #include #include +enum rk_dwc3_type { + RK3328 = 1, + RK3399, +}; + static struct ofw_compat_data compat_data[] = { - { "rockchip,rk3399-dwc3", 1 }, + { "rockchip,rk3328-dwc3", RK3328 }, + { "rockchip,rk3399-dwc3", RK3399 }, { NULL, 0 } }; @@ -69,6 +75,7 @@ struct rk_dwc3_softc { clk_t clk_usb3; clk_t clk_grf; hwreset_t rst_usb3; + enum rk_dwc3_type type; }; static int @@ -102,6 +109,7 @@ rk_dwc3_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; node = ofw_bus_get_node(dev); + sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; /* Mandatory clocks */ if (clk_get_by_ofw_name(dev, 0, "ref_clk", &sc->clk_ref) != 0) { @@ -134,17 +142,18 @@ rk_dwc3_attach(device_t dev) clk_get_name(sc->clk_bus)); return (ENXIO); } - if (clk_get_by_ofw_name(dev, 0, "grf_clk", &sc->clk_grf) != 0) { - device_printf(dev, "Cannot get grf_clk clock\n"); - return (ENXIO); + if (sc->type == RK3399) { + if (clk_get_by_ofw_name(dev, 0, "grf_clk", &sc->clk_grf) != 0) { + device_printf(dev, "Cannot get grf_clk clock\n"); + return (ENXIO); + } + err = clk_enable(sc->clk_grf); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(sc->clk_grf)); + return (ENXIO); + } } - err = clk_enable(sc->clk_grf); - if (err != 0) { - device_printf(dev, "Could not enable clock %s\n", - clk_get_name(sc->clk_grf)); - return (ENXIO); - } - /* Optional clocks */ if (clk_get_by_ofw_name(dev, 0, "aclk_usb3_rksoc_axi_perf", &sc->clk_axi_perf) == 0) { err = clk_enable(sc->clk_axi_perf); From owner-svn-src-all@freebsd.org Wed Jan 29 12:02:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9CEB1D6514; Wed, 29 Jan 2020 12:02:47 +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 4872DR5SxGz4WLP; Wed, 29 Jan 2020 12:02:47 +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 B66A3BD27; Wed, 29 Jan 2020 12:02:47 +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 00TC2lVb055212; Wed, 29 Jan 2020 12:02:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TC2lIa055211; Wed, 29 Jan 2020 12:02:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001291202.00TC2lIa055211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 Jan 2020 12:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357253 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 12:02:47 -0000 Author: kib Date: Wed Jan 29 12:02:47 2020 New Revision: 357253 URL: https://svnweb.freebsd.org/changeset/base/357253 Log: Restore OOM logic on page fault after r357026. Right now OOM is initiated unconditionally on the page allocation failure, after the wait. Reported by: Mark Millard Reviewed by: cy, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23409 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Jan 29 09:36:59 2020 (r357252) +++ head/sys/vm/vm_fault.c Wed Jan 29 12:02:47 2020 (r357253) @@ -1073,12 +1073,14 @@ vm_fault_allocate(struct faultstate *fs) fs->oom < vm_pfault_oom_attempts) { fs->oom++; vm_waitpfault(dset, vm_pfault_oom_wait * hz); + } else { + if (bootverbose) + printf( + "proc %d (%s) failed to alloc page on fault, starting OOM\n", + curproc->p_pid, curproc->p_comm); + vm_pageout_oom(VM_OOM_MEM_PF); + fs->oom = 0; } - if (bootverbose) - printf( -"proc %d (%s) failed to alloc page on fault, starting OOM\n", - curproc->p_pid, curproc->p_comm); - vm_pageout_oom(VM_OOM_MEM_PF); return (KERN_RESOURCE_SHORTAGE); } fs->oom = 0; From owner-svn-src-all@freebsd.org Wed Jan 29 12:10:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10C6B1D692A; Wed, 29 Jan 2020 12:10:43 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4872PZ6lMDz4Wnw; Wed, 29 Jan 2020 12:10:42 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD64DBD49; Wed, 29 Jan 2020 12:10:42 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TCAg8D056588; Wed, 29 Jan 2020 12:10:42 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TCAgk4056587; Wed, 29 Jan 2020 12:10:42 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <202001291210.00TCAgk4056587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 29 Jan 2020 12:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357254 - in head/sys: dts/arm64/overlays modules/dtb/rockchip X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: in head/sys: dts/arm64/overlays modules/dtb/rockchip X-SVN-Commit-Revision: 357254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 12:10:43 -0000 Author: ganbold Date: Wed Jan 29 12:10:42 2020 New Revision: 357254 URL: https://svnweb.freebsd.org/changeset/base/357254 Log: Add an overlay for RK3328 USB3 node. It doesn't exist in mainline dts due to the issues related with detaching and reattaching USB3 devices as mentioned in https://patchwork.kernel.org/patch/10853381/ In case of FreeBSD, as a temporary workaround "usbconfig reset" command can fix the problem. Reviewed by: manu Added: head/sys/dts/arm64/overlays/rk3328-dwc3.dtso (contents, props changed) Modified: head/sys/modules/dtb/rockchip/Makefile Added: head/sys/dts/arm64/overlays/rk3328-dwc3.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/rk3328-dwc3.dtso Wed Jan 29 12:10:42 2020 (r357254) @@ -0,0 +1,39 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include + +/ { + compatible = "rockchip,rk3328"; +}; + +&{/} { + usbdrd3: usb@ff600000 { + compatible = "rockchip,rk3328-dwc3"; + clocks = <&cru SCLK_USB3OTG_REF>, <&cru SCLK_USB3OTG_SUSPEND>, + <&cru ACLK_USB3OTG>; + clock-names = "ref_clk", "suspend_clk", + "bus_clk"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "okay"; + + usbdrd_dwc3: dwc3@ff600000 { + compatible = "snps,dwc3"; + reg = <0x0 0xff600000 0x0 0x100000>; + interrupts = ; + dr_mode = "host"; + phy_type = "utmi_wide"; + snps,dis_enblslpm_quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + status = "okay"; + }; + }; +}; Modified: head/sys/modules/dtb/rockchip/Makefile ============================================================================== --- head/sys/modules/dtb/rockchip/Makefile Wed Jan 29 12:02:47 2020 (r357253) +++ head/sys/modules/dtb/rockchip/Makefile Wed Jan 29 12:10:42 2020 (r357254) @@ -7,4 +7,6 @@ DTS= \ rockchip/rk3328-rock64.dts \ rockchip/rk3399-rockpro64.dts +DTSO= rk3328-dwc3.dtso + .include From owner-svn-src-all@freebsd.org Wed Jan 29 15:50:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21F0E1F4103; Wed, 29 Jan 2020 15:50:49 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4877HX6mNjz3FxS; Wed, 29 Jan 2020 15:50:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2A41E6D3; Wed, 29 Jan 2020 15:50:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TFomX4087893; Wed, 29 Jan 2020 15:50:48 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TFomHu087892; Wed, 29 Jan 2020 15:50:48 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202001291550.00TFomHu087892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 29 Jan 2020 15:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357255 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 357255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 15:50:49 -0000 Author: mhorne Date: Wed Jan 29 15:50:48 2020 New Revision: 357255 URL: https://svnweb.freebsd.org/changeset/base/357255 Log: Fix definition of SSTATUS_SD The SD bit is defined as the MSB of the sstatus register, meaning its position will vary depending on the CSR's length. Previously, there were two (unused) defines for this, for the 32 and 64-bit cases, but their definitions were swapped. Consolidate these into one define: SSTATUS_SD, and make the definition dependent on the value of __riscv_xlen. Reviewed by: br MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23402 Modified: head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Wed Jan 29 12:10:42 2020 (r357254) +++ head/sys/riscv/include/riscvreg.h Wed Jan 29 15:50:48 2020 (r357255) @@ -72,8 +72,11 @@ #define SSTATUS_XS_SHIFT 15 #define SSTATUS_XS_MASK (0x3 << SSTATUS_XS_SHIFT) #define SSTATUS_SUM (1 << 18) -#define SSTATUS32_SD (1 << 63) -#define SSTATUS64_SD (1 << 31) +#if __riscv_xlen == 64 +#define SSTATUS_SD (1 << 63) +#else +#define SSTATUS_SD (1 << 31) +#endif #define MSTATUS_UIE (1 << 0) #define MSTATUS_SIE (1 << 1) From owner-svn-src-all@freebsd.org Wed Jan 29 15:58:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AF671F49D8; Wed, 29 Jan 2020 15:58:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4877SD2kWdz3Gj6; Wed, 29 Jan 2020 15:58:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58C1CE7B3; Wed, 29 Jan 2020 15:58:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TFwK5G093586; Wed, 29 Jan 2020 15:58:20 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TFwKJG093585; Wed, 29 Jan 2020 15:58:20 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202001291558.00TFwKJG093585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 29 Jan 2020 15:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357256 - head/sys/dev/cadence X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/dev/cadence X-SVN-Commit-Revision: 357256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 15:58:20 -0000 Author: mhorne Date: Wed Jan 29 15:58:19 2020 New Revision: 357256 URL: https://svnweb.freebsd.org/changeset/base/357256 Log: cgem: Add another compat string for the SiFive fu540 Newer device trees use "sifive,fu540-c000-gem" instead of "cdns,macb". Reviewed by: br, kp Differential Revision: https://reviews.freebsd.org/D23407 Modified: head/sys/dev/cadence/if_cgem.c Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Wed Jan 29 15:50:48 2020 (r357255) +++ head/sys/dev/cadence/if_cgem.c Wed Jan 29 15:58:19 2020 (r357256) @@ -99,9 +99,10 @@ __FBSDID("$FreeBSD$"); CSUM_TCP_IPV6 | CSUM_UDP_IPV6) static struct ofw_compat_data compat_data[] = { - { "cadence,gem", 1 }, - { "cdns,macb", 1 }, - { NULL, 0 }, + { "cadence,gem", 1 }, + { "cdns,macb", 1 }, + { "sifive,fu540-c000-gem", 1 }, + { NULL, 0 }, }; struct cgem_softc { From owner-svn-src-all@freebsd.org Wed Jan 29 16:24:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B6DC1F54EB; Wed, 29 Jan 2020 16:24:17 +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 4878286rTmz3J3g; Wed, 29 Jan 2020 16:24:16 +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 E5E42ED56; Wed, 29 Jan 2020 16:24:16 +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 00TGOGJD011530; Wed, 29 Jan 2020 16:24:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TGOGcK011529; Wed, 29 Jan 2020 16:24:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001291624.00TGOGcK011529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 16:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357257 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 357257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 16:24:17 -0000 Author: kevans Date: Wed Jan 29 16:24:16 2020 New Revision: 357257 URL: https://svnweb.freebsd.org/changeset/base/357257 Log: pkgbase: kill off clibs.ucl and docs.ucl These are just direct copies of the template. If they don't exist but are attempted to be used, generate-ucl.sh will simply fallback to the template anyways. Let it do so to reduce potential maintenance burden. Deleted: head/release/packages/clibs.ucl head/release/packages/docs.ucl From owner-svn-src-all@freebsd.org Wed Jan 29 16:47:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3B071F5D24; Wed, 29 Jan 2020 16:47:28 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 4878Xw4G3Qz3K9c; Wed, 29 Jan 2020 16:47:28 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f181.google.com with SMTP id k15so135138ybd.10; Wed, 29 Jan 2020 08:47:28 -0800 (PST) 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=vCZS5nSzgkkcF5JUz9cRu5tvGxHd+K6dF0UB92kVrpE=; b=evYWm7kc1lkHsYGaODn8TJKpjuygemwhtkS56CZFYsz38z8/ezbbdQsGMgt8ZsbLYX ZsOu8oUCyo3e9jaqC1O/SbMX+JnFuGk29BZCm8w2bGF80kXz3iJVc2xwFLX+yT23yCVl zC2BjpftkxPMwiGzxFAXP3iPkoWj3bak5QDei3Ztzbt9ToZ1yLPB6I5R17UwQ766Z0Gu ZBisUZCetoAPPO2VL1B4jvqyBs8UEzo8dCTrBincyYQlmNbHxJhRqulwTM1RvbQaDHjR V3zVgu8fM5DnaDeGvX1jf6Lp8dbTh4SzOoyvv/JLEjaGJJc+0w7ieLrg0REAHZMRMbMl xWYw== X-Gm-Message-State: APjAAAUUeGBSW0HID9PitTaW8ilfOe5HZHIIvq3L3KDGMwhqg/gJctkR gJ2p90xRIOnqItx2l+H1iVfFTmhAeZa84yTYM4I9iRlA X-Google-Smtp-Source: APXvYqwj4Pas7LHL33iPydxZeet0crYpydVZviMt7U5pKqMnNPqafsLRID9BTPhhUccFZmkoPwlD6FxEgTMcF0/1Vlc= X-Received: by 2002:a05:6902:4c8:: with SMTP id v8mr265912ybs.451.1580316447049; Wed, 29 Jan 2020 08:47:27 -0800 (PST) MIME-Version: 1.0 References: <202001290525.00T5PKKh017113@repo.freebsd.org> In-Reply-To: <202001290525.00T5PKKh017113@repo.freebsd.org> From: Li-Wen Hsu Date: Thu, 30 Jan 2020 00:09:51 +0800 Message-ID: Subject: Re: svn commit: r357246 - head/tests/sys/sys To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4878Xw4G3Qz3K9c X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 16:47:28 -0000 On Wed, Jan 29, 2020 at 1:25 PM Conrad Meyer wrote: > > Author: cem > Date: Wed Jan 29 05:25:20 2020 > New Revision: 357246 > URL: https://svnweb.freebsd.org/changeset/base/357246 > > Log: > qmath(3) test: Replace overcomplicated abomination with arc4random(3) > > The horrific GENRAND construction bent over backwards to construct 64-bit > signed integers from the 31-bit output of random(3) for about 20 numbers per > test. Reproducibility wasn't a goal: random(3) was seeded with > srandomdev(3). Speed is not a factor for generating 20 integers with > arc4random(3). Range is not a factor: all uses did not bound the range > beyond that of the full [INT64_MIN, INT64_MAX]. Just use arc4random(3). > > Reported by: Coverity > CIDs: 1404809, 1404817, 1404838, 1404840 and about 6x other > identical reports of dubious code relating to the > construction > > Modified: > head/tests/sys/sys/qmath_test.c These two test cases are starting failing since this commit: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14110/testReport/sys.sys/qmath_test/qsubi_s64q/ https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14110/testReport/sys.sys/qmath_test/qsubq_s64q/ Can you help check them? Thanks! Li-Wen From owner-svn-src-all@freebsd.org Wed Jan 29 16:52:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 778BA1F60BF; Wed, 29 Jan 2020 16:52:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4878fP3LWJz3KXb; Wed, 29 Jan 2020 16:52:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DE7BF300; Wed, 29 Jan 2020 16:52:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TGqDPe028727; Wed, 29 Jan 2020 16:52:13 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TGqDa0028724; Wed, 29 Jan 2020 16:52:13 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001291652.00TGqDa0028724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 Jan 2020 16:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357258 - in head/sys: conf dev/xilinx X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/xilinx X-SVN-Commit-Revision: 357258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 16:52:13 -0000 Author: br Date: Wed Jan 29 16:52:12 2020 New Revision: 357258 URL: https://svnweb.freebsd.org/changeset/base/357258 Log: Add driver for Xilinx XDMA PCIe Bridge found in the U.S. Government Furnished Equipment (GFE) riscv cores. GFE cores are synthesized on the Xilinx Virtex UltraScale+ FPGA VCU118 Evaluation Kit. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D23337 Added: head/sys/dev/xilinx/xlnx_pcib.c (contents, props changed) head/sys/dev/xilinx/xlnx_pcib.h (contents, props changed) Modified: head/sys/conf/files.riscv Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed Jan 29 16:24:16 2020 (r357257) +++ head/sys/conf/files.riscv Wed Jan 29 16:52:12 2020 (r357258) @@ -14,6 +14,7 @@ dev/uart/uart_dev_lowrisc.c optional uart_lowrisc dev/xilinx/axi_quad_spi.c optional xilinx_spi dev/xilinx/axidma.c optional axidma xdma dev/xilinx/if_xae.c optional xae +dev/xilinx/xlnx_pcib.c optional pci fdt xlnx_pcib kern/kern_clocksource.c standard kern/msi_if.m standard kern/pic_if.m standard Added: head/sys/dev/xilinx/xlnx_pcib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/xlnx_pcib.c Wed Jan 29 16:52:12 2020 (r357258) @@ -0,0 +1,794 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "xlnx_pcib.h" + +#include "ofw_bus_if.h" +#include "msi_if.h" +#include "pcib_if.h" +#include "pic_if.h" + +#define XLNX_PCIB_MAX_MSI 64 + +static int xlnx_pcib_fdt_attach(device_t); +static int xlnx_pcib_fdt_probe(device_t); +static int xlnx_pcib_fdt_get_id(device_t, device_t, enum pci_id_type, + uintptr_t *); +static void xlnx_pcib_msi_mask(device_t dev, struct intr_irqsrc *isrc, + bool mask); + +struct xlnx_pcib_softc { + struct generic_pcie_fdt_softc fdt_sc; + struct resource *res[4]; + struct mtx mtx; + vm_offset_t msi_page; + struct xlnx_pcib_irqsrc *isrcs; + device_t dev; + void *intr_cookie[3]; +}; + +static struct resource_spec xlnx_pcib_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { -1, 0 } +}; + +struct xlnx_pcib_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +#define XLNX_IRQ_FLAG_USED (1 << 0) + u_int flags; +}; + +static void +xlnx_pcib_clear_err_interrupts(struct generic_pcie_core_softc *sc) +{ + uint32_t reg; + + reg = bus_read_4(sc->res, XLNX_PCIE_RPERRFRR); + + if (reg & RPERRFRR_VALID) { + device_printf(sc->dev, "Requested ID: %x\n", + reg & RPERRFRR_REQ_ID_M); + bus_write_4(sc->res, XLNX_PCIE_RPERRFRR, ~0U); + } +} + +static int +xlnx_pcib_intr(void *arg) +{ + struct generic_pcie_fdt_softc *fdt_sc; + struct generic_pcie_core_softc *sc; + struct xlnx_pcib_softc *xlnx_sc; + uint32_t val, mask, status; + + xlnx_sc = arg; + fdt_sc = &xlnx_sc->fdt_sc; + sc = &fdt_sc->base; + + val = bus_read_4(sc->res, XLNX_PCIE_IDR); + mask = bus_read_4(sc->res, XLNX_PCIE_IMR); + + status = val & mask; + if (!status) + return (FILTER_HANDLED); + + if (status & IMR_LINK_DOWN) + device_printf(sc->dev, "Link down"); + + if (status & IMR_HOT_RESET) + device_printf(sc->dev, "Hot reset"); + + if (status & IMR_CORRECTABLE) + xlnx_pcib_clear_err_interrupts(sc); + + if (status & IMR_FATAL) + xlnx_pcib_clear_err_interrupts(sc); + + if (status & IMR_NON_FATAL) + xlnx_pcib_clear_err_interrupts(sc); + + if (status & IMR_MSI) { + device_printf(sc->dev, "MSI interrupt"); + + /* FIFO mode MSI not implemented. */ + } + + if (status & IMR_INTX) { + device_printf(sc->dev, "INTx received"); + + /* Not implemented. */ + } + + if (status & IMR_SLAVE_UNSUPP_REQ) + device_printf(sc->dev, "Slave unsupported request"); + + if (status & IMR_SLAVE_UNEXP_COMPL) + device_printf(sc->dev, "Slave unexpected completion"); + + if (status & IMR_SLAVE_COMPL_TIMOUT) + device_printf(sc->dev, "Slave completion timeout"); + + if (status & IMR_SLAVE_ERROR_POISON) + device_printf(sc->dev, "Slave error poison"); + + if (status & IMR_SLAVE_COMPL_ABORT) + device_printf(sc->dev, "Slave completion abort"); + + if (status & IMR_SLAVE_ILLEG_BURST) + device_printf(sc->dev, "Slave illegal burst"); + + if (status & IMR_MASTER_DECERR) + device_printf(sc->dev, "Master decode error"); + + if (status & IMR_MASTER_SLVERR) + device_printf(sc->dev, "Master slave error"); + + bus_write_4(sc->res, XLNX_PCIE_IDR, val); + + return (FILTER_HANDLED); +} + +static void +xlnx_pcib_handle_msi_intr(void *arg, int msireg) +{ + struct generic_pcie_fdt_softc *fdt_sc; + struct generic_pcie_core_softc *sc; + struct xlnx_pcib_softc *xlnx_sc; + struct xlnx_pcib_irqsrc *xi; + struct trapframe *tf; + int irq; + int reg; + int i; + + xlnx_sc = arg; + fdt_sc = &xlnx_sc->fdt_sc; + sc = &fdt_sc->base; + tf = curthread->td_intr_frame; + + do { + reg = bus_read_4(sc->res, msireg); + + for (i = 0; i < sizeof(uint32_t) * 8; i++) { + if (reg & (1 << i)) { + bus_write_4(sc->res, msireg, (1 << i)); + + irq = i; + if (msireg == XLNX_PCIE_RPMSIID2) + irq += 32; + + xi = &xlnx_sc->isrcs[irq]; + if (intr_isrc_dispatch(&xi->isrc, tf) != 0) { + /* Disable stray. */ + xlnx_pcib_msi_mask(sc->dev, + &xi->isrc, 1); + device_printf(sc->dev, + "Stray irq %u disabled\n", irq); + } + } + } + } while (reg != 0); +} + +static int +xlnx_pcib_msi0_intr(void *arg) +{ + + xlnx_pcib_handle_msi_intr(arg, XLNX_PCIE_RPMSIID1); + + return (FILTER_HANDLED); +} + +static int +xlnx_pcib_msi1_intr(void *arg) +{ + + xlnx_pcib_handle_msi_intr(arg, XLNX_PCIE_RPMSIID2); + + return (FILTER_HANDLED); +} + +static int +xlnx_pcib_register_msi(struct xlnx_pcib_softc *sc) +{ + const char *name; + int error; + int irq; + + sc->isrcs = malloc(sizeof(*sc->isrcs) * XLNX_PCIB_MAX_MSI, M_DEVBUF, + M_WAITOK | M_ZERO); + + name = device_get_nameunit(sc->dev); + + for (irq = 0; irq < XLNX_PCIB_MAX_MSI; irq++) { + sc->isrcs[irq].irq = irq; + error = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->dev, 0, "%s,%u", name, irq); + if (error != 0) + return (error); /* XXX deregister ISRCs */ + } + + if (intr_msi_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev))) != 0) + return (ENXIO); + + return (0); +} + +static void +xlnx_pcib_init(struct xlnx_pcib_softc *sc) +{ + bus_addr_t addr; + int reg; + + /* Disable interrupts. */ + bus_write_4(sc->res[0], XLNX_PCIE_IMR, 0); + + /* Clear pending interrupts.*/ + reg = bus_read_4(sc->res[0], XLNX_PCIE_IDR); + bus_write_4(sc->res[0], XLNX_PCIE_IDR, reg); + + /* Setup an MSI page. */ + sc->msi_page = kmem_alloc_contig(PAGE_SIZE, M_WAITOK, 0, + BUS_SPACE_MAXADDR, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + addr = vtophys(sc->msi_page); + bus_write_4(sc->res[0], XLNX_PCIE_RPMSIBR1, (addr >> 32)); + bus_write_4(sc->res[0], XLNX_PCIE_RPMSIBR2, (addr >> 0)); + + /* Enable the bridge. */ + reg = bus_read_4(sc->res[0], XLNX_PCIE_RPSCR); + reg |= RPSCR_BE; + bus_write_4(sc->res[0], XLNX_PCIE_RPSCR, reg); + + /* Enable interrupts. */ + reg = IMR_LINK_DOWN + | IMR_HOT_RESET + | IMR_CFG_COMPL_STATUS_M + | IMR_CFG_TIMEOUT + | IMR_CORRECTABLE + | IMR_NON_FATAL + | IMR_FATAL + | IMR_INTX + | IMR_MSI + | IMR_SLAVE_UNSUPP_REQ + | IMR_SLAVE_UNEXP_COMPL + | IMR_SLAVE_COMPL_TIMOUT + | IMR_SLAVE_ERROR_POISON + | IMR_SLAVE_COMPL_ABORT + | IMR_SLAVE_ILLEG_BURST + | IMR_MASTER_DECERR + | IMR_MASTER_SLVERR; + bus_write_4(sc->res[0], XLNX_PCIE_IMR, reg); +} + +static int +xlnx_pcib_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "xlnx,xdma-host-3.00")) { + device_set_desc(dev, "Xilinx XDMA PCIe Controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +xlnx_pcib_fdt_attach(device_t dev) +{ + struct xlnx_pcib_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, "msi_mtx", NULL, MTX_DEF); + + if (bus_alloc_resources(dev, xlnx_pcib_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Setup MISC interrupt handler. */ + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + xlnx_pcib_intr, NULL, sc, &sc->intr_cookie[0]); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + + /* Setup MSI0 interrupt handler. */ + error = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, + xlnx_pcib_msi0_intr, NULL, sc, &sc->intr_cookie[1]); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + + /* Setup MSI1 interrupt handler. */ + error = bus_setup_intr(dev, sc->res[3], INTR_TYPE_MISC | INTR_MPSAFE, + xlnx_pcib_msi1_intr, NULL, sc, &sc->intr_cookie[2]); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + + xlnx_pcib_init(sc); + + /* + * Allow the core driver to map registers. + * We will be accessing the device memory using core_softc. + */ + bus_release_resources(dev, xlnx_pcib_spec, sc->res); + + error = xlnx_pcib_register_msi(sc); + if (error) + return (error); + + return (pci_host_generic_attach(dev)); +} + +static int +xlnx_pcib_fdt_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + phandle_t node; + int bsf; + + if (type != PCI_ID_MSI) + return (pcib_get_id(pci, child, type, id)); + + node = ofw_bus_get_node(pci); + if (OF_hasprop(node, "msi-map")) + return (generic_pcie_get_id(pci, child, type, id)); + + bsf = pci_get_rid(child); + *id = (pci_get_domain(child) << PCI_RID_DOMAIN_SHIFT) | bsf; + + return (0); +} + +static int +xlnx_pcib_req_valid(struct generic_pcie_core_softc *sc, + u_int bus, u_int slot, u_int func, u_int reg) +{ + bus_space_handle_t h; + bus_space_tag_t t; + uint32_t val; + + t = sc->bst; + h = sc->bsh; + + if ((bus < sc->bus_start) || (bus > sc->bus_end)) + return (0); + if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || + (reg > PCIE_REGMAX)) + return (0); + + if (bus == 0 && slot > 0) + return (0); + + val = bus_space_read_4(t, h, XLNX_PCIE_PHYSCR); + if ((val & PHYSCR_LINK_UP) == 0) { + /* Link is down */ + return (0); + } + + /* Valid */ + + return (1); +} + +static uint32_t +xlnx_pcib_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes) +{ + struct generic_pcie_fdt_softc *fdt_sc; + struct xlnx_pcib_softc *xlnx_sc; + struct generic_pcie_core_softc *sc; + bus_space_handle_t h; + bus_space_tag_t t; + uint64_t offset; + uint32_t data; + + xlnx_sc = device_get_softc(dev); + fdt_sc = &xlnx_sc->fdt_sc; + sc = &fdt_sc->base; + + if (!xlnx_pcib_req_valid(sc, bus, slot, func, reg)) + return (~0U); + + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); + t = sc->bst; + h = sc->bsh; + + data = bus_space_read_4(t, h, offset & ~3); + + switch (bytes) { + case 1: + data >>= (offset & 3) * 8; + data &= 0xff; + break; + case 2: + data >>= (offset & 3) * 8; + data = le16toh(data); + break; + case 4: + data = le32toh(data); + break; + default: + return (~0U); + } + + return (data); +} + +static void +xlnx_pcib_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t val, int bytes) +{ + struct generic_pcie_fdt_softc *fdt_sc; + struct xlnx_pcib_softc *xlnx_sc; + struct generic_pcie_core_softc *sc; + bus_space_handle_t h; + bus_space_tag_t t; + uint64_t offset; + uint32_t data; + + xlnx_sc = device_get_softc(dev); + fdt_sc = &xlnx_sc->fdt_sc; + sc = &fdt_sc->base; + + if (!xlnx_pcib_req_valid(sc, bus, slot, func, reg)) + return; + + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); + + t = sc->bst; + h = sc->bsh; + + /* + * 32-bit access used due to a bug in the Xilinx bridge that + * requires to write primary and secondary buses in one blast. + * + * TODO: This is probably wrong on big-endian. + */ + switch (bytes) { + case 1: + data = bus_space_read_4(t, h, offset & ~3); + data &= ~(0xff << ((offset & 3) * 8)); + data |= (val & 0xff) << ((offset & 3) * 8); + bus_space_write_4(t, h, offset & ~3, htole32(data)); + break; + case 2: + data = bus_space_read_4(t, h, offset & ~3); + data &= ~(0xffff << ((offset & 3) * 8)); + data |= (val & 0xffff) << ((offset & 3) * 8); + bus_space_write_4(t, h, offset & ~3, htole32(data)); + break; + case 4: + bus_space_write_4(t, h, offset, htole32(val)); + break; + default: + return; + } +} + +static int +xlnx_pcib_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, + irqs)); +} + +static int +xlnx_pcib_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); +} + +static int +xlnx_pcib_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); +} + +static int +xlnx_pcib_msi_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct xlnx_pcib_softc *sc; + int irq, end_irq, i; + bool found; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mtx); + + found = false; + + for (irq = 0; (irq + count - 1) < XLNX_PCIB_MAX_MSI; irq++) { + + /* Assume the range is valid. */ + found = true; + + /* Check this range is valid. */ + for (end_irq = irq; end_irq < irq + count; end_irq++) { + if (sc->isrcs[end_irq].flags & XLNX_IRQ_FLAG_USED) { + /* This is already used. */ + found = false; + break; + } + } + + if (found) + break; + } + + if (!found || irq == (XLNX_PCIB_MAX_MSI - 1)) { + /* Not enough interrupts were found. */ + mtx_unlock(&sc->mtx); + return (ENXIO); + } + + /* Mark the interrupt as used. */ + for (i = 0; i < count; i++) + sc->isrcs[irq + i].flags |= XLNX_IRQ_FLAG_USED; + + mtx_unlock(&sc->mtx); + + for (i = 0; i < count; i++) + srcs[i] = (struct intr_irqsrc *)&sc->isrcs[irq + i]; + + *pic = device_get_parent(dev); + + return (0); +} + +static int +xlnx_pcib_msi_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) +{ + struct xlnx_pcib_softc *sc; + struct xlnx_pcib_irqsrc *xi; + int i; + + sc = device_get_softc(dev); + mtx_lock(&sc->mtx); + for (i = 0; i < count; i++) { + xi = (struct xlnx_pcib_irqsrc *)isrc[i]; + + KASSERT(xi->flags & XLNX_IRQ_FLAG_USED, + ("%s: Releasing an unused MSI interrupt", __func__)); + + xi->flags &= ~XLNX_IRQ_FLAG_USED; + } + + mtx_unlock(&sc->mtx); + return (0); +} + +static int +xlnx_pcib_msi_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct xlnx_pcib_softc *sc; + struct xlnx_pcib_irqsrc *xi; + + sc = device_get_softc(dev); + xi = (struct xlnx_pcib_irqsrc *)isrc; + + *addr = vtophys(sc->msi_page); + *data = xi->irq; + + return (0); +} + +static void +xlnx_pcib_msi_mask(device_t dev, struct intr_irqsrc *isrc, bool mask) +{ + struct generic_pcie_fdt_softc *fdt_sc; + struct generic_pcie_core_softc *sc; + struct xlnx_pcib_softc *xlnx_sc; + struct xlnx_pcib_irqsrc *xi; + uint32_t msireg, irq; + uint32_t reg; + + xlnx_sc = device_get_softc(dev); + fdt_sc = &xlnx_sc->fdt_sc; + sc = &fdt_sc->base; + + xi = (struct xlnx_pcib_irqsrc *)isrc; + + irq = xi->irq; + if (irq < 32) + msireg = XLNX_PCIE_RPMSIID1_MASK; + else + msireg = XLNX_PCIE_RPMSIID2_MASK; + + reg = bus_read_4(sc->res, msireg); + if (mask) + reg &= ~(1 << irq); + else + reg |= (1 << irq); + bus_write_4(sc->res, msireg, reg); +} + +static void +xlnx_pcib_msi_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + + xlnx_pcib_msi_mask(dev, isrc, true); +} + +static void +xlnx_pcib_msi_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + + xlnx_pcib_msi_mask(dev, isrc, false); +} + +static void +xlnx_pcib_msi_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + +} + +static void +xlnx_pcib_msi_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + xlnx_pcib_msi_mask(dev, isrc, false); +} + +static void +xlnx_pcib_msi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + xlnx_pcib_msi_mask(dev, isrc, true); +} + +static int +xlnx_pcib_msi_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + + return (0); +} + +static int +xlnx_pcib_msi_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + + return (0); +} + +static device_method_t xlnx_pcib_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xlnx_pcib_fdt_probe), + DEVMETHOD(device_attach, xlnx_pcib_fdt_attach), + + /* pcib interface */ + DEVMETHOD(pcib_get_id, xlnx_pcib_fdt_get_id), + DEVMETHOD(pcib_read_config, xlnx_pcib_read_config), + DEVMETHOD(pcib_write_config, xlnx_pcib_write_config), + DEVMETHOD(pcib_alloc_msi, xlnx_pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, xlnx_pcib_release_msi), + DEVMETHOD(pcib_map_msi, xlnx_pcib_map_msi), + + /* MSI interface */ + DEVMETHOD(msi_alloc_msi, xlnx_pcib_msi_alloc_msi), + DEVMETHOD(msi_release_msi, xlnx_pcib_msi_release_msi), + DEVMETHOD(msi_map_msi, xlnx_pcib_msi_map_msi), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, xlnx_pcib_msi_disable_intr), + DEVMETHOD(pic_enable_intr, xlnx_pcib_msi_enable_intr), + DEVMETHOD(pic_setup_intr, xlnx_pcib_msi_setup_intr), + DEVMETHOD(pic_teardown_intr, xlnx_pcib_msi_teardown_intr), + DEVMETHOD(pic_post_filter, xlnx_pcib_msi_post_filter), + DEVMETHOD(pic_post_ithread, xlnx_pcib_msi_post_ithread), + DEVMETHOD(pic_pre_ithread, xlnx_pcib_msi_pre_ithread), + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pcib, xlnx_pcib_fdt_driver, xlnx_pcib_fdt_methods, + sizeof(struct xlnx_pcib_softc), generic_pcie_fdt_driver); + +static devclass_t xlnx_pcib_fdt_devclass; + +DRIVER_MODULE(xlnx_pcib, simplebus, xlnx_pcib_fdt_driver, + xlnx_pcib_fdt_devclass, 0, 0); +DRIVER_MODULE(xlnx_pcib, ofwbus, xlnx_pcib_fdt_driver, + xlnx_pcib_fdt_devclass, 0, 0); Added: head/sys/dev/xilinx/xlnx_pcib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/xlnx_pcib.h Wed Jan 29 16:52:12 2020 (r357258) @@ -0,0 +1,84 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * 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 _DEV_XILINX_XLNX_PCIB_H_ +#define _DEV_XILINX_XLNX_PCIB_H_ + +#define XLNX_PCIE_VSEC 0x12c +#define XLNX_PCIE_BIR 0x130 /* Bridge Info Register */ +#define XLNX_PCIE_BSCR 0x134 /* Bridge Status and Control */ +#define XLNX_PCIE_IDR 0x138 /* Interrupt Decode Register */ +#define XLNX_PCIE_IMR 0x13C /* Interrupt Mask Register */ +#define IMR_LINK_DOWN (1 << 0) +#define IMR_HOT_RESET (1 << 3) +#define IMR_CFG_COMPL_STATUS_S 5 +#define IMR_CFG_COMPL_STATUS_M (0x7 << IMR_CFG_COMPL_STATUS_S) +#define IMR_CFG_TIMEOUT (1 << 8) +#define IMR_CORRECTABLE (1 << 9) +#define IMR_NON_FATAL (1 << 10) +#define IMR_FATAL (1 << 11) +#define IMR_INTX (1 << 16) /* INTx Interrupt Received */ +#define IMR_MSI (1 << 17) /* MSI Interrupt Received */ +#define IMR_SLAVE_UNSUPP_REQ (1 << 20) +#define IMR_SLAVE_UNEXP_COMPL (1 << 21) +#define IMR_SLAVE_COMPL_TIMOUT (1 << 22) +#define IMR_SLAVE_ERROR_POISON (1 << 23) +#define IMR_SLAVE_COMPL_ABORT (1 << 24) +#define IMR_SLAVE_ILLEG_BURST (1 << 25) +#define IMR_MASTER_DECERR (1 << 26) +#define IMR_MASTER_SLVERR (1 << 27) +#define XLNX_PCIE_BLR 0x140 /* Bus Location Register */ +#define XLNX_PCIE_PHYSCR 0x144 /* PHY Status/Control Register */ +#define PHYSCR_LINK_UP (1 << 11) /* Current PHY Link-up state */ +#define XLNX_PCIE_RPSCR 0x148 /* Root Port Status/Control Register */ +#define RPSCR_BE (1 << 0) /* Bridge Enable */ +#define XLNX_PCIE_RPMSIBR1 0x14C /* Root Port MSI Base Register 1 */ +#define XLNX_PCIE_RPMSIBR2 0x150 /* Root Port MSI Base Register 2 */ +#define XLNX_PCIE_RPERRFRR 0x154 /* Root Port Error FIFO Read */ +#define RPERRFRR_VALID (1 << 18) /* Indicates whether read succeeded.*/ +#define RPERRFRR_REQ_ID_S 0 /* Requester of the error message. */ +#define RPERRFRR_REQ_ID_M (0xffff << RPERRFRR_REQ_ID_S) +#define XLNX_PCIE_RPIFRR1 0x158 /* Root Port Interrupt FIFO Read 1 */ +#define XLNX_PCIE_RPIFRR2 0x15C /* Root Port Interrupt FIFO Read 2 */ +#define XLNX_PCIE_RPID2 0x160 /* Root Port Interrupt Decode 2 */ +#define XLNX_PCIE_RPID2_MASK 0x164 /* Root Port Interrupt Decode 2 Mask */ +#define XLNX_PCIE_RPMSIID1 0x170 /* Root Port MSI Interrupt Decode 1 */ +#define XLNX_PCIE_RPMSIID2 0x174 /* Root Port MSI Interrupt Decode 2 */ +#define XLNX_PCIE_RPMSIID1_MASK 0x178 /* Root Port MSI Int. Decode 1 Mask */ +#define XLNX_PCIE_RPMSIID2_MASK 0x17C /* Root Port MSI Int. Decode 2 Mask */ +#define XLNX_PCIE_CCR 0x168 /* Configuration Control Register */ +#define XLNX_PCIE_VSEC_CR 0x200 /* VSEC Capability Register 2 */ +#define XLNX_PCIE_VSEC_HR 0x204 /* VSEC Header Register 2 */ + +#endif /* !_DEV_XILINX_XLNX_PCIB_H_ */ From owner-svn-src-all@freebsd.org Wed Jan 29 17:39:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0FE41F75AF; Wed, 29 Jan 2020 17:39:39 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4879j75kLZz3Mwy; Wed, 29 Jan 2020 17:39:39 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFCFEFAF1; Wed, 29 Jan 2020 17:39:39 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00THddmT053881; Wed, 29 Jan 2020 17:39:39 GMT (envelope-from alfredo@FreeBSD.org) Received: (from alfredo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00THddtg053879; Wed, 29 Jan 2020 17:39:39 GMT (envelope-from alfredo@FreeBSD.org) Message-Id: <202001291739.00THddtg053879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alfredo set sender to alfredo@FreeBSD.org using -f From: "Alfredo Dal'Ava Junior" Date: Wed, 29 Jan 2020 17:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357261 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: alfredo X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 357261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 17:39:39 -0000 Author: alfredo Date: Wed Jan 29 17:39:38 2020 New Revision: 357261 URL: https://svnweb.freebsd.org/changeset/base/357261 Log: Add myself (alfredo) to committers-src.dot and calendar.freebsd Approved by: jhibbits (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jan 29 17:01:02 2020 (r357260) +++ head/share/misc/committers-src.dot Wed Jan 29 17:39:38 2020 (r357261) @@ -105,6 +105,7 @@ adrian [label="Adrian Chadd\nadrian@FreeBSD.org\n2000/ ae [label="Andrey V. Elsukov\nae@FreeBSD.org\n2010/06/03"] akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"] alc [label="Alan Cox\nalc@FreeBSD.org\n1999/02/23"] +alfredo [label="Alfredo Dal'Ava Junior\nalfredo@FreeBSD.org\n2020/01/27"] allanjude [label="Allan Jude\nallanjude@FreeBSD.org\n2015/07/30"] ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"] anchie [label="Ana Kukec\nanchie@FreeBSD.org\n2010/04/14"] @@ -613,6 +614,7 @@ jhb -> rpokala jhb -> arichardson jhb -> scottph +jhibbits -> alfredo jhibbits -> bdragon jhibbits -> leitao jhibbits -> luporl Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Jan 29 17:01:02 2020 (r357260) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Jan 29 17:39:38 2020 (r357261) @@ -324,6 +324,7 @@ 08/19 Chin-San Huang born in Yi-Lan, Taiwan, Republic of China, 1979 08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/20 Michael Heffner born in Cleona, Pennsylvania, United States, 1981 +08/21 Alfredo Dal'Ava Junior born in Pocos de Caldas, Minas Gerais, Brazil, 1981 08/21 Jason A. Harmening born in Fort Wayne, Indiana, United States, 1981 08/22 Ilya Bakulin born in Tbilisi, USSR, 1986 08/24 Mark Linimon born in Houston, Texas, United States, 1955 From owner-svn-src-all@freebsd.org Wed Jan 29 18:13:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 061D81F85D2; Wed, 29 Jan 2020 18:13:45 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487BSS6PcRz3Pt6; Wed, 29 Jan 2020 18:13:44 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6B7D182BD; Wed, 29 Jan 2020 18:13:44 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TIDi9c077390; Wed, 29 Jan 2020 18:13:44 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TIDigl077389; Wed, 29 Jan 2020 18:13:44 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202001291813.00TIDigl077389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 29 Jan 2020 18:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357262 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 357262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:13:45 -0000 Author: luporl Date: Wed Jan 29 18:13:44 2020 New Revision: 357262 URL: https://svnweb.freebsd.org/changeset/base/357262 Log: [PPC64] Fix NUMA on POWER8 On some POWER8 machines, 'ibm,associativity' property may have 6 cells, which would overflow the 5 cells buffer being used. There was also an issue with the "check if node is root" part, that have been fixed too. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D23414 Modified: head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Wed Jan 29 17:39:38 2020 (r357261) +++ head/sys/powerpc/powernv/platform_powernv.c Wed Jan 29 18:13:44 2020 (r357262) @@ -517,17 +517,20 @@ powernv_node_numa_domain(platform_t platform, phandle_ cell_t associativity[5]; int i, res; - res = OF_getproplen(node, "ibm,associativity"); + res = OF_getencprop(node, "ibm,associativity", + associativity, sizeof(associativity)); - /* If already at the root, use default domain. */ - if (res == 0) - return (0); - else if (res < 0) - /* If this node doesn't have associativity, check its parent. */ - return (powernv_node_numa_domain(platform, OF_parent(node))); - - OF_getencprop(node, "ibm,associativity", - associativity, res); + /* + * If this node doesn't have associativity, or if there are not + * enough elements in it, check its parent. + */ + if (res < (int)(sizeof(cell_t) * (platform_associativity + 1))) { + node = OF_parent(node); + /* If already at the root, use default domain. */ + if (node == 0) + return (0); + return (powernv_node_numa_domain(platform, node)); + } for (i = 0; i < numa_max_domain; i++) { if (numa_domains[i] == associativity[platform_associativity]) From owner-svn-src-all@freebsd.org Wed Jan 29 18:26:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E62CE1F8B74 for ; Wed, 29 Jan 2020 18:26:29 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 487Bl914JKz3QdV for ; Wed, 29 Jan 2020 18:26:28 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf1-x42b.google.com with SMTP id k29so48916pfp.13 for ; Wed, 29 Jan 2020 10:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Tpzo0AFypy/6lL592pUjtVS6GQM5jGopm3O6TWGGDDU=; b=j+L/jB+KYPG407/CPDr5G2swjheZSEkwOOk1DqbbCkzdx7AQfimFIbnbHxtBMbOyD0 eseJQn2aLUvv55n59248KKWpsOLUQWFn4kemlPzLViUexblhEgz9ZHjWOLLQ3AQO3Po8 59sSFCU91yZwLqTQOGIQ/DMeEBTEL5nCX3YyRCdOcp/wTDArhGhVEGzMwFMEENASUs/7 z2jTvQVin9HQPMWKWwDL/GshFXxd98ddDA/CyhrR4ct//iH7xYKhp+soUDlM8OYISUiL Kn0PtL85p8FxKXs9TJEuSgLZOV+CwMtq0iCwNYkYwvAIyQ6D35wko5xppBaQC+8i/MyP S2MQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=Tpzo0AFypy/6lL592pUjtVS6GQM5jGopm3O6TWGGDDU=; b=Pu5Eo6Mxca7sf7PnPpOGhPEImlLtqOHeAllI7DeG6TfnkkEnRTwyv4iyq6uwqM7vIc MRYZ7qoTkyZXMljOvh1TK/gq1vw1ZTA29k6pjSPjGkj9fk+xdW/Vb/z5iDw/9vFSQbuK n8uEPyDupSf7sH1V4/LEz41wHOS1jWOvb3wTQO9OJNKmlqWbGDihjG2oP7YM1pyQ4wM+ YKvFVPuYXrc/35HhvSDF5fmplNJKi7EayVkSpupHObOA8qjrt0Iim/aIIPn2ZBhLDDUn JSYmBqWfCn6gwe7ynd0QiM35Q3nQ6e8HAbBMkqGc+ir61VxozSJPWNnheiYl1fIMaPdi E7JA== X-Gm-Message-State: APjAAAXhQ3XjXWhuJoFb2Ewgf2oOI1nlL9D9Jfjeb29x9Ryi1N+/jH4J GUbxm06OdzPew7/H4jV8vInObg== X-Google-Smtp-Source: APXvYqx36GK5boTvMGg4jLXES+o2/44fPRy7nxW/NIaujzDb28uHT3XZJwsesp1G9pZDLHJEtnTooQ== X-Received: by 2002:aa7:8149:: with SMTP id d9mr864343pfn.170.1580322387493; Wed, 29 Jan 2020 10:26:27 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id 200sm3388641pfz.121.2020.01.29.10.26.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jan 2020 10:26:26 -0800 (PST) Date: Wed, 29 Jan 2020 08:26:24 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357253 - head/sys/vm In-Reply-To: <202001291202.00TC2lIa055211@repo.freebsd.org> Message-ID: References: <202001291202.00TC2lIa055211@repo.freebsd.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 487Bl914JKz3QdV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=j+L/jB+K; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::42b) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-4.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[b.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.53)[ip: (-8.78), ipnet: 2607:f8b0::/32(-2.03), asn: 15169(-1.78), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:26:30 -0000 Thank you, Jeff On Wed, 29 Jan 2020, Konstantin Belousov wrote: > Author: kib > Date: Wed Jan 29 12:02:47 2020 > New Revision: 357253 > URL: https://svnweb.freebsd.org/changeset/base/357253 > > Log: > Restore OOM logic on page fault after r357026. > > Right now OOM is initiated unconditionally on the page allocation > failure, after the wait. > > Reported by: Mark Millard > Reviewed by: cy, markj > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D23409 > > Modified: > head/sys/vm/vm_fault.c > > Modified: head/sys/vm/vm_fault.c > ============================================================================== > --- head/sys/vm/vm_fault.c Wed Jan 29 09:36:59 2020 (r357252) > +++ head/sys/vm/vm_fault.c Wed Jan 29 12:02:47 2020 (r357253) > @@ -1073,12 +1073,14 @@ vm_fault_allocate(struct faultstate *fs) > fs->oom < vm_pfault_oom_attempts) { > fs->oom++; > vm_waitpfault(dset, vm_pfault_oom_wait * hz); > + } else { > + if (bootverbose) > + printf( > + "proc %d (%s) failed to alloc page on fault, starting OOM\n", > + curproc->p_pid, curproc->p_comm); > + vm_pageout_oom(VM_OOM_MEM_PF); > + fs->oom = 0; > } > - if (bootverbose) > - printf( > -"proc %d (%s) failed to alloc page on fault, starting OOM\n", > - curproc->p_pid, curproc->p_comm); > - vm_pageout_oom(VM_OOM_MEM_PF); > return (KERN_RESOURCE_SHORTAGE); > } > fs->oom = 0; > From owner-svn-src-all@freebsd.org Wed Jan 29 18:41:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13E3B1F92AF; Wed, 29 Jan 2020 18:41:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487C4b6ryVz3whJ; Wed, 29 Jan 2020 18:41:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E69A6186ED; Wed, 29 Jan 2020 18:41:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TIfZP7092589; Wed, 29 Jan 2020 18:41:35 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TIfZdK092588; Wed, 29 Jan 2020 18:41:35 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001291841.00TIfZdK092588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 29 Jan 2020 18:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357263 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:41:36 -0000 Author: melifaro Date: Wed Jan 29 18:41:35 2020 New Revision: 357263 URL: https://svnweb.freebsd.org/changeset/base/357263 Log: Plug parent iface refcount leak on .X vlan creation. PR: kern/242270 Submitted by: Andrew Boyer MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Jan 29 18:13:44 2020 (r357262) +++ head/sys/net/if_vlan.c Wed Jan 29 18:41:35 2020 (r357263) @@ -963,10 +963,14 @@ vlan_clone_match_ethervid(const char *name, int *vidp) static int vlan_clone_match(struct if_clone *ifc, const char *name) { + struct ifnet *ifp; const char *cp; - if (vlan_clone_match_ethervid(name, NULL) != NULL) + ifp = vlan_clone_match_ethervid(name, NULL); + if (ifp != NULL) { + if_rele(ifp); return (1); + } if (strncmp(vlanname, name, strlen(vlanname)) != 0) return (0); From owner-svn-src-all@freebsd.org Wed Jan 29 18:47:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE781F95E7; Wed, 29 Jan 2020 18:47:10 +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 487CC20Qjnz3x6D; Wed, 29 Jan 2020 18:47:10 +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 E40061885C; Wed, 29 Jan 2020 18:47:09 +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 00TIl9H4095931; Wed, 29 Jan 2020 18:47:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TIl8wO095926; Wed, 29 Jan 2020 18:47:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001291847.00TIl8wO095926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 18:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357264 - in head: etc/mtree release/packages secure/caroot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree release/packages secure/caroot X-SVN-Commit-Revision: 357264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:47:10 -0000 Author: kevans Date: Wed Jan 29 18:47:08 2020 New Revision: 357264 URL: https://svnweb.freebsd.org/changeset/base/357264 Log: pkgbase: fix caroot packaging and add post-install script The original intention for caroot was to be packaged separately, perhaps so that users can have a more/less conservative upgrade policy for this separated from the rest of base. secure/caroot/Makefile doesn't have anything interesting to package, but its subdirectories might. Move the PACKAGE= to Makefile.inc so both blacklisted and trusted get packaged consistently into the correct one rather than the default -utilities. Also tag the directories for package=caroot, as they could also be empty; blacklisted is empty by default, but trusted is not. Add a post-install script to do certctl rehash, along with a note should we eventually come up with a way to detect that files have been added or removed that requires a rehash. -caroot gets a dependency on -utilities, as that's where we provide certctl at the moment. We can perhaps reconsider this and put certctl into this package in the future, but there are some bits within -utilities that unconditionally invoke certctl so let's hold off for now. Reviewed by: manu (earlier version, before -utilities dep added) Differential Revision: https://reviews.freebsd.org/D23352 Added: head/release/packages/caroot.ucl (contents, props changed) head/secure/caroot/Makefile.inc (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/release/packages/generate-ucl.sh head/secure/caroot/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Jan 29 18:41:35 2020 (r357263) +++ head/etc/mtree/BSD.usr.dist Wed Jan 29 18:47:08 2020 (r357264) @@ -201,9 +201,9 @@ .. .. certs - blacklisted + blacklisted tags=package=caroot .. - trusted + trusted tags=package=caroot .. .. dict Added: head/release/packages/caroot.ucl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/packages/caroot.ucl Wed Jan 29 18:47:08 2020 (r357264) @@ -0,0 +1,31 @@ +# +# $FreeBSD$ +# + +name = "FreeBSD-%PKGNAME%" +origin = "base" +version = "%VERSION%" +comment = "%COMMENT%" +categories = [ base ] +maintainer = "re@FreeBSD.org" +www = "https://www.FreeBSD.org" +prefix = "/" +licenselogic = "single" +licenses = [ BSD2CLAUSE ] +desc = < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C41EC1F96E0; Wed, 29 Jan 2020 18:50:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487CHN4qsGz3xJ8; Wed, 29 Jan 2020 18:50:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A12761888D; Wed, 29 Jan 2020 18:50:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TIouRG097714; Wed, 29 Jan 2020 18:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TIounu097712; Wed, 29 Jan 2020 18:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001291850.00TIounu097712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 18:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357265 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:50:56 -0000 Author: kevans Date: Wed Jan 29 18:50:55 2020 New Revision: 357265 URL: https://svnweb.freebsd.org/changeset/base/357265 Log: kmod build: start generating opt_global.h, include it For untied module builds, we'll generate opt_foo headers if they're included in SRCS. However, options that would normally be represented in opt_global.h aren't properly represented. Start generating opt_global.h with #define VIMAGE for !mips since it's almost universally a project default and right now kmods must hack it in themselves in order to be properly compiled for the default kernel. For example, ^/sys/modules/pf/Makefile Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23345 Modified: head/sys/conf/config.mk head/sys/conf/kmod.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Wed Jan 29 18:47:08 2020 (r357264) +++ head/sys/conf/config.mk Wed Jan 29 18:50:55 2020 (r357265) @@ -8,6 +8,10 @@ # the code here when they all produce identical results # (or should) .if !defined(KERNBUILDDIR) +opt_global.h: +.if ${MACHINE} != "mips" + @echo "#define VIMAGE 1" > ${.TARGET} +.endif opt_bpf.h: echo "#define DEV_BPF 1" > ${.TARGET} .if ${MK_INET_SUPPORT} != "no" Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Jan 29 18:47:08 2020 (r357264) +++ head/sys/conf/kmod.mk Wed Jan 29 18:50:55 2020 (r357265) @@ -106,6 +106,9 @@ NOSTDINC= -nostdinc CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*} .if defined(KERNBUILDDIR) CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h +.else +SRCS+= opt_global.h +CFLAGS+= -include ${.OBJDIR}/opt_global.h .endif # Add -I paths for system headers. Individual module makefiles don't From owner-svn-src-all@freebsd.org Wed Jan 29 18:54:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C208C1F9951; Wed, 29 Jan 2020 18:54:22 +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 487CML2pw4z3xhh; Wed, 29 Jan 2020 18:54:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BEC118A3F; Wed, 29 Jan 2020 18:54:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TIsMSa001631; Wed, 29 Jan 2020 18:54:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TIsMaV001630; Wed, 29 Jan 2020 18:54:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001291854.00TIsMaV001630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 18:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357266 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 18:54:22 -0000 Author: kevans Date: Wed Jan 29 18:54:21 2020 New Revision: 357266 URL: https://svnweb.freebsd.org/changeset/base/357266 Log: mips: unbreak module builds after r357265 Touch opt_global.h to make sure it exists... Pointy hat: kevans Modified: head/sys/conf/config.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Wed Jan 29 18:50:55 2020 (r357265) +++ head/sys/conf/config.mk Wed Jan 29 18:54:21 2020 (r357266) @@ -9,8 +9,9 @@ # (or should) .if !defined(KERNBUILDDIR) opt_global.h: + touch ${.TARGET} .if ${MACHINE} != "mips" - @echo "#define VIMAGE 1" > ${.TARGET} + @echo "#define VIMAGE 1" >> ${.TARGET} .endif opt_bpf.h: echo "#define DEV_BPF 1" > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Jan 29 21:06:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BE0E1FEB02; Wed, 29 Jan 2020 21:06:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487GHg1NlZz4BYW; Wed, 29 Jan 2020 21:06:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2665C1A3FD; Wed, 29 Jan 2020 21:06:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TL6MOE084226; Wed, 29 Jan 2020 21:06:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TL6M7U084225; Wed, 29 Jan 2020 21:06:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292106.00TL6M7U084225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 21:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357268 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 357268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 21:06:23 -0000 Author: dim Date: Wed Jan 29 21:06:22 2020 New Revision: 357268 URL: https://svnweb.freebsd.org/changeset/base/357268 Log: Merge r357260 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in procstat: usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] xo_close_container(name); ^ usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here } else ^ The intent was to group the xo_close_container() call to the previous snprintf() call. MFC after: 3 days Modified: head/usr.bin/procstat/procstat_sigs.c Directory Properties: head/ (props changed) Modified: head/usr.bin/procstat/procstat_sigs.c ============================================================================== --- head/usr.bin/procstat/procstat_sigs.c Wed Jan 29 20:56:31 2020 (r357267) +++ head/usr.bin/procstat/procstat_sigs.c Wed Jan 29 21:06:22 2020 (r357268) @@ -74,9 +74,10 @@ procstat_close_signame(int sig) for (i = 0; name[i] != 0; i++) name[i] = toupper(name[i]); xo_close_container(name); - } else + } else { snprintf(name, 12, "%d", sig); xo_close_container(name); + } } static void From owner-svn-src-all@freebsd.org Wed Jan 29 21:07:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A68991FEBE3; Wed, 29 Jan 2020 21:07:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487GKG3zS6z4Bhc; Wed, 29 Jan 2020 21:07:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB181A3FE; Wed, 29 Jan 2020 21:07:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TL7kon084364; Wed, 29 Jan 2020 21:07:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TL7k7r084363; Wed, 29 Jan 2020 21:07:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292107.00TL7k7r084363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 21:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357269 - head/usr.bin/tip/tip X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/tip/tip X-SVN-Commit-Revision: 357269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 21:07:46 -0000 Author: dim Date: Wed Jan 29 21:07:46 2020 New Revision: 357269 URL: https://svnweb.freebsd.org/changeset/base/357269 Log: Merge r357267 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in tip: usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (gch == EOF) ^ usr.bin/tip/tip/tip.c:426:5: note: previous statement is here } else if (!cumode && gch == character(value(FORCE))) ^ The intent was to have the EOF check grouped with the getchar() call just above it. This was accidentally introduced in r354624. MFC after: 3 days Modified: head/usr.bin/tip/tip/tip.c Directory Properties: head/ (props changed) Modified: head/usr.bin/tip/tip/tip.c ============================================================================== --- head/usr.bin/tip/tip/tip.c Wed Jan 29 21:06:22 2020 (r357268) +++ head/usr.bin/tip/tip/tip.c Wed Jan 29 21:07:46 2020 (r357269) @@ -423,11 +423,12 @@ tipin(void) if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; - } else if (!cumode && gch == character(value(FORCE))) + } else if (!cumode && gch == character(value(FORCE))) { gch = getchar(); if (gch == EOF) return; gch = gch & STRIP_PAR; + } bol = any(gch, value(EOL)); if (boolean(value(RAISE)) && islower(gch)) gch = toupper(gch); From owner-svn-src-all@freebsd.org Wed Jan 29 21:41:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A99F1F8022; Wed, 29 Jan 2020 21:41:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487H4V2k3Xz4F3c; Wed, 29 Jan 2020 21:41:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 589A61AB52; Wed, 29 Jan 2020 21:41:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TLfk8D007079; Wed, 29 Jan 2020 21:41:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TLfkMd007078; Wed, 29 Jan 2020 21:41:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292141.00TLfkMd007078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 21:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357272 - head/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Commit-Revision: 357272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 21:41:46 -0000 Author: dim Date: Wed Jan 29 21:41:45 2020 New Revision: 357272 URL: https://svnweb.freebsd.org/changeset/base/357272 Log: Merge r357271 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Directory Properties: head/ (props changed) Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Wed Jan 29 21:40:35 2020 (r357271) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Wed Jan 29 21:41:45 2020 (r357272) @@ -1232,9 +1232,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct s case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; From owner-svn-src-all@freebsd.org Wed Jan 29 22:37:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC0301F9E93; Wed, 29 Jan 2020 22:37:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487JJF60JGz4J0Y; Wed, 29 Jan 2020 22:37:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8DF61B4E3; Wed, 29 Jan 2020 22:37:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TMb1Sb038292; Wed, 29 Jan 2020 22:37:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMb1rw038291; Wed, 29 Jan 2020 22:37:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001292237.00TMb1rw038291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Jan 2020 22:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357273 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 357273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:37:02 -0000 Author: cem Date: Wed Jan 29 22:37:01 2020 New Revision: 357273 URL: https://svnweb.freebsd.org/changeset/base/357273 Log: Revert r357246 I have no idea what this code is trying to do, leave it be. Reported by: lwhsu Modified: head/tests/sys/sys/qmath_test.c Modified: head/tests/sys/sys/qmath_test.c ============================================================================== --- head/tests/sys/sys/qmath_test.c Wed Jan 29 21:41:45 2020 (r357272) +++ head/tests/sys/sys/qmath_test.c Wed Jan 29 22:37:01 2020 (r357273) @@ -47,7 +47,25 @@ #define QTEST_QITRUNC(q, iv) ((iv) >> Q_RPSHFT(q)) #define QTEST_FFACTOR 32.0 -#define GENRAND(a) arc4random_buf((a), sizeof(*(a))) +#define bitsperrand 31 +#define GENRAND(a, lb, ub) \ +({ \ + int _rembits; \ + do { \ + _rembits = Q_BITSPERBASEUP(ub) + Q_LTZ(lb); \ + *(a) = (__typeof(*(a)))0; \ + while (_rembits > 0) { \ + *(a) |= (((uint64_t)random()) & \ + ((1ULL << (_rembits > bitsperrand ? \ + bitsperrand : _rembits)) - 1)); \ + *(a) <<= (_rembits - (_rembits > bitsperrand ? \ + bitsperrand : _rembits)); \ + _rembits -= bitsperrand; \ + } \ + *(a) += lb; \ + } while (*(a) < (lb) || (uint64_t)*(a) > (ub)); \ + *(a); \ +}) /* * Smoke tests for basic qmath operations, such as initialization @@ -195,9 +213,11 @@ ATF_TC_BODY(qmulq_s64q, tc) #endif int error; + srandomdev(); + for (int i = 0; i < 10;) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXX: We cheat a bit, to stand any chance of multiplying @@ -258,9 +278,12 @@ ATF_TC_BODY(qdivq_s64q, tc) if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/240219"); + + srandomdev(); + for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -301,9 +324,11 @@ ATF_TC_BODY(qaddq_s64q, tc) double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; int error; + srandomdev(); + for (int i = 0; i < 10;) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -347,9 +372,11 @@ ATF_TC_BODY(qsubq_s64q, tc) double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; int error; + srandomdev(); + for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -391,9 +418,11 @@ ATF_TC_BODY(qfraci_s64q, tc) int64_t a_int, b_int; int error; + srandomdev(); + for (int i = 0; i < 10;) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -436,9 +465,11 @@ ATF_TC_BODY(qmuli_s64q, tc) int64_t a_int, b_int; int error; + srandomdev(); + for (int i = 0; i < 10;) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -481,9 +512,11 @@ ATF_TC_BODY(qaddi_s64q, tc) int64_t a_int, b_int; int error; + srandomdev(); + for (int i = 0; i < 10;) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. @@ -530,9 +563,11 @@ ATF_TC_BODY(qsubi_s64q, tc) int64_t a_int, b_int; int error; + srandomdev(); + for (int i = 0; i < 10; i++) { - GENRAND(&a_s64q); - GENRAND(&b_s64q); + GENRAND(&a_s64q, INT64_MIN, UINT64_MAX); + GENRAND(&b_s64q, INT64_MIN, UINT64_MAX); /* * XXXLAS: Until Qmath handles precision normalisation, only * test with equal precision. From owner-svn-src-all@freebsd.org Wed Jan 29 22:38:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA2B91F9F7E; Wed, 29 Jan 2020 22:38:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (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 487JLG5wXJz4J7W; Wed, 29 Jan 2020 22:38:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f54.google.com with SMTP id i6so1245119otr.7; Wed, 29 Jan 2020 14:38:46 -0800 (PST) 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=tuQ3z4odWJFtuoZalbF+7RSgxVoPDS68o3blMtHrOsc=; b=dUGeieVC8V93oWJWhlK+oxlqlHopaVyVltldp2h3G3Iz+WyxWKz56/g/6Xa2xNqfDb /8ss3r6kDS1Srd3erHK6BbNqdz6ZIN5cqLspq4otdOmTWOCE+sn6mhHKiA9O7DyH450K 1IT2d85goK8x4C9bkZFp2U2wjcrirsgVcxUjYAro1J6NdGsJ86XXXSYTPgv+Hpp4IWxE sifXaHxyAgCOQRZNx7reGfW+22bNXZmMwiQ0klBE3H8H4ZEjFTexrMRlduN/KWE6G8PG qAcBb8rWuSUm1r8Pn1opGVtCII+bNBjO0waSva1wUP1ptczVXM2U0SSbOGnpHGyb4bEJ lOwg== X-Gm-Message-State: APjAAAWyTkXDte/Y7WfCa+KEVhb/43BrGl8oTUd1NGd/DRTEJmJhQH9O yB8RZdt5WQKMWTyt1ddL4S0m6aix X-Google-Smtp-Source: APXvYqyQ5cXLQio4bkz5o5Il2eUZBYdjYmyF3cAUBxtNTdXM6159EXQzyy1bIPT0dKLsPveyMk8soA== X-Received: by 2002:a9d:6758:: with SMTP id w24mr1279558otm.155.1580337525556; Wed, 29 Jan 2020 14:38:45 -0800 (PST) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com. [209.85.167.178]) by smtp.gmail.com with ESMTPSA id u18sm1161367otq.26.2020.01.29.14.38.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jan 2020 14:38:45 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id l9so1486673oii.5; Wed, 29 Jan 2020 14:38:45 -0800 (PST) X-Received: by 2002:aca:3017:: with SMTP id w23mr848120oiw.152.1580337525134; Wed, 29 Jan 2020 14:38:45 -0800 (PST) MIME-Version: 1.0 References: <202001290525.00T5PKKh017113@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 29 Jan 2020 14:38:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357246 - head/tests/sys/sys To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 487JLG5wXJz4J7W X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:38:47 -0000 Hi Li-Wen, Thanks for the report. I went ahead and reverted it in r357273. Best, Conrad On Wed, Jan 29, 2020 at 8:47 AM Li-Wen Hsu wrote: > > On Wed, Jan 29, 2020 at 1:25 PM Conrad Meyer wrote: > > > > Author: cem > > Date: Wed Jan 29 05:25:20 2020 > > New Revision: 357246 > > URL: https://svnweb.freebsd.org/changeset/base/357246 > > > > Log: > > qmath(3) test: Replace overcomplicated abomination with arc4random(3) > > > > The horrific GENRAND construction bent over backwards to construct 64-bit > > signed integers from the 31-bit output of random(3) for about 20 numbers per > > test. Reproducibility wasn't a goal: random(3) was seeded with > > srandomdev(3). Speed is not a factor for generating 20 integers with > > arc4random(3). Range is not a factor: all uses did not bound the range > > beyond that of the full [INT64_MIN, INT64_MAX]. Just use arc4random(3). > > > > Reported by: Coverity > > CIDs: 1404809, 1404817, 1404838, 1404840 and about 6x other > > identical reports of dubious code relating to the > > construction > > > > Modified: > > head/tests/sys/sys/qmath_test.c > > These two test cases are starting failing since this commit: > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14110/testReport/sys.sys/qmath_test/qsubi_s64q/ > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/14110/testReport/sys.sys/qmath_test/qsubq_s64q/ > > Can you help check them? Thanks! > > Li-Wen From owner-svn-src-all@freebsd.org Wed Jan 29 22:40:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 955811FA03C; Wed, 29 Jan 2020 22:40:14 +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 487JMy3Tklz4JGF; Wed, 29 Jan 2020 22:40:14 +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 6E9A31B4E7; Wed, 29 Jan 2020 22:40:14 +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 00TMeEXi038508; Wed, 29 Jan 2020 22:40:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMeEFh038507; Wed, 29 Jan 2020 22:40:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001292240.00TMeEFh038507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 22:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357274 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:40:14 -0000 Author: kevans Date: Wed Jan 29 22:40:13 2020 New Revision: 357274 URL: https://svnweb.freebsd.org/changeset/base/357274 Log: config.mk: #define MAC as well MAC is also almost universally a default; every GENERIC includes it, and it's std.armv[67]. mips is again the oddball here with it only being included in ERL/OCTEON1. The only module currently working around this one is mac_veriexec, but it looks like nothing it builds actually uses the MAC definition. Downstream consumers enabling MAC in mips using mac_veriexec may be advised to do something differently here in config.mk. Modified: head/sys/conf/config.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Wed Jan 29 22:37:01 2020 (r357273) +++ head/sys/conf/config.mk Wed Jan 29 22:40:13 2020 (r357274) @@ -12,6 +12,7 @@ opt_global.h: touch ${.TARGET} .if ${MACHINE} != "mips" @echo "#define VIMAGE 1" >> ${.TARGET} + @echo "#define MAC 1" >> ${.TARGET} .endif opt_bpf.h: echo "#define DEV_BPF 1" > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Jan 29 22:43:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FE721FA2DB; Wed, 29 Jan 2020 22:43:57 +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 487JSF2HdYz4Jdr; Wed, 29 Jan 2020 22:43:57 +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 49BC51B6A9; Wed, 29 Jan 2020 22:43:57 +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 00TMhvb8043868; Wed, 29 Jan 2020 22:43:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMhukT043866; Wed, 29 Jan 2020 22:43:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001292243.00TMhukT043866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jan 2020 22:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357275 - in head/sys/modules: if_lagg if_vlan X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/modules: if_lagg if_vlan X-SVN-Commit-Revision: 357275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:43:57 -0000 Author: kevans Date: Wed Jan 29 22:43:56 2020 New Revision: 357275 URL: https://svnweb.freebsd.org/changeset/base/357275 Log: modules: adding some missing opt_* dependencies if_vlan grew a dependency on opt_inet6.h in r356993 if_lagg and if_vlan both grew a dependency on opt_kern_tls.h in r351522 This is needed for standalone module builds of these guys. Modified: head/sys/modules/if_lagg/Makefile head/sys/modules/if_vlan/Makefile Modified: head/sys/modules/if_lagg/Makefile ============================================================================== --- head/sys/modules/if_lagg/Makefile Wed Jan 29 22:40:13 2020 (r357274) +++ head/sys/modules/if_lagg/Makefile Wed Jan 29 22:43:56 2020 (r357275) @@ -2,6 +2,7 @@ .PATH: ${SRCTOP}/sys/net KMOD= if_lagg -SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_ratelimit.h +SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_kern_tls.h +SRCS+= opt_ratelimit.h .include Modified: head/sys/modules/if_vlan/Makefile ============================================================================== --- head/sys/modules/if_vlan/Makefile Wed Jan 29 22:40:13 2020 (r357274) +++ head/sys/modules/if_vlan/Makefile Wed Jan 29 22:43:56 2020 (r357275) @@ -4,6 +4,6 @@ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h +SRCS+= opt_inet.h opt_inet6.h opt_kern_tls.h opt_vlan.h opt_ratelimit.h .include From owner-svn-src-all@freebsd.org Wed Jan 29 22:48:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5498C1FA5FA; Wed, 29 Jan 2020 22:48:19 +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 487JYH1Ws8z4K34; Wed, 29 Jan 2020 22:48:19 +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 2FAF91B6D4; Wed, 29 Jan 2020 22:48:19 +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 00TMmJTd044268; Wed, 29 Jan 2020 22:48:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMmJiB044267; Wed, 29 Jan 2020 22:48:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001292248.00TMmJiB044267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 29 Jan 2020 22:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357276 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:48:19 -0000 Author: glebius Date: Wed Jan 29 22:48:18 2020 New Revision: 357276 URL: https://svnweb.freebsd.org/changeset/base/357276 Log: Fix missing NET_EPOCH_ENTER() when compiled with TCP_OFFLOAD. Reported by: Coverity CID: 1413162 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 29 22:43:56 2020 (r357275) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 29 22:48:18 2020 (r357276) @@ -911,12 +911,12 @@ tcp_usr_rcvd(struct socket *so, int flags) if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) goto out; + NET_EPOCH_ENTER(et); #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) tcp_offload_rcvd(tp); else #endif - NET_EPOCH_ENTER(et); tp->t_fb->tfb_tcp_output(tp); NET_EPOCH_EXIT(et); out: From owner-svn-src-all@freebsd.org Wed Jan 29 22:56:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A9081FACA0; Wed, 29 Jan 2020 22:56:00 +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 487Jk81bfgz4Kdw; Wed, 29 Jan 2020 22:56:00 +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 322A61B921; Wed, 29 Jan 2020 22:56:00 +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 00TMu0L0049962; Wed, 29 Jan 2020 22:56:00 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMu0bo049961; Wed, 29 Jan 2020 22:56:00 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001292256.00TMu0bo049961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 29 Jan 2020 22:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357277 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 357277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:56:00 -0000 Author: vmaffione Date: Wed Jan 29 22:55:59 2020 New Revision: 357277 URL: https://svnweb.freebsd.org/changeset/base/357277 Log: MFC r357159 netmap_mem_unmap: fix NULL pointer dereference Modified: stable/12/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_mem2.c Wed Jan 29 22:48:18 2020 (r357276) +++ stable/12/sys/dev/netmap/netmap_mem2.c Wed Jan 29 22:55:59 2020 (r357277) @@ -1523,11 +1523,12 @@ static int netmap_mem_unmap(struct netmap_obj_pool *p, struct netmap_adapter *na) { int i, lim = p->objtotal; - struct netmap_lut *lut = &na->na_lut; + struct netmap_lut *lut; if (na == NULL || na->pdev == NULL) return 0; + lut = &na->na_lut; #if defined(__FreeBSD__) /* On FreeBSD mapping and unmapping is performed by the txsync * and rxsync routine, packet by packet. */ From owner-svn-src-all@freebsd.org Wed Jan 29 22:57:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E07B71FAD9B; Wed, 29 Jan 2020 22:57:54 +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 487JmL5hCFz4KmY; Wed, 29 Jan 2020 22:57:54 +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 BE8961B924; Wed, 29 Jan 2020 22:57:54 +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 00TMvskq050100; Wed, 29 Jan 2020 22:57:54 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TMvskI050099; Wed, 29 Jan 2020 22:57:54 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001292257.00TMvskI050099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 29 Jan 2020 22:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357278 - stable/11/sys/dev/netmap X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/netmap X-SVN-Commit-Revision: 357278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 22:57:54 -0000 Author: vmaffione Date: Wed Jan 29 22:57:54 2020 New Revision: 357278 URL: https://svnweb.freebsd.org/changeset/base/357278 Log: MFC r357159 netmap_mem_unmap: fix NULL pointer dereference Modified: stable/11/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/11/sys/dev/netmap/netmap_mem2.c Wed Jan 29 22:55:59 2020 (r357277) +++ stable/11/sys/dev/netmap/netmap_mem2.c Wed Jan 29 22:57:54 2020 (r357278) @@ -1520,11 +1520,12 @@ static int netmap_mem_unmap(struct netmap_obj_pool *p, struct netmap_adapter *na) { int i, lim = p->objtotal; - struct netmap_lut *lut = &na->na_lut; + struct netmap_lut *lut; if (na == NULL || na->pdev == NULL) return 0; + lut = &na->na_lut; #if defined(__FreeBSD__) /* On FreeBSD mapping and unmapping is performed by the txsync * and rxsync routine, packet by packet. */ From owner-svn-src-all@freebsd.org Thu Jan 30 00:18:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14C961FD597; Thu, 30 Jan 2020 00:18:01 +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 487LXm6c1mz4PPj; Thu, 30 Jan 2020 00:18:00 +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 DDCBF1C7A6; Thu, 30 Jan 2020 00:18:00 +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 00U0I0la097910; Thu, 30 Jan 2020 00:18:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U0I0rp097909; Thu, 30 Jan 2020 00:18:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001300018.00U0I0rp097909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 30 Jan 2020 00:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357279 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 00:18:01 -0000 Author: glebius Date: Thu Jan 30 00:18:00 2020 New Revision: 357279 URL: https://svnweb.freebsd.org/changeset/base/357279 Log: Fix text format definition for kern.maxvnodes, vfs.wantfreevnodes. This is a regression from r356642, r356645. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jan 29 22:57:54 2020 (r357278) +++ head/sys/kern/vfs_subr.c Thu Jan 30 00:18:00 2020 (r357279) @@ -360,7 +360,7 @@ sysctl_maxvnodes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, - "UL", "Target for maximum number of vnodes"); + "LU", "Target for maximum number of vnodes"); static int sysctl_wantfreevnodes(SYSCTL_HANDLER_ARGS) @@ -384,7 +384,7 @@ sysctl_wantfreevnodes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vfs, OID_AUTO, wantfreevnodes, CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_wantfreevnodes, - "UL", "Target for minimum number of \"free\" vnodes"); + "LU", "Target for minimum number of \"free\" vnodes"); SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)"); From owner-svn-src-all@freebsd.org Thu Jan 30 02:12:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E12B228632; Thu, 30 Jan 2020 02:12:53 +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 487P5J6f1lz4VnF; Thu, 30 Jan 2020 02:12:52 +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 DF6001DD66; Thu, 30 Jan 2020 02:12:52 +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 00U2CqSO069542; Thu, 30 Jan 2020 02:12:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U2Cqnu069541; Thu, 30 Jan 2020 02:12:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300212.00U2Cqnu069541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 02:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357280 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 02:12:53 -0000 Author: mjg Date: Thu Jan 30 02:12:52 2020 New Revision: 357280 URL: https://svnweb.freebsd.org/changeset/base/357280 Log: vfs: unlazy before dooming the vnode With this change having the listmtx lock held postpones dooming the vnode. Use this fact to simplify iteration over the lazy list. It also allows filters to safely access ->v_data. Reviewed by: kib (early version) Differential Revision: https://reviews.freebsd.org/D23397 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jan 30 00:18:00 2020 (r357279) +++ head/sys/kern/vfs_subr.c Thu Jan 30 02:12:52 2020 (r357280) @@ -1805,20 +1805,13 @@ delmntque(struct vnode *vp) { struct mount *mp; + VNPASS((vp->v_mflag & VMP_LAZYLIST) == 0, vp); + mp = vp->v_mount; if (mp == NULL) return; MNT_ILOCK(mp); VI_LOCK(vp); - if (vp->v_mflag & VMP_LAZYLIST) { - mtx_lock(&mp->mnt_listmtx); - if (vp->v_mflag & VMP_LAZYLIST) { - vp->v_mflag &= ~VMP_LAZYLIST; - TAILQ_REMOVE(&mp->mnt_lazyvnodelist, vp, v_lazylist); - mp->mnt_lazyvnodelistsize--; - } - mtx_unlock(&mp->mnt_listmtx); - } vp->v_mount = NULL; VI_UNLOCK(vp); VNASSERT(mp->mnt_nvnodelistsize > 0, vp, @@ -3079,6 +3072,11 @@ vlazy(struct vnode *vp) if ((vp->v_mflag & VMP_LAZYLIST) != 0) return; + /* + * We may get here for inactive routines after the vnode got doomed. + */ + if (VN_IS_DOOMED(vp)) + return; mp = vp->v_mount; mtx_lock(&mp->mnt_listmtx); if ((vp->v_mflag & VMP_LAZYLIST) == 0) { @@ -3089,7 +3087,31 @@ vlazy(struct vnode *vp) mtx_unlock(&mp->mnt_listmtx); } +/* + * This routine is only meant to be called from vgonel prior to dooming + * the vnode. + */ static void +vunlazy_gone(struct vnode *vp) +{ + struct mount *mp; + + ASSERT_VOP_ELOCKED(vp, __func__); + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(!VN_IS_DOOMED(vp), vp); + + if (vp->v_mflag & VMP_LAZYLIST) { + mp = vp->v_mount; + mtx_lock(&mp->mnt_listmtx); + VNPASS(vp->v_mflag & VMP_LAZYLIST, vp); + vp->v_mflag &= ~VMP_LAZYLIST; + TAILQ_REMOVE(&mp->mnt_lazyvnodelist, vp, v_lazylist); + mp->mnt_lazyvnodelistsize--; + mtx_unlock(&mp->mnt_listmtx); + } +} + +static void vdefer_inactive(struct vnode *vp) { @@ -3808,6 +3830,7 @@ vgonel(struct vnode *vp) */ if (vp->v_irflag & VIRF_DOOMED) return; + vunlazy_gone(vp); vp->v_irflag |= VIRF_DOOMED; /* @@ -6221,8 +6244,6 @@ static bool mnt_vnode_next_lazy_relock(struct vnode *mvp, struct mount *mp, struct vnode *vp) { - const struct vnode *tmp; - bool held, ret; VNASSERT(mvp->v_mount == mp && mvp->v_type == VMARKER && TAILQ_NEXT(mvp, v_lazylist) != NULL, mvp, @@ -6232,65 +6253,37 @@ mnt_vnode_next_lazy_relock(struct vnode *mvp, struct m ASSERT_VI_UNLOCKED(vp, __func__); mtx_assert(&mp->mnt_listmtx, MA_OWNED); - ret = false; - TAILQ_REMOVE(&mp->mnt_lazyvnodelist, mvp, v_lazylist); TAILQ_INSERT_BEFORE(vp, mvp, v_lazylist); - /* - * Use a hold to prevent vp from disappearing while the mount vnode - * list lock is dropped and reacquired. Normally a hold would be - * acquired with vhold(), but that might try to acquire the vnode - * interlock, which would be a LOR with the mount vnode list lock. - */ - held = refcount_acquire_if_not_zero(&vp->v_holdcnt); + vholdnz(vp); mtx_unlock(&mp->mnt_listmtx); - if (!held) - goto abort; VI_LOCK(vp); - if (!refcount_release_if_not_last(&vp->v_holdcnt)) { - vdropl(vp); - goto abort; + if (VN_IS_DOOMED(vp)) { + VNPASS((vp->v_mflag & VMP_LAZYLIST) == 0, vp); + goto out_lost; } - mtx_lock(&mp->mnt_listmtx); - + VNPASS(vp->v_mflag & VMP_LAZYLIST, vp); /* - * Determine whether the vnode is still the next one after the marker, - * excepting any other markers. If the vnode has not been doomed by - * vgone() then the hold should have ensured that it remained on the - * lazy list. If it has been doomed but is still on the lazy list, - * don't abort, but rather skip over it (avoid spinning on doomed - * vnodes). + * Since we had a period with no locks held we may be the last + * remaining user, in which case there is nothing to do. */ - tmp = mvp; - do { - tmp = TAILQ_NEXT(tmp, v_lazylist); - } while (tmp != NULL && tmp->v_type == VMARKER); - if (tmp != vp) { - mtx_unlock(&mp->mnt_listmtx); - VI_UNLOCK(vp); - goto abort; - } - - ret = true; - goto out; -abort: + if (!refcount_release_if_not_last(&vp->v_holdcnt)) + goto out_lost; + mtx_lock(&mp->mnt_listmtx); + return (true); +out_lost: + vdropl(vp); maybe_yield(); mtx_lock(&mp->mnt_listmtx); -out: - if (ret) - ASSERT_VI_LOCKED(vp, __func__); - else - ASSERT_VI_UNLOCKED(vp, __func__); - mtx_assert(&mp->mnt_listmtx, MA_OWNED); - return (ret); + return (false); } static struct vnode * mnt_vnode_next_lazy(struct vnode **mvp, struct mount *mp, mnt_lazy_cb_t *cb, void *cbarg) { - struct vnode *vp, *nvp; + struct vnode *vp; mtx_assert(&mp->mnt_listmtx, MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); @@ -6306,7 +6299,8 @@ restart: * long string of vnodes we don't care about and hog the list * as a result. Check for it and requeue the marker. */ - if (VN_IS_DOOMED(vp) || !cb(vp, cbarg)) { + VNPASS(!VN_IS_DOOMED(vp), vp); + if (!cb(vp, cbarg)) { if (!should_yield()) { vp = TAILQ_NEXT(vp, v_lazylist); continue; @@ -6321,9 +6315,7 @@ restart: goto restart; } /* - * Try-lock because this is the wrong lock order. If that does - * not succeed, drop the mount vnode list lock and try to - * reacquire it and the vnode interlock in the right order. + * Try-lock because this is the wrong lock order. */ if (!VI_TRYLOCK(vp) && !mnt_vnode_next_lazy_relock(*mvp, mp, vp)) @@ -6331,11 +6323,9 @@ restart: KASSERT(vp->v_type != VMARKER, ("locked marker %p", vp)); KASSERT(vp->v_mount == mp || vp->v_mount == NULL, ("alien vnode on the lazy list %p %p", vp, mp)); - if (vp->v_mount == mp && !VN_IS_DOOMED(vp)) - break; - nvp = TAILQ_NEXT(vp, v_lazylist); - VI_UNLOCK(vp); - vp = nvp; + VNPASS(vp->v_mount == mp, vp); + VNPASS(!VN_IS_DOOMED(vp), vp); + break; } TAILQ_REMOVE(&mp->mnt_lazyvnodelist, *mvp, v_lazylist); From owner-svn-src-all@freebsd.org Thu Jan 30 02:14:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1609A2286DE; Thu, 30 Jan 2020 02:14:11 +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 487P6p6t6Pz4Vw8; Thu, 30 Jan 2020 02:14:10 +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 E750E1DD6C; Thu, 30 Jan 2020 02:14:10 +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 00U2EA7C069644; Thu, 30 Jan 2020 02:14:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U2EANX069643; Thu, 30 Jan 2020 02:14:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300214.00U2EANX069643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 02:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357281 - 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: 357281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 02:14:11 -0000 Author: mjg Date: Thu Jan 30 02:14:10 2020 New Revision: 357281 URL: https://svnweb.freebsd.org/changeset/base/357281 Log: zfs: use VOP_NEED_INACTIVE Big thanks to Greg V for testing previous verions of the patch. Differential Revision: https://reviews.freebsd.org/D22130 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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 Jan 30 02:12:52 2020 (r357280) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 30 02:14:10 2020 (r357281) @@ -5314,6 +5314,29 @@ zfs_freebsd_inactive(ap) } static int +zfs_freebsd_need_inactive(ap) + struct vop_need_inactive_args /* { + struct vnode *a_vp; + struct thread *a_td; + } */ *ap; +{ + vnode_t *vp = ap->a_vp; + znode_t *zp = VTOZ(vp); + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + int need; + + if (vn_need_pageq_flush(vp)) + return (1); + + if (!rw_tryenter(&zfsvfs->z_teardown_inactive_lock, RW_READER)) + return (1); + need = (zp->z_sa_hdl == NULL || zp->z_unlinked || zp->z_atime_dirty); + rw_exit(&zfsvfs->z_teardown_inactive_lock); + + return (need); +} + +static int zfs_freebsd_reclaim(ap) struct vop_reclaim_args /* { struct vnode *a_vp; @@ -5949,6 +5972,7 @@ struct vop_vector zfs_shareops; struct vop_vector zfs_vnodeops = { .vop_default = &default_vnodeops, .vop_inactive = zfs_freebsd_inactive, + .vop_need_inactive = zfs_freebsd_need_inactive, .vop_reclaim = zfs_freebsd_reclaim, .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, From owner-svn-src-all@freebsd.org Thu Jan 30 02:16:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6889E2287D3; Thu, 30 Jan 2020 02:16: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 487P9G2B2Kz4W8Z; Thu, 30 Jan 2020 02:16: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 4610A1DD76; Thu, 30 Jan 2020 02:16: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 00U2GItQ069958; Thu, 30 Jan 2020 02:16:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U2GHGR069955; Thu, 30 Jan 2020 02:16:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300216.00U2GHGR069955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 02:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357282 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 02:16:18 -0000 Author: mjg Date: Thu Jan 30 02:16:17 2020 New Revision: 357282 URL: https://svnweb.freebsd.org/changeset/base/357282 Log: zfs: fix spurious lock contention during path lookup ZFS tracks if anything denies VEXEC to allow for a quick check for the common case of path traversal. Use it. Differential Revision: https://reviews.freebsd.org/D22224 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Thu Jan 30 02:14:10 2020 (r357281) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Thu Jan 30 02:16:17 2020 (r357282) @@ -214,7 +214,10 @@ void zfs_oldace_byteswap(ace_t *, int); void zfs_ace_byteswap(void *, size_t, boolean_t); extern boolean_t zfs_has_access(struct znode *zp, cred_t *cr); extern int zfs_zaccess(struct znode *, int, int, boolean_t, cred_t *); +#ifdef illumos int zfs_fastaccesschk_execute(struct znode *, cred_t *); +#endif +int zfs_freebsd_fastaccesschk_execute(struct vnode *, cred_t *); extern int zfs_zaccess_rwx(struct znode *, mode_t, int, cred_t *); extern int zfs_zaccess_unix(struct znode *, mode_t, cred_t *); extern int zfs_acl_access(struct znode *, int, cred_t *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Jan 30 02:14:10 2020 (r357281) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Jan 30 02:16:17 2020 (r357282) @@ -2299,7 +2299,41 @@ zfs_zaccess_append(znode_t *zp, uint32_t *working_mode check_privs, B_FALSE, cr)); } +/* + * Check if VEXEC is allowed. + * + * This routine is based on zfs_fastaccesschk_execute which has slowpath + * calling zfs_zaccess. This would be incorrect on FreeBSD (see + * zfs_freebsd_access for the difference). Thus this variant let's the + * caller handle the slowpath (if necessary). + * + * We only check for ZFS_NO_EXECS_DENIED and fail early. This routine can + * be extended to cover more cases, but the flag covers the majority. + */ int +zfs_freebsd_fastaccesschk_execute(struct vnode *vp, cred_t *cr) +{ + boolean_t is_attr; + znode_t *zdp = VTOZ(vp); + + ASSERT_VOP_LOCKED(vp, __func__); + + if (zdp->z_pflags & ZFS_AV_QUARANTINED) + return (1); + + is_attr = ((zdp->z_pflags & ZFS_XATTR) && + (ZTOV(zdp)->v_type == VDIR)); + if (is_attr) + return (1); + + if (zdp->z_pflags & ZFS_NO_EXECS_DENIED) + return (0); + + return (1); +} + +#ifdef illumos +int zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr) { boolean_t owner = B_FALSE; @@ -2365,6 +2399,7 @@ slow: ZFS_EXIT(zdp->z_zfsvfs); return (error); } +#endif /* * Determine whether Access should be granted/denied. 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 Jan 30 02:14:10 2020 (r357281) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 30 02:16:17 2020 (r357282) @@ -4858,6 +4858,11 @@ zfs_freebsd_access(ap) accmode_t accmode; int error = 0; + if (ap->a_accmode == VEXEC) { + if (zfs_freebsd_fastaccesschk_execute(ap->a_vp, ap->a_cred) == 0) + return (0); + } + /* * ZFS itself only knowns about VREAD, VWRITE, VEXEC and VAPPEND, */ From owner-svn-src-all@freebsd.org Thu Jan 30 03:01:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 943CE229874; Thu, 30 Jan 2020 03:01:03 +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 487Q8v2v7Yz4Y42; Thu, 30 Jan 2020 03:01:03 +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 5D5481E630; Thu, 30 Jan 2020 03:01:03 +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 00U313Aq099105; Thu, 30 Jan 2020 03:01:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U310Z8099092; Thu, 30 Jan 2020 03:01:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001300301.00U310Z8099092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 30 Jan 2020 03:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357283 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 357283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 03:01:03 -0000 Author: kevans Date: Thu Jan 30 03:01:00 2020 New Revision: 357283 URL: https://svnweb.freebsd.org/changeset/base/357283 Log: pkgbase: generate dependencies in generate-ucl.sh This cuts out a large chunk of duplicated *.ucl files that just needed dependencies tacked on, and gives generate-ucl.sh some leeway in case a future pkg may need more than one dependency. Run-through to determine which ones could simply be removed done with for i in *.ucl; do diff -U3 template.ucl ${i}; done | less and inspecting for any differences beyond just adding deps at the end. The remaining ucl files are basically all differently-licensed, require scripts, or are marked vital. I've opted to remove %PKGDEPS% entirely without regard for third-party ucl, as pkgbase is not yet considered production. However, I do not hold a strong position on this and there is approximately 0 chance it will return. clibs should have been added previously in generate-ucl.sh as one that doesn't have any dependencies, but do so now that we would otherwise be tacking on the runtime dependency. Reviewed by: manu, bapt (earlier version) Differential Revision: https://reviews.freebsd.org/D23415 Deleted: head/release/packages/acct.ucl head/release/packages/acpi.ucl head/release/packages/amd.ucl head/release/packages/apm.ucl head/release/packages/at.ucl head/release/packages/autofs.ucl head/release/packages/bhyve.ucl head/release/packages/bluetooth.ucl head/release/packages/bsdinstall.ucl head/release/packages/bsnmp.ucl head/release/packages/dma.ucl head/release/packages/ee.ucl head/release/packages/hostapd.ucl head/release/packages/jail-debug.ucl head/release/packages/jail-development.ucl head/release/packages/jail-lib32-debug.ucl head/release/packages/jail-lib32-development.ucl head/release/packages/jail-lib32-profile.ucl head/release/packages/jail-lib32.ucl head/release/packages/jail-profile.ucl head/release/packages/rcmds.ucl head/release/packages/runtime-debug.ucl head/release/packages/runtime-development.ucl head/release/packages/runtime-lib32.ucl head/release/packages/runtime-manuals.ucl head/release/packages/runtime-profile.ucl head/release/packages/syscons.ucl head/release/packages/tests.ucl head/release/packages/vi.ucl head/release/packages/wpa.ucl Modified: head/release/packages/binutils.ucl head/release/packages/caroot.ucl head/release/packages/clang.ucl head/release/packages/gdb.ucl head/release/packages/generate-ucl.sh head/release/packages/groff.ucl head/release/packages/jail.ucl head/release/packages/lld.ucl head/release/packages/lldb.ucl head/release/packages/runtime.ucl head/release/packages/ssh.ucl head/release/packages/svn.ucl head/release/packages/unbound.ucl Modified: head/release/packages/binutils.ucl ============================================================================== --- head/release/packages/binutils.ucl Thu Jan 30 02:16:17 2020 (r357282) +++ head/release/packages/binutils.ucl Thu Jan 30 03:01:00 2020 (r357283) @@ -15,10 +15,4 @@ licenses = [ GPLv2 ] desc = <> ${uclfile} +deps: { + FreeBSD-${pkgdeps}: { + origin: "base", + version: "${PKG_VERSION}" + } +} +EOF + fi cap_arg="$( make -f ${srctree}/share/mk/bsd.endian.mk -VCAP_MKDB_ENDIAN )" sed -i '' -e "s/%VERSION%/${PKG_VERSION}/" \ -e "s/%PKGNAME%/${origname}/" \ -e "s/%COMMENT%/${comment}/" \ -e "s/%DESC%/${desc}/" \ -e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \ - -e "s/%PKGDEPS%/${pkgdeps}/" \ ${uclfile} return 0 } Modified: head/release/packages/groff.ucl ============================================================================== --- head/release/packages/groff.ucl Thu Jan 30 02:16:17 2020 (r357282) +++ head/release/packages/groff.ucl Thu Jan 30 03:01:00 2020 (r357283) @@ -15,10 +15,4 @@ licenses = [ GPLv2 ] desc = < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34A6022A679; Thu, 30 Jan 2020 03:31:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487Qqq0cK3z4ZlH; Thu, 30 Jan 2020 03:31:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1025B1EC49; Thu, 30 Jan 2020 03:31:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00U3VIlG017302; Thu, 30 Jan 2020 03:31:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U3VGCe017289; Thu, 30 Jan 2020 03:31:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001300331.00U3VGCe017289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 30 Jan 2020 03:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357284 - in head: include lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: include lib/libc/stdio X-SVN-Commit-Revision: 357284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 03:31:19 -0000 Author: kevans Date: Thu Jan 30 03:31:16 2020 New Revision: 357284 URL: https://svnweb.freebsd.org/changeset/base/357284 Log: stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite fflush_unlocked is currently desired in ports by sysutils/metalog, and redefined as the locked fflush. fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are currently desired in ports by devel/elfutils, and redefined as the locked fputs, fread, and fwrite respectively. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23336 Modified: head/include/stdio.h head/lib/libc/stdio/Makefile.inc head/lib/libc/stdio/Symbol.map head/lib/libc/stdio/fflush.3 head/lib/libc/stdio/fflush.c head/lib/libc/stdio/fputc.c head/lib/libc/stdio/fputs.3 head/lib/libc/stdio/fputs.c head/lib/libc/stdio/fread.3 head/lib/libc/stdio/fread.c head/lib/libc/stdio/fwrite.c head/lib/libc/stdio/putc.3 Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Thu Jan 30 03:01:00 2020 (r357283) +++ head/include/stdio.h Thu Jan 30 03:31:16 2020 (r357284) @@ -346,7 +346,12 @@ int putchar_unlocked(int); void clearerr_unlocked(FILE *); int feof_unlocked(FILE *); int ferror_unlocked(FILE *); +int fflush_unlocked(FILE *); int fileno_unlocked(FILE *); +int fputs_unlocked(const char * __restrict, FILE * __restrict); +size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict); +size_t fwrite_unlocked(const void * __restrict, size_t, size_t, + FILE * __restrict); #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 @@ -507,10 +512,11 @@ extern int __isthreaded; * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 * B.8.2.7 for the rationale behind the *_unlocked() macros. */ +#define clearerr_unlocked(p) __sclearerr(p) #define feof_unlocked(p) __sfeof(p) #define ferror_unlocked(p) __sferror(p) -#define clearerr_unlocked(p) __sclearerr(p) #define fileno_unlocked(p) __sfileno(p) +#define fputc_unlocked(s, p) __sputc(s, p) #endif #if __POSIX_VISIBLE >= 199506 #define getc_unlocked(fp) __sgetc(fp) Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/Makefile.inc Thu Jan 30 03:31:16 2020 (r357284) @@ -48,13 +48,17 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ ferror.3 clearerr.3 ferror.3 clearerr_unlocked.3 \ ferror.3 feof.3 ferror.3 feof_unlocked.3 \ ferror.3 fileno.3 ferror.3 fileno_unlocked.3 -MLINKS+=fflush.3 fpurge.3 +MLINKS+=fflush.3 fflush_unlocked.3 \ + fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 MLINKS+=fgets.3 gets_s.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 -MLINKS+=fputs.3 puts.3 -MLINKS+=fread.3 fwrite.3 +MLINKS+=fputs.3 fputs_unlocked.3 \ + fputs.3 puts.3 +MLINKS+=fread.3 fread_unlocked.3 \ + fread.3 fwrite.3 \ + fread.3 fwrite_unlocked.3 MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \ fseek.3 ftello.3 fseek.3 rewind.3 MLINKS+=funopen.3 fropen.3 funopen.3 fwopen.3 Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/Symbol.map Thu Jan 30 03:31:16 2020 (r357284) @@ -172,6 +172,10 @@ FBSD_1.5 { }; FBSD_1.6 { + fflush_unlocked; + fputs_unlocked; + fread_unlocked; + fwrite_unlocked; mkostempsat; }; Modified: head/lib/libc/stdio/fflush.3 ============================================================================== --- head/lib/libc/stdio/fflush.3 Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fflush.3 Thu Jan 30 03:31:16 2020 (r357284) @@ -32,11 +32,12 @@ .\" @(#)fflush.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 25, 2017 +.Dd January 23, 2020 .Dt FFLUSH 3 .Os .Sh NAME .Nm fflush , +.Nm fflush_unlocked , .Nm fpurge .Nd flush a stream .Sh LIBRARY @@ -46,6 +47,8 @@ .Ft int .Fn fflush "FILE *stream" .Ft int +.Fn fflush_unlocked "FILE *stream" +.Ft int .Fn fpurge "FILE *stream" .Sh DESCRIPTION The function @@ -63,6 +66,16 @@ argument is flushes .Em all open output streams. +.Pp +The +.Fn fflush_unlocked +function is equivalent to +.Fn fflush , +except that the caller is responsible for locking the stream with +.Xr flockfile 3 +before calling it. +This function may be used to avoid the overhead of locking the stream and to +prevent races when multiple threads are operating on the same stream. .Pp The function .Fn fpurge Modified: head/lib/libc/stdio/fflush.c ============================================================================== --- head/lib/libc/stdio/fflush.c Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fflush.c Thu Jan 30 03:31:16 2020 (r357284) @@ -100,6 +100,8 @@ __fflush(FILE *fp) return (retval); } +__weak_reference(__fflush, fflush_unlocked); + int __sflush(FILE *fp) { Modified: head/lib/libc/stdio/fputc.c ============================================================================== --- head/lib/libc/stdio/fputc.c Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fputc.c Thu Jan 30 03:31:16 2020 (r357284) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include "local.h" #include "libc_private.h" +#undef fputc_unlocked + int fputc(int c, FILE *fp) { Modified: head/lib/libc/stdio/fputs.3 ============================================================================== --- head/lib/libc/stdio/fputs.3 Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fputs.3 Thu Jan 30 03:31:16 2020 (r357284) @@ -32,11 +32,12 @@ .\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 23, 2020 .Dt FPUTS 3 .Os .Sh NAME .Nm fputs , +.Nm fputs_unlocked , .Nm puts .Nd output a line to a stream .Sh LIBRARY @@ -46,6 +47,8 @@ .Ft int .Fn fputs "const char *str" "FILE *stream" .Ft int +.Fn fputs_unlocked "const char *str" "FILE *stream" +.Ft int .Fn puts "const char *str" .Sh DESCRIPTION The function @@ -57,6 +60,16 @@ to the stream pointed to by .\" The terminating .\" .Dv NUL .\" character is not written. +.Pp +The +.Fn fputs_unlocked +function is equivalent to +.Fn fputs , +except that the caller is responsible for locking the stream with +.Xr flockfile 3 +before calling it. +This function may be used to avoid the overhead of locking the stream and to +prevent races when multiple threads are operating on the same stream. .Pp The function .Fn puts Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fputs.c Thu Jan 30 03:31:16 2020 (r357284) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); * Write the given string to the given file. */ int -fputs(const char * __restrict s, FILE * __restrict fp) +fputs_unlocked(const char * __restrict s, FILE * __restrict fp) { int retval; struct __suio uio; @@ -61,11 +61,20 @@ fputs(const char * __restrict s, FILE * __restrict fp) uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE_CANCELSAFE(); if (retval == 0) return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len); + return (retval); +} + +int +fputs(const char * __restrict s, FILE * __restrict fp) +{ + int retval; + + FLOCKFILE_CANCELSAFE(fp); + retval = fputs_unlocked(s, fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: head/lib/libc/stdio/fread.3 ============================================================================== --- head/lib/libc/stdio/fread.3 Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fread.3 Thu Jan 30 03:31:16 2020 (r357284) @@ -32,12 +32,14 @@ .\" @(#)fread.3 8.2 (Berkeley) 3/8/94 .\" $FreeBSD$ .\" -.Dd March 8, 1994 +.Dd January 23, 2020 .Dt FREAD 3 .Os .Sh NAME .Nm fread , -.Nm fwrite +.Nm fread_unlocked , +.Nm fwrite , +.Nm fwrite_unlocked .Nd binary stream input/output .Sh LIBRARY .Lb libc @@ -46,7 +48,11 @@ .Ft size_t .Fn fread "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Ft size_t +.Fn fread_unlocked "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" +.Ft size_t .Fn fwrite "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" +.Ft size_t +.Fn fwrite_unlocked "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Sh DESCRIPTION The function .Fn fread @@ -69,6 +75,21 @@ bytes long, to the stream pointed to by .Fa stream , obtaining them from the location given by .Fa ptr . +.Pp +The +.Fn fread_unlocked +and +.Fn fwrite_unlocked +functions are equivalent to +.Fn fread +and +.Fn fwrite +respectively, except that the caller is responsible for locking the stream +with +.Xr flockfile 3 +before calling them. +These functions may be used to avoid the overhead of locking the stream +and to prevent races when multiple threads are operating on the same stream. .Sh RETURN VALUES The functions .Fn fread Modified: head/lib/libc/stdio/fread.c ============================================================================== --- head/lib/libc/stdio/fread.c Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fread.c Thu Jan 30 03:31:16 2020 (r357284) @@ -115,3 +115,5 @@ __fread(void * __restrict buf, size_t size, size_t cou fp->_p += resid; return (count); } + +__weak_reference(__fread, fread_unlocked); Modified: head/lib/libc/stdio/fwrite.c ============================================================================== --- head/lib/libc/stdio/fwrite.c Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/fwrite.c Thu Jan 30 03:31:16 2020 (r357284) @@ -52,7 +52,8 @@ __FBSDID("$FreeBSD$"); * Return the number of whole objects written. */ size_t -fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) +fwrite_unlocked(const void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp) { size_t n; struct __suio uio; @@ -84,7 +85,6 @@ fwrite(const void * __restrict buf, size_t size, size_ uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* * The usual case is success (__sfvwrite returns 0); @@ -93,6 +93,17 @@ fwrite(const void * __restrict buf, size_t size, size_ */ if (__sfvwrite(fp, &uio) != 0) count = (n - uio.uio_resid) / size; - FUNLOCKFILE_CANCELSAFE(); return (count); +} + +size_t +fwrite(const void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp) +{ + size_t n; + + FLOCKFILE_CANCELSAFE(fp); + n = fwrite_unlocked(buf, size, count, fp); + FUNLOCKFILE_CANCELSAFE(); + return (n); } Modified: head/lib/libc/stdio/putc.3 ============================================================================== --- head/lib/libc/stdio/putc.3 Thu Jan 30 03:01:00 2020 (r357283) +++ head/lib/libc/stdio/putc.3 Thu Jan 30 03:31:16 2020 (r357284) @@ -32,11 +32,12 @@ .\" @(#)putc.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 10, 2003 +.Dd January 23, 2020 .Dt PUTC 3 .Os .Sh NAME .Nm fputc , +.Nm fputc_unlocked , .Nm putc , .Nm putc_unlocked , .Nm putchar , @@ -50,6 +51,8 @@ .Ft int .Fn fputc "int c" "FILE *stream" .Ft int +.Fn fputc_unlocked "int c" "FILE *stream" +.Ft int .Fn putc "int c" "FILE *stream" .Ft int .Fn putc_unlocked "int c" "FILE *stream" @@ -97,11 +100,13 @@ to the named output .Fa stream . .Pp The -.Fn putc_unlocked +.Fn fputc_unlocked , +.Fn putc_unlocked , and .Fn putchar_unlocked functions are equivalent to -.Fn putc +.Fn fputc , +.Fn putc , and .Fn putchar respectively, From owner-svn-src-all@freebsd.org Thu Jan 30 04:59:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D43D22C385; Thu, 30 Jan 2020 04:59:09 +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 487Sn93JD8z4fDm; Thu, 30 Jan 2020 04:59:09 +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 691EC1FBB2; Thu, 30 Jan 2020 04:59:09 +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 00U4x9xR067100; Thu, 30 Jan 2020 04:59:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U4x93x067099; Thu, 30 Jan 2020 04:59:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300459.00U4x93x067099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 04:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357285 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 04:59:09 -0000 Author: mjg Date: Thu Jan 30 04:59:08 2020 New Revision: 357285 URL: https://svnweb.freebsd.org/changeset/base/357285 Log: vfs: assert that doomed vnodes don't need to call vm_object_page_clean ... after the optional inactive processing. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jan 30 03:31:16 2020 (r357284) +++ head/sys/kern/vfs_subr.c Thu Jan 30 04:59:08 2020 (r357285) @@ -3863,6 +3863,7 @@ vgonel(struct vnode *vp) vinactivef(vp); VI_UNLOCK(vp); } + VNPASS(!vn_need_pageq_flush(vp), vp); if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); @@ -4994,7 +4995,7 @@ vn_need_pageq_flush(struct vnode *vp) struct vm_object *obj; int need; - MPASS(mtx_owned(VI_MTX(vp))); + VNPASS(VN_IS_DOOMED(vp) || mtx_owned(VI_MTX(vp)), vp); need = 0; if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && vm_object_mightbedirty(obj)) From owner-svn-src-all@freebsd.org Thu Jan 30 05:37:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE5AE22D210; Thu, 30 Jan 2020 05:37:35 +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 487TdW55pbz3CPN; Thu, 30 Jan 2020 05:37:35 +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 AA53A202E7; Thu, 30 Jan 2020 05:37:35 +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 00U5bZC6091204; Thu, 30 Jan 2020 05:37:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U5bZ3F091203; Thu, 30 Jan 2020 05:37:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300537.00U5bZ3F091203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 05:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357286 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 357286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 05:37:35 -0000 Author: mjg Date: Thu Jan 30 05:37:35 2020 New Revision: 357286 URL: https://svnweb.freebsd.org/changeset/base/357286 Log: ufs: add the missing vn_need_pageq_flush call to ufs_need_inactive Modified: head/sys/ufs/ufs/ufs_inode.c Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Thu Jan 30 04:59:08 2020 (r357285) +++ head/sys/ufs/ufs/ufs_inode.c Thu Jan 30 05:37:35 2020 (r357286) @@ -77,6 +77,8 @@ ufs_need_inactive(ap) ip = VTOI(vp); if (UFS_RDONLY(ip)) return (0); + if (vn_need_pageq_flush(vp)) + return (1); if (ip->i_mode == 0 || ip->i_nlink <= 0 || (ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) || (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | From owner-svn-src-all@freebsd.org Thu Jan 30 08:56:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C11FE231B20; Thu, 30 Jan 2020 08:56: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 487Z2t4hbFz3MVY; Thu, 30 Jan 2020 08:56: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 9C73C22763; Thu, 30 Jan 2020 08:56: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 00U8uMTw009805; Thu, 30 Jan 2020 08:56:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U8uMt4009804; Thu, 30 Jan 2020 08:56:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001300856.00U8uMt4009804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 08:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357287 - in head/sys: fs/nullfs sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/nullfs sys X-SVN-Commit-Revision: 357287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 08:56:22 -0000 Author: mjg Date: Thu Jan 30 08:56:22 2020 New Revision: 357287 URL: https://svnweb.freebsd.org/changeset/base/357287 Log: vfs: remove the never set VDESC_NOMAP_VPP flag Modified: head/sys/fs/nullfs/null_vnops.c head/sys/sys/vnode.h Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jan 30 05:37:35 2020 (r357286) +++ head/sys/fs/nullfs/null_vnops.c Thu Jan 30 08:56:22 2020 (r357287) @@ -310,9 +310,7 @@ null_bypass(struct vop_generic_args *ap) * (Assumes that the lower layer always returns * a VREF'ed vpp unless it gets an error.) */ - if (descp->vdesc_vpp_offset != VDESC_NO_OFFSET && - !(descp->vdesc_flags & VDESC_NOMAP_VPP) && - !error) { + if (descp->vdesc_vpp_offset != VDESC_NO_OFFSET && !error) { /* * XXX - even though some ops have vpp returned vp's, * several ops actually vrele this before returning. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Jan 30 05:37:35 2020 (r357286) +++ head/sys/sys/vnode.h Thu Jan 30 08:56:22 2020 (r357287) @@ -463,7 +463,6 @@ extern struct vattr va_null; /* predefined null vattr #define VDESC_VP1_WILLRELE 0x0002 #define VDESC_VP2_WILLRELE 0x0004 #define VDESC_VP3_WILLRELE 0x0008 -#define VDESC_NOMAP_VPP 0x0100 #define VDESC_VPP_WILLRELE 0x0200 /* From owner-svn-src-all@freebsd.org Thu Jan 30 09:41:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6FD22333EA; Thu, 30 Jan 2020 09:41:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487b3K5rycz3Pp2; Thu, 30 Jan 2020 09:41:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C421523089; Thu, 30 Jan 2020 09:41:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00U9fnIR038000; Thu, 30 Jan 2020 09:41:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U9fm6s037993; Thu, 30 Jan 2020 09:41:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001300941.00U9fm6s037993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Jan 2020 09:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357288 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 357288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 09:41:50 -0000 Author: hselasky Date: Thu Jan 30 09:41:48 2020 New Revision: 357288 URL: https://svnweb.freebsd.org/changeset/base/357288 Log: Widen EPOCH(9) usage in USB WLAN drivers. This patch should unbreak the USB WLAN drivers after r357004. Pointy hat: glebius@ Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_rum.c Thu Jan 30 09:41:48 2020 (r357288) @@ -1168,6 +1168,7 @@ rum_bulk_read_callback(struct usb_xfer *xfer, usb_erro struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame_min *wh; struct ieee80211_node *ni; + struct epoch_tracker et; struct mbuf *m = NULL; struct usb_page_cache *pc; uint32_t flags; @@ -1286,6 +1287,7 @@ tr_setup: else ni = NULL; + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, RT2573_NOISE_FLOOR); @@ -1293,6 +1295,7 @@ tr_setup: } else (void) ieee80211_input_all(ic, m, rssi, RT2573_NOISE_FLOOR); + NET_EPOCH_EXIT(et); } RUM_LOCK(sc); rum_start(sc); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_run.c Thu Jan 30 09:41:48 2020 (r357288) @@ -2811,6 +2811,7 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; struct ieee80211_node *ni; + struct epoch_tracker et; struct rt2870_rxd *rxd; struct rt2860_rxwi *rxwi; uint32_t flags; @@ -2929,12 +2930,14 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin } } + NET_EPOCH_ENTER(et); if (ni != NULL) { (void)ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else { (void)ieee80211_input_all(ic, m, rssi, nf); } + NET_EPOCH_EXIT(et); return; Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_uath.c Thu Jan 30 09:41:48 2020 (r357288) @@ -2705,6 +2705,7 @@ uath_bulk_rx_callback(struct usb_xfer *xfer, usb_error struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; struct ieee80211_node *ni; + struct epoch_tracker et; struct mbuf *m = NULL; struct uath_data *data; struct uath_rx_desc *desc = NULL; @@ -2751,6 +2752,7 @@ setup: ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); nf = -95; /* XXX */ + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, (int)be32toh(desc->rssi), nf); @@ -2759,6 +2761,7 @@ setup: } else (void) ieee80211_input_all(ic, m, (int)be32toh(desc->rssi), nf); + NET_EPOCH_EXIT(et); m = NULL; desc = NULL; } Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_upgt.c Thu Jan 30 09:41:48 2020 (r357288) @@ -2211,6 +2211,7 @@ upgt_bulk_rx_callback(struct usb_xfer *xfer, usb_error struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; struct ieee80211_node *ni; + struct epoch_tracker et; struct mbuf *m = NULL; struct upgt_data *data; int8_t nf; @@ -2248,12 +2249,14 @@ setup: ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); nf = -95; /* XXX */ + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); /* node is no longer needed */ ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); m = NULL; } UPGT_LOCK(sc); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_ural.c Thu Jan 30 09:41:48 2020 (r357288) @@ -851,6 +851,7 @@ ural_bulk_read_callback(struct usb_xfer *xfer, usb_err struct ural_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; + struct epoch_tracker et; struct mbuf *m = NULL; struct usb_page_cache *pc; uint32_t flags; @@ -931,11 +932,13 @@ tr_setup: if (m) { ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); } RAL_LOCK(sc); ural_start(sc); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_urtw.c Thu Jan 30 09:41:48 2020 (r357288) @@ -4042,6 +4042,7 @@ urtw_bulk_rx_callback(struct usb_xfer *xfer, usb_error struct urtw_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; + struct epoch_tracker et; struct mbuf *m = NULL; struct urtw_data *data; int8_t nf = -95; @@ -4085,12 +4086,14 @@ setup: } else ni = NULL; + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); /* node is no longer needed */ ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); m = NULL; } URTW_LOCK(sc); Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jan 30 08:56:22 2020 (r357287) +++ head/sys/dev/usb/wlan/if_zyd.c Thu Jan 30 09:41:48 2020 (r357288) @@ -2223,6 +2223,7 @@ zyd_bulk_read_callback(struct usb_xfer *xfer, usb_erro struct zyd_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; + struct epoch_tracker et; struct zyd_rx_desc desc; struct mbuf *m; struct usb_page_cache *pc; @@ -2278,6 +2279,7 @@ tr_setup: * "ieee80211_input" here, and not some lines up! */ ZYD_UNLOCK(sc); + NET_EPOCH_ENTER(et); for (i = 0; i < sc->sc_rx_count; i++) { rssi = sc->sc_rx_data[i].rssi; m = sc->sc_rx_data[i].m; @@ -2293,6 +2295,7 @@ tr_setup: } else (void)ieee80211_input_all(ic, m, rssi, nf); } + NET_EPOCH_EXIT(et); ZYD_LOCK(sc); zyd_start(sc); break; From owner-svn-src-all@freebsd.org Thu Jan 30 09:56:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D263233973; Thu, 30 Jan 2020 09:56:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487bNm70ZVz3Qb5; Thu, 30 Jan 2020 09:56:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EADD5232D0; Thu, 30 Jan 2020 09:56:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00U9uuFF045191; Thu, 30 Jan 2020 09:56:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U9uuse045190; Thu, 30 Jan 2020 09:56:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001300956.00U9uuse045190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 30 Jan 2020 09:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357289 - stable/12/usr.sbin/periodic/etc/security X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/usr.sbin/periodic/etc/security X-SVN-Commit-Revision: 357289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 09:56:57 -0000 Author: kp Date: Thu Jan 30 09:56:56 2020 New Revision: 357289 URL: https://svnweb.freebsd.org/changeset/base/357289 Log: MFC r356816: Fix pfdenied not returning any results When _a is empty we end up with an invalid invocation of pfctl, and no output. We must add quotes to make it clear to pfctl that we're passing an empty anchor name. PR: 224415 Submitted by: sigsys AT gmail.com Modified: stable/12/usr.sbin/periodic/etc/security/520.pfdenied Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/periodic/etc/security/520.pfdenied ============================================================================== --- stable/12/usr.sbin/periodic/etc/security/520.pfdenied Thu Jan 30 09:41:48 2020 (r357288) +++ stable/12/usr.sbin/periodic/etc/security/520.pfdenied Thu Jan 30 09:56:56 2020 (r357289) @@ -46,7 +46,7 @@ then TMP=`mktemp -t security` for _a in "" $(pfctl -a "blacklistd" -sA 2>/dev/null) do - pfctl -a ${_a} -sr -v -z 2>/dev/null | \ + pfctl -a "${_a}" -sr -v -z 2>/dev/null | \ nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP} done if [ -s ${TMP} ]; then From owner-svn-src-all@freebsd.org Thu Jan 30 09:56:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 047DE23398F; Thu, 30 Jan 2020 09:56:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487bNn6CDcz3Qb8; Thu, 30 Jan 2020 09:56:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEC66232D2; Thu, 30 Jan 2020 09:56:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00U9uv7h045247; Thu, 30 Jan 2020 09:56:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00U9uvTW045246; Thu, 30 Jan 2020 09:56:57 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001300956.00U9uvTW045246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 30 Jan 2020 09:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357290 - stable/11/etc/periodic/security X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/etc/periodic/security X-SVN-Commit-Revision: 357290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 09:56:58 -0000 Author: kp Date: Thu Jan 30 09:56:57 2020 New Revision: 357290 URL: https://svnweb.freebsd.org/changeset/base/357290 Log: MFC r356816: Fix pfdenied not returning any results When _a is empty we end up with an invalid invocation of pfctl, and no output. We must add quotes to make it clear to pfctl that we're passing an empty anchor name. PR: 224415 Submitted by: sigsys AT gmail.com Modified: stable/11/etc/periodic/security/520.pfdenied Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/security/520.pfdenied ============================================================================== --- stable/11/etc/periodic/security/520.pfdenied Thu Jan 30 09:56:56 2020 (r357289) +++ stable/11/etc/periodic/security/520.pfdenied Thu Jan 30 09:56:57 2020 (r357290) @@ -46,7 +46,7 @@ then TMP=`mktemp -t security` for _a in "" $(pfctl -a "blacklistd" -sA 2>/dev/null) do - pfctl -a ${_a} -sr -v -z 2>/dev/null | \ + pfctl -a "${_a}" -sr -v -z 2>/dev/null | \ nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP} done if [ -s ${TMP} ]; then From owner-svn-src-all@freebsd.org Thu Jan 30 10:28:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E926234811; Thu, 30 Jan 2020 10:28:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487c4h4Qt2z3xKj; Thu, 30 Jan 2020 10:28:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9321D2385D; Thu, 30 Jan 2020 10:28:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UAS4pw063146; Thu, 30 Jan 2020 10:28:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UAS1s1063130; Thu, 30 Jan 2020 10:28:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001301028.00UAS1s1063130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Jan 2020 10:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap X-SVN-Commit-Revision: 357291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 10:28:04 -0000 Author: hselasky Date: Thu Jan 30 10:28:01 2020 New Revision: 357291 URL: https://svnweb.freebsd.org/changeset/base/357291 Log: Widen EPOCH(9) usage in PCI WLAN drivers. Make sure all occurrences of ieee80211_input_xxx() in sys/dev are covered by a network epoch section. Do not depend on the interrupt handler nor any taskqueues being in a network epoch section. This patch should unbreak the PCI WLAN drivers after r357004. Pointy hat: glebius@ Sponsored by: Mellanox Technologies Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwm/if_iwm.c head/sys/dev/iwn/if_iwn.c head/sys/dev/malo/if_malo.c head/sys/dev/mwl/if_mwl.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/wi/if_wi.c head/sys/dev/wpi/if_wpi.c head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/bwi/if_bwi.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1506,6 +1506,7 @@ bwi_stop_locked(struct bwi_softc *sc, int statechg) void bwi_intr(void *xsc) { + struct epoch_tracker et; struct bwi_softc *sc = xsc; struct bwi_mac *mac; uint32_t intr_status; @@ -1625,7 +1626,9 @@ bwi_intr(void *xsc) device_printf(sc->sc_dev, "intr noise\n"); if (txrx_intr_status[0] & BWI_TXRX_INTR_RX) { + NET_EPOCH_ENTER(et); rx_data = sc->sc_rxeof(sc); + NET_EPOCH_EXIT(et); if (sc->sc_flags & BWI_F_STOP) { BWI_UNLOCK(sc); return; Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/bwn/if_bwn.c Thu Jan 30 10:28:01 2020 (r357291) @@ -5072,6 +5072,7 @@ bwn_intr(void *arg) static void bwn_intrtask(void *arg, int npending) { + struct epoch_tracker et; struct bwn_mac *mac = arg; struct bwn_softc *sc = mac->mac_sc; uint32_t merged = 0; @@ -5132,6 +5133,7 @@ bwn_intrtask(void *arg, int npending) if (mac->mac_reason_intr & BWN_INTR_NOISESAMPLE_OK) bwn_intr_noise(mac); + NET_EPOCH_ENTER(et); if (mac->mac_flags & BWN_MAC_FLAG_DMA) { if (mac->mac_reason[0] & BWN_DMAINTR_RX_DONE) { bwn_dma_rx(mac->mac_method.dma.rx); @@ -5139,6 +5141,7 @@ bwn_intrtask(void *arg, int npending) } } else rx = bwn_pio_rx(&mac->mac_method.pio.rx); + NET_EPOCH_EXIT(et); KASSERT(!(mac->mac_reason[1] & BWN_DMAINTR_RX_DONE), ("%s", __func__)); KASSERT(!(mac->mac_reason[2] & BWN_DMAINTR_RX_DONE), ("%s", __func__)); Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/ipw/if_ipw.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1159,6 +1159,7 @@ static void ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_status *status, struct ipw_soft_bd *sbd, struct ipw_soft_buf *sbuf) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct mbuf *mnew, *m; struct ieee80211_node *ni; @@ -1230,11 +1231,13 @@ ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_stat IPW_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi - nf, nf); + NET_EPOCH_EXIT(et); IPW_LOCK(sc); bus_dmamap_sync(sc->rbd_dmat, sc->rbd_map, BUS_DMASYNC_PREWRITE); Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/iwi/if_iwi.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1181,6 +1181,7 @@ static void iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i, struct iwi_frame *frame) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct mbuf *mnew, *m; struct ieee80211_node *ni; @@ -1270,11 +1271,13 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_dat IWI_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); + NET_EPOCH_ENTER(et); if (ni != NULL) { type = ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else type = ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); IWI_LOCK(sc); if (sc->sc_softled) { Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 30 10:28:01 2020 (r357291) @@ -3465,6 +3465,7 @@ static bool iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, bool stolen) { + struct epoch_tracker et; struct ieee80211com *ic; struct ieee80211_frame *wh; struct ieee80211_node *ni; @@ -3484,6 +3485,8 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); IWM_UNLOCK(sc); + + NET_EPOCH_ENTER(et); if (ni != NULL) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m); ieee80211_input_mimo(ni, m); @@ -3492,6 +3495,8 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m); ieee80211_input_mimo_all(ic, m); } + NET_EPOCH_EXIT(et); + IWM_LOCK(sc); return true; Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/iwn/if_iwn.c Thu Jan 30 10:28:01 2020 (r357291) @@ -3031,6 +3031,7 @@ static void iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { + struct epoch_tracker et; struct iwn_ops *ops = &sc->ops; struct ieee80211com *ic = &sc->sc_ic; struct iwn_rx_ring *ring = &sc->rxq; @@ -3190,6 +3191,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc * } IWN_UNLOCK(sc); + NET_EPOCH_ENTER(et); /* Send the frame to the 802.11 layer. */ if (ni != NULL) { @@ -3201,6 +3203,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc * } else (void)ieee80211_input_all(ic, m, rssi - nf, nf); + NET_EPOCH_EXIT(et); IWN_LOCK(sc); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/malo/if_malo.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1939,6 +1939,7 @@ malo_set_channel(struct ieee80211com *ic) static void malo_rx_proc(void *arg, int npending) { + struct epoch_tracker et; struct malo_softc *sc = arg; struct ieee80211com *ic = &sc->malo_ic; struct malo_rxbuf *bf; @@ -2071,11 +2072,13 @@ malo_rx_proc(void *arg, int npending) /* dispatch */ ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, ds->nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, ds->nf); + NET_EPOCH_EXIT(et); rx_next: /* NB: ignore ENOMEM so we process more descriptors */ (void) malo_rxbuf_init(sc, bf); Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/mwl/if_mwl.c Thu Jan 30 10:28:01 2020 (r357291) @@ -2608,6 +2608,7 @@ cvtrssi(uint8_t ssi) static void mwl_rx_proc(void *arg, int npending) { + struct epoch_tracker et; struct mwl_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; struct mwl_rxbuf *bf; @@ -2796,6 +2797,8 @@ mwl_rx_proc(void *arg, int npending) /* dispatch */ ni = ieee80211_find_rxnode(ic, (const struct ieee80211_frame_min *) wh); + + NET_EPOCH_ENTER(et); if (ni != NULL) { mn = MWL_NODE(ni); #ifdef MWL_ANT_INFO_SUPPORT @@ -2811,6 +2814,7 @@ mwl_rx_proc(void *arg, int npending) ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); rx_next: /* NB: ignore ENOMEM so we process more descriptors */ (void) mwl_rxbuf_init(sc, bf); Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/ral/rt2560.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1086,6 +1086,7 @@ rt2560_prio_intr(struct rt2560_softc *sc) static void rt2560_decryption_intr(struct rt2560_softc *sc) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct rt2560_rx_desc *desc; struct rt2560_rx_data *data; @@ -1196,12 +1197,13 @@ rt2560_decryption_intr(struct rt2560_softc *sc) wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); - + NET_EPOCH_EXIT(et); RAL_LOCK(sc); sc->sc_flags &= ~RT2560_F_INPUT_RUNNING; skip: desc->flags = htole32(RT2560_RX_BUSY); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/ral/rt2661.c Thu Jan 30 10:28:01 2020 (r357291) @@ -958,6 +958,7 @@ rt2661_tx_dma_intr(struct rt2661_softc *sc, struct rt2 static void rt2661_rx_intr(struct rt2661_softc *sc) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct rt2661_rx_desc *desc; struct rt2661_rx_data *data; @@ -1074,11 +1075,13 @@ rt2661_rx_intr(struct rt2661_softc *sc) /* send the frame to the 802.11 layer */ ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); RAL_LOCK(sc); sc->sc_flags &= ~RAL_INPUT_RUNNING; Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/ral/rt2860.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1179,6 +1179,7 @@ rt2860_maxrssi_chain(struct rt2860_softc *sc, const st static void rt2860_rx_intr(struct rt2860_softc *sc) { + struct epoch_tracker et; struct rt2860_rx_radiotap_header *tap; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; @@ -1326,11 +1327,13 @@ rt2860_rx_intr(struct rt2860_softc *sc) /* send the frame to the 802.11 layer */ ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + NET_EPOCH_ENTER(et); if (ni != NULL) { (void)ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else (void)ieee80211_input_all(ic, m, rssi - nf, nf); + NET_EPOCH_EXIT(et); RAL_LOCK(sc); Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Thu Jan 30 10:28:01 2020 (r357291) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -85,6 +86,7 @@ rtwn_pci_setup_rx_desc(struct rtwn_pci_softc *pc, static void rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) { + struct epoch_tracker et; struct rtwn_softc *sc = &pc->pc_sc; struct rtwn_rx_ring *ring = &pc->rx_ring; struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; @@ -164,12 +166,15 @@ rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) /* Send the frame to the 802.11 layer. */ RTWN_UNLOCK(sc); + + NET_EPOCH_ENTER(et); if (ni != NULL) { (void)ieee80211_input_mimo(ni, m); /* Node is no longer needed. */ ieee80211_free_node(ni); } else (void)ieee80211_input_mimo_all(ic, m); + NET_EPOCH_EXIT(et); RTWN_LOCK(sc); Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/wi/if_wi.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1254,6 +1254,7 @@ wi_sync_bssid(struct wi_softc *sc, u_int8_t new_bssid[ static __noinline void wi_rx_intr(struct wi_softc *sc) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct wi_frame frmhdr; struct mbuf *m; @@ -1349,11 +1350,14 @@ wi_rx_intr(struct wi_softc *sc) WI_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); + + NET_EPOCH_ENTER(et); if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); ieee80211_free_node(ni); } else (void) ieee80211_input_all(ic, m, rssi, nf); + NET_EPOCH_EXIT(et); WI_LOCK(sc); } Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/wpi/if_wpi.c Thu Jan 30 10:28:01 2020 (r357291) @@ -1909,6 +1909,7 @@ static void wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc, struct wpi_rx_data *data) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct wpi_rx_ring *ring = &sc->rxq; struct wpi_rx_stat *stat; @@ -2028,6 +2029,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc * } WPI_UNLOCK(sc); + NET_EPOCH_ENTER(et); /* Send the frame to the 802.11 layer. */ if (ni != NULL) { @@ -2037,6 +2039,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc * } else (void)ieee80211_input_all(ic, m, stat->rssi, WPI_RSSI_OFFSET); + NET_EPOCH_EXIT(et); WPI_LOCK(sc); return; Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Thu Jan 30 09:56:57 2020 (r357290) +++ head/sys/dev/wtap/if_wtap.c Thu Jan 30 10:28:01 2020 (r357291) @@ -451,6 +451,7 @@ wtap_inject(struct wtap_softc *sc, struct mbuf *m) void wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) { + struct epoch_tracker et; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; int type; @@ -472,6 +473,7 @@ wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) */ ni = ieee80211_find_rxnode_withkey(ic, mtod(m, const struct ieee80211_frame_min *),IEEE80211_KEYIX_NONE); + NET_EPOCH_ENTER(et); if (ni != NULL) { /* * Sending station is known, dispatch directly. @@ -481,11 +483,13 @@ wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) } else { type = ieee80211_input_all(ic, m, 1<<7, 10); } + NET_EPOCH_EXIT(et); } static void wtap_rx_proc(void *arg, int npending) { + struct epoch_tracker et; struct wtap_softc *sc = (struct wtap_softc *)arg; struct ieee80211com *ic = &sc->sc_ic; struct mbuf *m; @@ -526,6 +530,7 @@ wtap_rx_proc(void *arg, int npending) ni = ieee80211_find_rxnode_withkey(ic, mtod(m, const struct ieee80211_frame_min *), IEEE80211_KEYIX_NONE); + NET_EPOCH_ENTER(et); if (ni != NULL) { /* * Sending station is known, dispatch directly. @@ -535,7 +540,8 @@ wtap_rx_proc(void *arg, int npending) } else { type = ieee80211_input_all(ic, m, 1<<7, 10); } - + NET_EPOCH_EXIT(et); + /* The mbufs are freed by the Net80211 stack */ free(bf, M_WTAP_RXBUF); } From owner-svn-src-all@freebsd.org Thu Jan 30 10:40:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77137234BAC; Thu, 30 Jan 2020 10:40:39 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487cMC2KR3z3xrD; Thu, 30 Jan 2020 10:40:39 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B26D23A5B; Thu, 30 Jan 2020 10:40:39 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UAedOI068942; Thu, 30 Jan 2020 10:40:39 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UAeddV068941; Thu, 30 Jan 2020 10:40:39 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202001301040.00UAeddV068941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 30 Jan 2020 10:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357292 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 357292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 10:40:39 -0000 Author: philip Date: Thu Jan 30 10:40:38 2020 New Revision: 357292 URL: https://svnweb.freebsd.org/changeset/base/357292 Log: acpi_ibm: add support for ThinkPad PrivacyGuard ThinkPad PrivacyGuard is a built-in toggleable privacy filter that restricts viewing angles when on. It is an available on some new ThinkPad models such as the X1 Carbon 7th gen (as an optional HW upgrade). The privacy filter can be enabled/disabled via an ACPI call. This commit adds a sysctl under dev.acpi_ibm that allows for getting and setting the PrivacyGuard state. Submitted by: Kamila Součková Reviewed By: cem, philip MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23370 Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Thu Jan 30 10:28:01 2020 (r357291) +++ head/sys/dev/acpi_support/acpi_ibm.c Thu Jan 30 10:40:38 2020 (r357292) @@ -75,6 +75,7 @@ ACPI_MODULE_NAME("IBM") #define ACPI_IBM_METHOD_THERMAL 13 #define ACPI_IBM_METHOD_HANDLEREVENTS 14 #define ACPI_IBM_METHOD_MIC_LED 15 +#define ACPI_IBM_METHOD_PRIVACYGUARD 16 /* Hotkeys/Buttons */ #define IBM_RTC_HOTKEY1 0x64 @@ -123,6 +124,8 @@ ACPI_MODULE_NAME("IBM") #define IBM_NAME_MASK_WLAN (1 << 2) #define IBM_NAME_THERMAL_GET "TMP7" #define IBM_NAME_THERMAL_UPDT "UPDT" +#define IBM_NAME_PRIVACYGUARD_GET "GSSS" +#define IBM_NAME_PRIVACYGUARD_SET "SSSS" #define IBM_NAME_EVENTS_STATUS_GET "DHKC" #define IBM_NAME_EVENTS_MASK_GET "DHKN" @@ -146,6 +149,10 @@ ACPI_MODULE_NAME("IBM") #define IBM_EVENT_MUTE 0x17 #define IBM_EVENT_ACCESS_IBM_BUTTON 0x18 +/* Device-specific register flags */ +#define IBM_FLAG_PRIVACYGUARD_DEVICE_PRESENT 0x10000 +#define IBM_FLAG_PRIVACYGUARD_ON 0x1 + #define ABS(x) (((x) < 0)? -(x) : (x)) struct acpi_ibm_softc { @@ -268,6 +275,11 @@ static struct { .method = ACPI_IBM_METHOD_MIC_LED, .description = "Mic led", }, + { + .name = "privacyguard", + .method = ACPI_IBM_METHOD_PRIVACYGUARD, + .description = "PrivacyGuard enable", + }, { NULL, 0, NULL, 0 } }; @@ -327,7 +339,12 @@ static int acpi_ibm_bluetooth_set(struct acpi_ibm_soft static int acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int arg); static int acpi_ibm_volume_set(struct acpi_ibm_softc *sc, int arg); static int acpi_ibm_mute_set(struct acpi_ibm_softc *sc, int arg); +static int acpi_ibm_privacyguard_get(struct acpi_ibm_softc *sc); +static ACPI_STATUS acpi_ibm_privacyguard_set(struct acpi_ibm_softc *sc, int arg); +static ACPI_STATUS acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg); +static int acpi_status_to_errno(ACPI_STATUS status); + static device_method_t acpi_ibm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_ibm_probe), @@ -351,6 +368,19 @@ DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ib MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); static char *ibm_ids[] = {"IBM0068", "LEN0068", "LEN0268", NULL}; +static int +acpi_status_to_errno(ACPI_STATUS status) +{ + switch (status) { + case AE_OK: + return (0); + case AE_BAD_PARAMETER: + return (EINVAL); + default: + return (ENODEV); + } +} + static void ibm_led(void *softc, int onoff) { @@ -821,6 +851,11 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met else val = -1; break; + + case ACPI_IBM_METHOD_PRIVACYGUARD: + val = acpi_ibm_privacyguard_get(sc); + break; + } return (val); @@ -877,6 +912,10 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int met return acpi_ibm_bluetooth_set(sc, arg); break; + case ACPI_IBM_METHOD_PRIVACYGUARD: + return (acpi_status_to_errno(acpi_ibm_privacyguard_set(sc, arg))); + break; + case ACPI_IBM_METHOD_FANLEVEL: if (arg < 0 || arg > 7) return (EINVAL); @@ -1008,6 +1047,10 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me case ACPI_IBM_METHOD_HANDLEREVENTS: return (TRUE); + + case ACPI_IBM_METHOD_PRIVACYGUARD: + return (acpi_ibm_privacyguard_get(sc) != -1); + } return (FALSE); } @@ -1223,6 +1266,60 @@ acpi_ibm_thinklight_set(struct acpi_ibm_softc *sc, int } return (0); +} + +/* + * Helper function to make a get or set ACPI call to the PrivacyGuard handle. + * Only meant to be used internally by the get/set functions below. + */ +static ACPI_STATUS +acpi_ibm_privacyguard_acpi_call(struct acpi_ibm_softc *sc, bool write, int *arg) { + ACPI_OBJECT Arg; + ACPI_OBJECT_LIST Args; + ACPI_STATUS status; + ACPI_OBJECT out_obj; + ACPI_BUFFER result; + + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = (write ? *arg : 0); + Args.Count = 1; + Args.Pointer = &Arg; + result.Length = sizeof(out_obj); + result.Pointer = &out_obj; + + status = AcpiEvaluateObject(sc->handle, + (write ? IBM_NAME_PRIVACYGUARD_SET : IBM_NAME_PRIVACYGUARD_GET), + &Args, &result); + if (ACPI_SUCCESS(status) && !write) + *arg = out_obj.Integer.Value; + + return (status); +} + +/* + * Returns -1 if the device is not present. + */ +static int +acpi_ibm_privacyguard_get(struct acpi_ibm_softc *sc) +{ + ACPI_STATUS status; + int val; + + status = acpi_ibm_privacyguard_acpi_call(sc, false, &val); + if (ACPI_SUCCESS(status) && + (val & IBM_FLAG_PRIVACYGUARD_DEVICE_PRESENT)) + return (val & IBM_FLAG_PRIVACYGUARD_ON); + + return (-1); +} + +static ACPI_STATUS +acpi_ibm_privacyguard_set(struct acpi_ibm_softc *sc, int arg) +{ + if (arg < 0 || arg > 1) + return (AE_BAD_PARAMETER); + + return (acpi_ibm_privacyguard_acpi_call(sc, true, &arg)); } static int From owner-svn-src-all@freebsd.org Thu Jan 30 12:04:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 752BC237225; Thu, 30 Jan 2020 12:04:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487fCR2RW6z42YQ; Thu, 30 Jan 2020 12:04:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EFB224B0D; Thu, 30 Jan 2020 12:04:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UC43CT022060; Thu, 30 Jan 2020 12:04:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UC43Rw022059; Thu, 30 Jan 2020 12:04:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001301204.00UC43Rw022059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Jan 2020 12:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357293 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 12:04:03 -0000 Author: hselasky Date: Thu Jan 30 12:04:02 2020 New Revision: 357293 URL: https://svnweb.freebsd.org/changeset/base/357293 Log: Widen EPOCH(9) usage in netisr. Software interrupt handlers are allowed to sleep. In swi_net() there is a read lock behind NETISR_RLOCK() which in turn ends up calling msleep() which means the whole of swi_net() cannot be protected by an EPOCH(9) section. By default the NETISR_LOCKING feature is disabled. This issue was introduced by r357004. This is a preparation step for replacing the functionality provided by r357004. Found by: kib@ Sponsored by: Mellanox Technologies Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Thu Jan 30 10:40:38 2020 (r357292) +++ head/sys/net/netisr.c Thu Jan 30 12:04:02 2020 (r357293) @@ -920,6 +920,7 @@ netisr_process_workstream_proto(struct netisr_workstre static void swi_net(void *arg) { + struct epoch_tracker et; #ifdef NETISR_LOCKING struct rm_priotracker tracker; #endif @@ -931,7 +932,9 @@ swi_net(void *arg) #ifdef DEVICE_POLLING KASSERT(nws_count == 1, ("%s: device_polling but nws_count != 1", __func__)); + NET_EPOCH_ENTER(et); netisr_poll(); + NET_EPOCH_EXIT(et); #endif #ifdef NETISR_LOCKING NETISR_RLOCK(&tracker); @@ -940,6 +943,7 @@ swi_net(void *arg) KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running")); if (nwsp->nws_flags & NWS_DISPATCHING) goto out; + NET_EPOCH_ENTER(et); nwsp->nws_flags |= NWS_RUNNING; nwsp->nws_flags &= ~NWS_SCHEDULED; while ((bits = nwsp->nws_pendingbits) != 0) { @@ -950,6 +954,7 @@ swi_net(void *arg) } } nwsp->nws_flags &= ~NWS_RUNNING; + NET_EPOCH_EXIT(et); out: NWS_UNLOCK(nwsp); #ifdef NETISR_LOCKING From owner-svn-src-all@freebsd.org Thu Jan 30 12:35:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B760A237E78; Thu, 30 Jan 2020 12:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487fvQ4Tb4z43n1; Thu, 30 Jan 2020 12:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94D752507F; Thu, 30 Jan 2020 12:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UCZEQt039459; Thu, 30 Jan 2020 12:35:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UCZDsY039455; Thu, 30 Jan 2020 12:35:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001301235.00UCZDsY039455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Jan 2020 12:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357294 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 357294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 12:35:14 -0000 Author: hselasky Date: Thu Jan 30 12:35:13 2020 New Revision: 357294 URL: https://svnweb.freebsd.org/changeset/base/357294 Log: Widen EPOCH(9) usage in mlx5en(4). Make completion event path mostly lockless using EPOCH(9). Implement a mechanism using EPOCH(9) which allows us to make the callback path for completion events mostly lockless. Simplify draining callback events using epoch_wait(). While at it make sure all receive completion callbacks are covered by the network EPOCH(9), because this is required when calling if_input() and ether_input() after r357012. Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/cq.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/cq.h ============================================================================== --- head/sys/dev/mlx5/cq.h Thu Jan 30 12:04:02 2020 (r357293) +++ head/sys/dev/mlx5/cq.h Thu Jan 30 12:35:13 2020 (r357294) @@ -38,8 +38,6 @@ struct mlx5_core_cq { int cqe_sz; __be32 *set_ci_db; __be32 *arm_db; - atomic_t refcount; - struct completion free; unsigned vector; int irqn; void (*comp) (struct mlx5_core_cq *); Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Jan 30 12:04:02 2020 (r357293) +++ head/sys/dev/mlx5/driver.h Thu Jan 30 12:35:13 2020 (r357294) @@ -514,21 +514,17 @@ struct mlx5_core_health { struct workqueue_struct *wq_cmd; }; -#ifdef RATELIMIT -#define MLX5_CQ_LINEAR_ARRAY_SIZE (128 * 1024) -#else #define MLX5_CQ_LINEAR_ARRAY_SIZE 1024 -#endif struct mlx5_cq_linear_array_entry { - spinlock_t lock; struct mlx5_core_cq * volatile cq; }; struct mlx5_cq_table { /* protect radix tree */ - spinlock_t lock; + spinlock_t writerlock; + atomic_t writercount; struct radix_tree_root tree; struct mlx5_cq_linear_array_entry linear_array[MLX5_CQ_LINEAR_ARRAY_SIZE]; }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Jan 30 12:04:02 2020 (r357293) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Jan 30 12:35:13 2020 (r357294) @@ -33,72 +33,91 @@ #include #include "mlx5_core.h" +#include + +static void +mlx5_cq_table_write_lock(struct mlx5_cq_table *table) +{ + + atomic_inc(&table->writercount); + /* make sure all see the updated writercount */ + NET_EPOCH_WAIT(); + spin_lock(&table->writerlock); +} + +static void +mlx5_cq_table_write_unlock(struct mlx5_cq_table *table) +{ + + spin_unlock(&table->writerlock); + atomic_dec(&table->writercount); + /* drain all pending CQ callers */ + NET_EPOCH_WAIT(); +} + void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 cqn) { - struct mlx5_core_cq *cq; struct mlx5_cq_table *table = &dev->priv.cq_table; + struct mlx5_core_cq *cq; + struct epoch_tracker et; + bool do_lock; - if (cqn < MLX5_CQ_LINEAR_ARRAY_SIZE) { - struct mlx5_cq_linear_array_entry *entry; + NET_EPOCH_ENTER(et); - entry = &table->linear_array[cqn]; - spin_lock(&entry->lock); - cq = entry->cq; - if (cq == NULL) { - mlx5_core_warn(dev, - "Completion event for bogus CQ 0x%x\n", cqn); - } else { - ++cq->arm_sn; - cq->comp(cq); - } - spin_unlock(&entry->lock); - return; - } + do_lock = atomic_read(&table->writercount) != 0; + if (unlikely(do_lock)) + spin_lock(&table->writerlock); - spin_lock(&table->lock); - cq = radix_tree_lookup(&table->tree, cqn); - if (likely(cq)) - atomic_inc(&cq->refcount); - spin_unlock(&table->lock); + if (likely(cqn < MLX5_CQ_LINEAR_ARRAY_SIZE)) + cq = table->linear_array[cqn].cq; + else + cq = radix_tree_lookup(&table->tree, cqn); - if (!cq) { - mlx5_core_warn(dev, "Completion event for bogus CQ 0x%x\n", cqn); - return; + if (unlikely(do_lock)) + spin_unlock(&table->writerlock); + + if (likely(cq != NULL)) { + ++cq->arm_sn; + cq->comp(cq); + } else { + mlx5_core_warn(dev, + "Completion event for bogus CQ 0x%x\n", cqn); } - ++cq->arm_sn; - - cq->comp(cq); - - if (atomic_dec_and_test(&cq->refcount)) - complete(&cq->free); + NET_EPOCH_EXIT(et); } void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type) { struct mlx5_cq_table *table = &dev->priv.cq_table; struct mlx5_core_cq *cq; + struct epoch_tracker et; + bool do_lock; - spin_lock(&table->lock); + NET_EPOCH_ENTER(et); - cq = radix_tree_lookup(&table->tree, cqn); - if (cq) - atomic_inc(&cq->refcount); + do_lock = atomic_read(&table->writercount) != 0; + if (unlikely(do_lock)) + spin_lock(&table->writerlock); - spin_unlock(&table->lock); + if (likely(cqn < MLX5_CQ_LINEAR_ARRAY_SIZE)) + cq = table->linear_array[cqn].cq; + else + cq = radix_tree_lookup(&table->tree, cqn); - if (!cq) { - mlx5_core_warn(dev, "Async event for bogus CQ 0x%x\n", cqn); - return; + if (unlikely(do_lock)) + spin_unlock(&table->writerlock); + + if (likely(cq != NULL)) { + cq->event(cq, event_type); + } else { + mlx5_core_warn(dev, + "Asynchronous event for bogus CQ 0x%x\n", cqn); } - cq->event(cq, event_type); - - if (atomic_dec_and_test(&cq->refcount)) - complete(&cq->free); + NET_EPOCH_EXIT(et); } - int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u32 *in, int inlen) { @@ -116,24 +135,16 @@ int mlx5_core_create_cq(struct mlx5_core_dev *dev, str cq->cqn = MLX5_GET(create_cq_out, out, cqn); cq->cons_index = 0; cq->arm_sn = 0; - atomic_set(&cq->refcount, 1); - init_completion(&cq->free); - spin_lock_irq(&table->lock); + mlx5_cq_table_write_lock(table); err = radix_tree_insert(&table->tree, cq->cqn, cq); - spin_unlock_irq(&table->lock); + if (likely(err == 0 && cq->cqn < MLX5_CQ_LINEAR_ARRAY_SIZE)) + table->linear_array[cq->cqn].cq = cq; + mlx5_cq_table_write_unlock(table); + if (err) goto err_cmd; - if (cq->cqn < MLX5_CQ_LINEAR_ARRAY_SIZE) { - struct mlx5_cq_linear_array_entry *entry; - - entry = &table->linear_array[cq->cqn]; - spin_lock_irq(&entry->lock); - entry->cq = cq; - spin_unlock_irq(&entry->lock); - } - cq->pid = curthread->td_proc->p_pid; return 0; @@ -152,44 +163,24 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, st u32 out[MLX5_ST_SZ_DW(destroy_cq_out)] = {0}; u32 in[MLX5_ST_SZ_DW(destroy_cq_in)] = {0}; struct mlx5_core_cq *tmp; - int err; - if (cq->cqn < MLX5_CQ_LINEAR_ARRAY_SIZE) { - struct mlx5_cq_linear_array_entry *entry; - - entry = &table->linear_array[cq->cqn]; - spin_lock_irq(&entry->lock); - entry->cq = NULL; - spin_unlock_irq(&entry->lock); - } - - spin_lock_irq(&table->lock); + mlx5_cq_table_write_lock(table); + if (likely(cq->cqn < MLX5_CQ_LINEAR_ARRAY_SIZE)) + table->linear_array[cq->cqn].cq = NULL; tmp = radix_tree_delete(&table->tree, cq->cqn); - spin_unlock_irq(&table->lock); - if (!tmp) { + mlx5_cq_table_write_unlock(table); + + if (unlikely(tmp == NULL)) { mlx5_core_warn(dev, "cq 0x%x not found in tree\n", cq->cqn); return -EINVAL; - } - if (tmp != cq) { - mlx5_core_warn(dev, "corruption on srqn 0x%x\n", cq->cqn); + } else if (unlikely(tmp != cq)) { + mlx5_core_warn(dev, "corrupted cqn 0x%x\n", cq->cqn); return -EINVAL; } MLX5_SET(destroy_cq_in, in, opcode, MLX5_CMD_OP_DESTROY_CQ); MLX5_SET(destroy_cq_in, in, cqn, cq->cqn); - err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); - if (err) - goto out; - - synchronize_irq(cq->irqn); - - if (atomic_dec_and_test(&cq->refcount)) - complete(&cq->free); - wait_for_completion(&cq->free); - -out: - - return err; + return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); } EXPORT_SYMBOL(mlx5_core_destroy_cq); @@ -259,17 +250,12 @@ int mlx5_core_modify_cq_moderation_mode(struct mlx5_co int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; - int err; - int x; memset(table, 0, sizeof(*table)); - spin_lock_init(&table->lock); - for (x = 0; x != MLX5_CQ_LINEAR_ARRAY_SIZE; x++) - spin_lock_init(&table->linear_array[x].lock); + spin_lock_init(&table->writerlock); INIT_RADIX_TREE(&table->tree, GFP_ATOMIC); - err = 0; - return err; + return 0; } void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Jan 30 12:04:02 2020 (r357293) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Jan 30 12:35:13 2020 (r357294) @@ -2182,6 +2182,7 @@ mlx5e_open_channel(struct mlx5e_priv *priv, struct mlx5e_channel_param *cparam, struct mlx5e_channel *c) { + struct epoch_tracker et; int i, err; /* zero non-persistant data */ @@ -2209,7 +2210,9 @@ mlx5e_open_channel(struct mlx5e_priv *priv, goto err_close_sqs; /* poll receive queue initially */ + NET_EPOCH_ENTER(et); c->rq.cq.mcq.comp(&c->rq.cq.mcq); + NET_EPOCH_EXIT(et); return (0); @@ -3746,6 +3749,7 @@ static void mlx5e_disable_rx_dma(struct mlx5e_channel *ch) { struct mlx5e_rq *rq = &ch->rq; + struct epoch_tracker et; int err; mtx_lock(&rq->mtx); @@ -3761,7 +3765,9 @@ mlx5e_disable_rx_dma(struct mlx5e_channel *ch) while (!mlx5_wq_ll_is_empty(&rq->wq)) { msleep(1); + NET_EPOCH_ENTER(et); rq->cq.mcq.comp(&rq->cq.mcq); + NET_EPOCH_EXIT(et); } /* @@ -3779,6 +3785,7 @@ static void mlx5e_enable_rx_dma(struct mlx5e_channel *ch) { struct mlx5e_rq *rq = &ch->rq; + struct epoch_tracker et; int err; rq->wq.wqe_ctr = 0; @@ -3791,7 +3798,9 @@ mlx5e_enable_rx_dma(struct mlx5e_channel *ch) rq->enabled = 1; + NET_EPOCH_ENTER(et); rq->cq.mcq.comp(&rq->cq.mcq); + NET_EPOCH_EXIT(et); } void From owner-svn-src-all@freebsd.org Thu Jan 30 14:01:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76A6423A92D; Thu, 30 Jan 2020 14:01:53 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.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 487hqN2fl8z48nL; Thu, 30 Jan 2020 14:01:52 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f67.google.com with SMTP id g15so3211730otp.3; Thu, 30 Jan 2020 06:01:52 -0800 (PST) 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=ZDDGpLUGkGchmXVEn3cTcCcH5iTKNtuxsJGg5/vG/N0=; b=MFeXI8MAWV30wxeGmE6q137X1kEjOMFFUsQm8k6Hu38PC7RNqUE+orou6AyKpkF2lB WJ8JCvAiYzpjKa8uY7RFFPFyWKS3CFvwUdH4HO2iN3z0gx0C4ZXy4G7vA9fLU81ORm7H FjDX61ATqGqcqF2XsUVXt9nsP1JDN5nUPMOiI40Gu6PT+yx1P/LNk9rpuKT2vfqBy/lh zEUcQbJIWJBKqaBnZH+xiGE9bDIXy3R9tw9Uuyt+4ojzdEsOTuaRLA6AG3ArrIIfyZmv X2yEZwsFDoddENSoixHP/FYyiDJcVjCqjJrAzS5WRGINFMyVUI4IiHDX45yGDfOuphfQ keoQ== X-Gm-Message-State: APjAAAXDFmTg4I3gQZNTNOvz/KwETXcB14HGsM9f5o4c9IpSxy06M7W4 lwbaYVW6C16eEo3yqHjUY0NmDPp7JE1KA0jx0sE8jQ== X-Google-Smtp-Source: APXvYqxEY9CBbfdHHFStdczYzM/QFAfqzcqoJwyzk22sXGJ/tLDujdXvMzvH8MOouPcuvd+Oec3+MN6X1aL/X67YvP8= X-Received: by 2002:a9d:6301:: with SMTP id q1mr3471994otk.70.1580392908291; Thu, 30 Jan 2020 06:01:48 -0800 (PST) MIME-Version: 1.0 References: <202001281357.00SDvPZC055856@repo.freebsd.org> <20200128185508.GZ1268@FreeBSD.org> In-Reply-To: <20200128185508.GZ1268@FreeBSD.org> From: Edward Napierala Date: Thu, 30 Jan 2020 14:01:37 +0000 Message-ID: Subject: Re: svn commit: r357203 - head/sys/compat/linux To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 487hqN2fl8z48nL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 209.85.210.67 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-3.05 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; 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]; RWL_MAILSPIKE_GOOD(0.00)[67.210.85.209.rep.mailspike.net : 127.0.0.18]; IP_SCORE(-1.05)[ip: (-0.37), ipnet: 209.85.128.0/17(-3.05), asn: 15169(-1.78), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[67.210.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@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)[trasz@freebsd.org,etnapierala@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 14:01:53 -0000 On Tue, 28 Jan 2020 at 18:55, Gleb Smirnoff wrote: > > On Tue, Jan 28, 2020 at 01:57:25PM +0000, Edward Tomasz Napierala wrote: > E> Author: trasz > E> Date: Tue Jan 28 13:57:24 2020 > E> New Revision: 357203 > E> URL: https://svnweb.freebsd.org/changeset/base/357203 > E> > E> Log: > E> Add TCP_CORK support to linux(4). This fixes one of the things Nginx > E> trips over. > E> > E> MFC after: 2 weeks > E> Sponsored by: The FreeBSD Foundation > E> Differential Revision: https://reviews.freebsd.org/D23171 > > Again, out of curiosity: what is any good reason to run linux nginx > binary on FreeBSD? To lose all the nice features of FreeBSD kernel > that nginx supports? Docker, obviously. Seriously though - Nginx, or whatever other application you can see in my commit messages, is not the goal itself; it's more of a test case, so I can easily reproduce/retest it in the future, should I need to. The goal is fixing TCP_CORK, for whatever Linux app that needs it. From owner-svn-src-all@freebsd.org Thu Jan 30 15:00:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF5F423BDC7; Thu, 30 Jan 2020 15:00:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487k7F5fYJz4CsS; Thu, 30 Jan 2020 15:00:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD41A26A83; Thu, 30 Jan 2020 15:00:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UF0fXH027929; Thu, 30 Jan 2020 15:00:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UF0f7t027928; Thu, 30 Jan 2020 15:00:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001301500.00UF0f7t027928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 Jan 2020 15:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357295 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 357295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 15:00:41 -0000 Author: markj Date: Thu Jan 30 15:00:41 2020 New Revision: 357295 URL: https://svnweb.freebsd.org/changeset/base/357295 Log: MFC r357048: arm64: Don't enable interrupts in init_secondary(). Modified: stable/12/sys/arm64/arm64/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/mp_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/mp_machdep.c Thu Jan 30 12:35:13 2020 (r357294) +++ stable/12/sys/arm64/arm64/mp_machdep.c Thu Jan 30 15:00:41 2020 (r357295) @@ -306,18 +306,12 @@ init_secondary(uint64_t cpu) dbg_init(); pan_enable(); - /* Enable interrupts */ - intr_enable(); - mtx_lock_spin(&ap_boot_mtx); - atomic_add_rel_32(&smp_cpus, 1); - if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); } - mtx_unlock_spin(&ap_boot_mtx); /* Enter the scheduler */ From owner-svn-src-all@freebsd.org Thu Jan 30 16:11:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABFBC23D668; Thu, 30 Jan 2020 16:11:22 +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 487lhp4hxyz4HrN; Thu, 30 Jan 2020 16:11:22 +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 9BF4727794; Thu, 30 Jan 2020 16:11:22 +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 00UGBMj6067598; Thu, 30 Jan 2020 16:11:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UGBJWp067583; Thu, 30 Jan 2020 16:11:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001301611.00UGBJWp067583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 30 Jan 2020 16:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357296 - in stable/12: cddl/lib/libdtrace contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/llvm-project/libcxx/include contrib/openbsm/libbsm contrib/openbs... X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: cddl/lib/libdtrace contrib/libxo/tests/gettext contrib/libxo/tests/gettext/po/pig_latin contrib/llvm-project/libcxx/include contrib/openbsm/libbsm contrib/openbsm/sys/bsm lib/libc/gen li... X-SVN-Commit-Revision: 357296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 16:11:22 -0000 Author: mav Date: Thu Jan 30 16:11:19 2020 New Revision: 357296 URL: https://svnweb.freebsd.org/changeset/base/357296 Log: MFC r343111,343113-343115 (by mckusick): Create new EINTEGRITY error with message "Integrity check failed". An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Approved by: mckusick Modified: stable/12/cddl/lib/libdtrace/errno.d stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po stable/12/contrib/libxo/tests/gettext/strerror.pot stable/12/contrib/llvm-project/libcxx/include/__errc stable/12/contrib/llvm-project/libcxx/include/errno.h stable/12/contrib/openbsm/libbsm/bsm_errno.c stable/12/contrib/openbsm/sys/bsm/audit_errno.h stable/12/lib/libc/gen/errlst.c stable/12/lib/libc/nls/C.msg stable/12/lib/libc/sys/intro.2 stable/12/stand/liblua/lerrno.c stable/12/sys/bsm/audit_errno.h stable/12/sys/compat/cloudabi/cloudabi_errno.c stable/12/sys/compat/linux/linux_errno.inc stable/12/sys/security/audit/bsm_errno.c stable/12/sys/sys/errno.h Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/lib/libdtrace/errno.d ============================================================================== --- stable/12/cddl/lib/libdtrace/errno.d Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/cddl/lib/libdtrace/errno.d Thu Jan 30 16:11:19 2020 (r357296) @@ -225,7 +225,9 @@ inline int ENOTRECOVERABLE = 95; #pragma D binding "1.13" ENOTRECOVERABLE inline int EOWNERDEAD = 96; #pragma D binding "1.13" EOWNERDEAD -inline int ELAST = 96; +inline int EINTEGRITY = 96; +#pragma D binding "1.13" EINTEGRITY +inline int ELAST = 97; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -340,6 +342,7 @@ inline string strerror[int errno] = errno == ECAPMODE ? "Not permitted in capability mode" : errno == ENOTRECOVERABLE ? "State not recoverable" : errno == EOWNERDEAD ? "Previous owner died" : + errno == EINTEGRITY ? "Integrity check failed" : errno == ERESTART ? "restart syscall" : errno == EJUSTRETURN ? "don't modify regs, just return" : errno == ENOIOCTL ? "ioctl not handled by this layer" : Modified: stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po ============================================================================== --- stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/libxo/tests/gettext/po/pig_latin/strerror.po Thu Jan 30 16:11:19 2020 (r357296) @@ -457,3 +457,7 @@ msgstr "Atestay otnay ecoverableray" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "Eviouspray ownerway iedday" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "integrityyay eckchay ailedfay" Modified: stable/12/contrib/libxo/tests/gettext/strerror.pot ============================================================================== --- stable/12/contrib/libxo/tests/gettext/strerror.pot Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/libxo/tests/gettext/strerror.pot Thu Jan 30 16:11:19 2020 (r357296) @@ -466,3 +466,7 @@ msgstr "" # 96 - EOWNERDEAD msgid "Previous owner died" msgstr "" + +# 97 - EINTEGRITY +msgid "Integrity check failed" +msgstr "" Modified: stable/12/contrib/llvm-project/libcxx/include/__errc ============================================================================== --- stable/12/contrib/llvm-project/libcxx/include/__errc Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/llvm-project/libcxx/include/__errc Thu Jan 30 16:11:19 2020 (r357296) @@ -45,6 +45,7 @@ enum class errc identifier_removed, // EIDRM illegal_byte_sequence, // EILSEQ inappropriate_io_control_operation, // ENOTTY + integrity_check_failed, // EINTEGRITY interrupted, // EINTR invalid_argument, // EINVAL invalid_seek, // ESPIPE @@ -142,6 +143,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc) identifier_removed = EIDRM, illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, + integrity_check_failed = EINTEGRITY, interrupted = EINTR, invalid_argument = EINVAL, invalid_seek = ESPIPE, Modified: stable/12/contrib/llvm-project/libcxx/include/errno.h ============================================================================== --- stable/12/contrib/llvm-project/libcxx/include/errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/llvm-project/libcxx/include/errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -32,49 +32,79 @@ Macros: #ifdef __cplusplus -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY) -#ifdef ELAST +#if defined(ELAST) static const int __elast1 = ELAST+1; static const int __elast2 = ELAST+2; +static const int __elast3 = ELAST+3; #else static const int __elast1 = 104; static const int __elast2 = 105; +static const int __elast3 = 106; #endif -#ifdef ENOTRECOVERABLE +#if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#define EINTEGRITY __elast3 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif +#elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EOWNERDEAD __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EOWNERDEAD +#endif + +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) #define EOWNERDEAD __elast1 +#define EINTEGRITY __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif -#ifdef ELAST +#elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY) +#define EOWNERDEAD __elast1 +#if defined(ELAST) #undef ELAST #define ELAST EOWNERDEAD #endif -#elif defined(EOWNERDEAD) +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define ENOTRECOVERABLE __elast1 +#define EINTEGRITY __elast2 +#if defined(ELAST) +#undef ELAST +#define ELAST EINTEGRITY +#endif +#elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY) #define ENOTRECOVERABLE __elast1 -#ifdef ELAST +#if defined(ELAST) #undef ELAST #define ELAST ENOTRECOVERABLE #endif -#else // defined(EOWNERDEAD) - -#define EOWNERDEAD __elast1 -#define ENOTRECOVERABLE __elast2 -#ifdef ELAST +#elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY) +#define EINTEGRITY __elast1 +#if defined(ELAST) #undef ELAST -#define ELAST ENOTRECOVERABLE +#define ELAST EINTEGRITY #endif -#endif // defined(EOWNERDEAD) +#endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY) -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY) // supply errno values likely to be missing, particularly on Windows @@ -390,6 +420,10 @@ static const int __elast2 = 105; #ifndef EMLINK #define EMLINK 9979 +#endif + +#ifndef EINTEGRITY +#define EINTEGRITY 9980 #endif #endif // __cplusplus Modified: stable/12/contrib/openbsm/libbsm/bsm_errno.c ============================================================================== --- stable/12/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/openbsm/libbsm/bsm_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -239,6 +239,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: stable/12/contrib/openbsm/sys/bsm/audit_errno.h ============================================================================== --- stable/12/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/contrib/openbsm/sys/bsm/audit_errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -204,6 +204,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: stable/12/lib/libc/gen/errlst.c ============================================================================== --- stable/12/lib/libc/gen/errlst.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/gen/errlst.c Thu Jan 30 16:11:19 2020 (r357296) @@ -158,12 +158,12 @@ const char *const sys_errlist[] = { "Not permitted in capability mode", /* 94 - ECAPMODE */ "State not recoverable", /* 95 - ENOTRECOVERABLE */ "Previous owner died", /* 96 - EOWNERDEAD */ + "Integrity check failed", /* 97 - EINTEGRITY */ /* * Reserved space in sys_errlist, take the next slot for a next error code. * Reserve prevents the array size from changing for some time. */ - __uprefix, /* 97 */ __uprefix, /* 98 */ __uprefix, /* 99 */ __uprefix, /* 100 */ Modified: stable/12/lib/libc/nls/C.msg ============================================================================== --- stable/12/lib/libc/nls/C.msg Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/nls/C.msg Thu Jan 30 16:11:19 2020 (r357296) @@ -197,6 +197,8 @@ $ ENOTRECOVERABLE 95 State not recoverable $ EOWNERDEAD 96 Previous owner died +$ EINTEGRITY +97 Integrity check failed $ $ strsignal() support catalog $ Modified: stable/12/lib/libc/sys/intro.2 ============================================================================== --- stable/12/lib/libc/sys/intro.2 Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/lib/libc/sys/intro.2 Thu Jan 30 16:11:19 2020 (r357296) @@ -472,6 +472,20 @@ The system call or operation is not permitted for capa The state protected by a robust mutex is not recoverable. .It Er 96 EOWNERDEAD Em "Previous owner died" . The owner of a robust mutex terminated while holding the mutex lock. +.It Er 97 EINTEGRITY Em "Integrity check failed" . +An integrity check such as a check-hash or a cross-correlation failed. +The integrity error falls between +.Er EINVAL +that identifies errors in parameters to a system call and +.Er EIO +that identifies errors with the underlying storage media. +It is typically raised by intermediate kernel layers such as a +filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. +Uses include allowing the +.Xr mount 8 +command to return a different exit value to automate the running of +.Xr fsck 8 +during a system boot. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: stable/12/stand/liblua/lerrno.c ============================================================================== --- stable/12/stand/liblua/lerrno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/stand/liblua/lerrno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -146,6 +146,7 @@ static const struct err_name_number { ENTRY(ECAPMODE), ENTRY(ENOTRECOVERABLE), ENTRY(EOWNERDEAD), + ENTRY(EINTEGRITY), ENTRY(ELAST), ENTRY(ERESTART), ENTRY(EJUSTRETURN), Modified: stable/12/sys/bsm/audit_errno.h ============================================================================== --- stable/12/sys/bsm/audit_errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/bsm/audit_errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -208,6 +208,7 @@ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ +#define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: stable/12/sys/compat/cloudabi/cloudabi_errno.c ============================================================================== --- stable/12/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/compat/cloudabi/cloudabi_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -63,6 +63,7 @@ cloudabi_convert_errno(int error) [EIDRM] = CLOUDABI_EIDRM, [EILSEQ] = CLOUDABI_EILSEQ, [EINPROGRESS] = CLOUDABI_EINPROGRESS, + [EINTEGRITY] = CLOUDABI_EINVAL, [EINTR] = CLOUDABI_EINTR, [EINVAL] = CLOUDABI_EINVAL, [EIO] = CLOUDABI_EIO, Modified: stable/12/sys/compat/linux/linux_errno.inc ============================================================================== --- stable/12/sys/compat/linux/linux_errno.inc Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/compat/linux/linux_errno.inc Thu Jan 30 16:11:19 2020 (r357296) @@ -142,7 +142,8 @@ const int linux_errtbl[ELAST + 1] = { -1, /* ECAPMODE -> EPERM */ -131, /* ENOTRECOVERABLE */ -130, /* EOWNERDEAD */ + -22, /* EINTEGRITY -> EINVAL */ }; -_Static_assert(ELAST == 96, +_Static_assert(ELAST == 97, "missing errno entries in linux_errtbl"); Modified: stable/12/sys/security/audit/bsm_errno.c ============================================================================== --- stable/12/sys/security/audit/bsm_errno.c Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/security/audit/bsm_errno.c Thu Jan 30 16:11:19 2020 (r357296) @@ -243,6 +243,13 @@ static const struct bsm_errno bsm_errnos[] = { ERRNO_NO_LOCAL_MAPPING, #endif ES("Process died with the lock") }, + { BSM_ERRNO_EINTEGRITY, +#ifdef EINTEGRITY + EINTEGRITY, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Integrity check failed") }, { BSM_ERRNO_ENOTRECOVERABLE, #ifdef ENOTRECOVERABLE ENOTRECOVERABLE, Modified: stable/12/sys/sys/errno.h ============================================================================== --- stable/12/sys/sys/errno.h Thu Jan 30 15:00:41 2020 (r357295) +++ stable/12/sys/sys/errno.h Thu Jan 30 16:11:19 2020 (r357296) @@ -180,10 +180,11 @@ __END_DECLS #define ECAPMODE 94 /* Not permitted in capability mode */ #define ENOTRECOVERABLE 95 /* State not recoverable */ #define EOWNERDEAD 96 /* Previous owner died */ +#define EINTEGRITY 97 /* Integrity check failed */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 96 /* Must be equal largest errno */ +#define ELAST 97 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) From owner-svn-src-all@freebsd.org Thu Jan 30 16:35:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B73523E033; Thu, 30 Jan 2020 16:35:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 487mD35CMyz4Kbw; Thu, 30 Jan 2020 16:34:59 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00UGYtTa056077 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 30 Jan 2020 08:34:55 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00UGYtOB056076; Thu, 30 Jan 2020 08:34:55 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 30 Jan 2020 08:34:55 -0800 From: Gleb Smirnoff To: Kristof Provost , Ilja Van Sprundel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357233 - head/sys/net Message-ID: <20200130163455.GH1268@FreeBSD.org> References: <202001282244.00SMiPrb077446@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001282244.00SMiPrb077446@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 487mD35CMyz4Kbw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.83 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-0.88)[-0.884,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 16:35:00 -0000 On Tue, Jan 28, 2020 at 10:44:25PM +0000, Kristof Provost wrote: K> Author: kp K> Date: Tue Jan 28 22:44:24 2020 K> New Revision: 357233 K> URL: https://svnweb.freebsd.org/changeset/base/357233 K> K> Log: K> epair: Do not abuse params to register the second interface K> K> if_epair used the 'params' argument to pass a pointer to the b interface K> through if_clone_create(). K> This pointer can be controlled by userspace, which means it could be abused to K> trigger a panic. While this requires PRIV_NET_IFCREATE K> privileges those are assigned to vnet jails, which means that vnet jails K> could panic the system. K> K> Reported by: Ilja Van Sprundel ... K> Modified: head/sys/net/if_clone.h K> ============================================================================== K> --- head/sys/net/if_clone.h Tue Jan 28 21:46:59 2020 (r357232) K> +++ head/sys/net/if_clone.h Tue Jan 28 22:44:24 2020 (r357233) K> @@ -79,7 +79,8 @@ int if_clone_list(struct if_clonereq *); K> struct if_clone *if_clone_findifc(struct ifnet *); K> void if_clone_addgroup(struct ifnet *, struct if_clone *); K> K> -/* The below interface used only by epair(4). */ K> +/* The below interfaces are used only by epair(4). */ K> +void if_clone_addif(struct if_clone *, struct ifnet *); K> int if_clone_destroyif(struct if_clone *, struct ifnet *); IMHO, makes sense to move all these declaration into if_epair.c itself. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 30 16:38:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6872E23E1D0; Thu, 30 Jan 2020 16:38:41 +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 487mJK2BC3z4Kv0; Thu, 30 Jan 2020 16:38:41 +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 460A227CD6; Thu, 30 Jan 2020 16:38:41 +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 00UGcf3S085069; Thu, 30 Jan 2020 16:38:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UGcfa4085068; Thu, 30 Jan 2020 16:38:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001301638.00UGcfa4085068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 30 Jan 2020 16:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357297 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 357297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 16:38:41 -0000 Author: mav Date: Thu Jan 30 16:38:40 2020 New Revision: 357297 URL: https://svnweb.freebsd.org/changeset/base/357297 Log: MFC r356707: Map ECKSUM and EFRAGS from ZFS onto real errnos. Make it less confusing when, for example, stat sets errno to 122 because a checksum failed in ZFS: Before: getfacl: /foo/bar: stat() failed: Unknown error: 122 After: getfacl: /foo/bar: stat() failed: Integrity check failed Submitted by: Ryan Moeller Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 30 16:11:19 2020 (r357296) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 30 16:38:40 2020 (r357297) @@ -227,12 +227,11 @@ enum zio_wait_type { }; /* - * We'll take the number 122 and 123 to indicate checksum errors and - * fragmentation. Those doesn't collide with any errno values as they - * are greater than ELAST. + * These are bespoke errnos used in ZFS. We map them to their closest FreeBSD + * equivalents. This gives us more useful error messages from strerror(3). */ -#define ECKSUM 122 -#define EFRAGS 123 +#define ECKSUM EINTEGRITY +#define EFRAGS ENOSPC typedef void zio_done_func_t(zio_t *zio); From owner-svn-src-all@freebsd.org Thu Jan 30 17:30:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44D4F23FA99; Thu, 30 Jan 2020 17:30:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487nRd13W9z4P7q; Thu, 30 Jan 2020 17:30:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F8776B5; Thu, 30 Jan 2020 17:30:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UHU53A014638; Thu, 30 Jan 2020 17:30:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UHU43V014637; Thu, 30 Jan 2020 17:30:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001301730.00UHU43V014637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 30 Jan 2020 17:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357298 - head/lib/libusb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/lib/libusb X-SVN-Commit-Revision: 357298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 17:30:05 -0000 Author: hselasky Date: Thu Jan 30 17:30:04 2020 New Revision: 357298 URL: https://svnweb.freebsd.org/changeset/base/357298 Log: Add missing mutex unlock in failure case. Differential Revision: https://reviews.freebsd.org/D23430 Submitted by: cem Reported by: Coverity Coverity CID: 1368773 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/lib/libusb/libusb10_hotplug.c Modified: head/lib/libusb/libusb10_hotplug.c ============================================================================== --- head/lib/libusb/libusb10_hotplug.c Thu Jan 30 16:38:40 2020 (r357297) +++ head/lib/libusb/libusb10_hotplug.c Thu Jan 30 17:30:04 2020 (r357298) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } From owner-svn-src-all@freebsd.org Thu Jan 30 17:50:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3539D1F8535; Thu, 30 Jan 2020 17:50:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487nvc0cYVz4QdC; Thu, 30 Jan 2020 17:50:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FFCEAAD; Thu, 30 Jan 2020 17:50:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UHopOd026530; Thu, 30 Jan 2020 17:50:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UHopB4026529; Thu, 30 Jan 2020 17:50:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001301750.00UHopB4026529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 30 Jan 2020 17:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357299 - head/contrib/apr/strings X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/apr/strings X-SVN-Commit-Revision: 357299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 17:50:52 -0000 Author: cem Date: Thu Jan 30 17:50:51 2020 New Revision: 357299 URL: https://svnweb.freebsd.org/changeset/base/357299 Log: contrib/apr: Remove scope leak UB In apr_vformatter, the variable buf was declared inside a limited scope region, but a pointer to it is leaked outside of that region and used later. This is undefined behavior. Fix by moving the buf variable to function scope. Reported by: Coverity CID: 1192541 Modified: head/contrib/apr/strings/apr_snprintf.c Modified: head/contrib/apr/strings/apr_snprintf.c ============================================================================== --- head/contrib/apr/strings/apr_snprintf.c Thu Jan 30 17:30:04 2020 (r357298) +++ head/contrib/apr/strings/apr_snprintf.c Thu Jan 30 17:50:51 2020 (r357299) @@ -708,6 +708,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_ char num_buf[NUM_BUF_SIZE]; char char_buf[2]; /* for printing %% and % */ + char buf[5]; /* for printing %B, %F, and %S */ enum var_type_enum { IS_QUAD, IS_LONG, IS_SHORT, IS_INT @@ -1246,7 +1247,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_ case 'F': case 'S': { - char buf[5]; apr_off_t size = 0; if (*fmt == 'B') { From owner-svn-src-all@freebsd.org Thu Jan 30 18:12:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D59221F91E9; Thu, 30 Jan 2020 18:12:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487pNS5NPNz4S1p; Thu, 30 Jan 2020 18:12:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B400D1016; Thu, 30 Jan 2020 18:12:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UICOaP044236; Thu, 30 Jan 2020 18:12:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UICOXS044235; Thu, 30 Jan 2020 18:12:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001301812.00UICOXS044235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 30 Jan 2020 18:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357300 - head/sys/dev/aic7xxx X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/aic7xxx X-SVN-Commit-Revision: 357300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 18:12:24 -0000 Author: cem Date: Thu Jan 30 18:12:24 2020 New Revision: 357300 URL: https://svnweb.freebsd.org/changeset/base/357300 Log: aic7xxx(4): Fix unintended sign extension in ahd_inq() ahd_inb() returns type uint8_t. The shift left by untyped 24 implicitly promotes the result to type (signed) int. Then the binary OR with uint64_t values sign-extends the integer. If bit 31 of the read value happened to be set, the 64-bit result would have all upper 32 bits set to 1 due to OR. This is clearly not intended. Reported by: Coverity CID: 980473 (old one!) Modified: head/sys/dev/aic7xxx/aic79xx_inline.h Modified: head/sys/dev/aic7xxx/aic79xx_inline.h ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_inline.h Thu Jan 30 17:50:51 2020 (r357299) +++ head/sys/dev/aic7xxx/aic79xx_inline.h Thu Jan 30 18:12:24 2020 (r357300) @@ -567,7 +567,7 @@ ahd_inq(struct ahd_softc *ahd, u_int port) return ((ahd_inb(ahd, port)) | (ahd_inb(ahd, port+1) << 8) | (ahd_inb(ahd, port+2) << 16) - | (ahd_inb(ahd, port+3) << 24) + | (((uint64_t)ahd_inb(ahd, port+3)) << 24) | (((uint64_t)ahd_inb(ahd, port+4)) << 32) | (((uint64_t)ahd_inb(ahd, port+5)) << 40) | (((uint64_t)ahd_inb(ahd, port+6)) << 48) From owner-svn-src-all@freebsd.org Thu Jan 30 18:12:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05AB91F924E; Thu, 30 Jan 2020 18:12:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487pNn6KYpz4S8K; Thu, 30 Jan 2020 18:12:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFE41101B; Thu, 30 Jan 2020 18:12:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UICfQw044290; Thu, 30 Jan 2020 18:12:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UICfsZ044289; Thu, 30 Jan 2020 18:12:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001301812.00UICfsZ044289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 30 Jan 2020 18:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357301 - head/contrib/apr/random/unix X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/apr/random/unix X-SVN-Commit-Revision: 357301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 18:12:42 -0000 Author: cem Date: Thu Jan 30 18:12:41 2020 New Revision: 357301 URL: https://svnweb.freebsd.org/changeset/base/357301 Log: contrib/apr: Rip out bogus [CS]PRNG implementation This construction used some relatively slow design involving SHA2; even if it were fed real entropy (unclear; external to the design), it did not handle fork in a safe way, and it was difficult to audit for correctness. So just rip it out and use the very simple and known-correct arc4random(3) interface in its place. Modified: head/contrib/apr/random/unix/apr_random.c Modified: head/contrib/apr/random/unix/apr_random.c ============================================================================== --- head/contrib/apr/random/unix/apr_random.c Thu Jan 30 18:12:24 2020 (r357300) +++ head/contrib/apr/random/unix/apr_random.c Thu Jan 30 18:12:41 2020 (r357301) @@ -13,285 +13,51 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * See the paper "On Randomness" by Ben Laurie for an explanation of this PRNG. - * http://www.apache-ssl.org/randomness.pdf - * XXX: Is there a formal proof of this PRNG? Couldn't we use the more popular - * Mersenne Twister PRNG (and BSD licensed)? - */ #include "apr.h" #include "apr_pools.h" #include "apr_random.h" #include "apr_thread_proc.h" #include +#include -#ifdef min -#undef min -#endif -#define min(a,b) ((a) < (b) ? (a) : (b)) - -#define APR_RANDOM_DEFAULT_POOLS 32 -#define APR_RANDOM_DEFAULT_REHASH_SIZE 1024 -#define APR_RANDOM_DEFAULT_RESEED_SIZE 32 -#define APR_RANDOM_DEFAULT_HASH_SECRET_SIZE 32 -#define APR_RANDOM_DEFAULT_G_FOR_INSECURE 32 -#define APR_RANDOM_DEFAULT_G_FOR_SECURE 320 - -typedef struct apr_random_pool_t { - unsigned char *pool; - unsigned int bytes; - unsigned int pool_size; -} apr_random_pool_t; - -#define hash_init(h) (h)->init(h) -#define hash_add(h,b,n) (h)->add(h,b,n) -#define hash_finish(h,r) (h)->finish(h,r) - -#define hash(h,r,b,n) hash_init(h),hash_add(h,b,n),hash_finish(h,r) - -#define crypt_setkey(c,k) (c)->set_key((c)->data,k) -#define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) - -struct apr_random_t { - apr_pool_t *apr_pool; - apr_crypto_hash_t *pool_hash; - unsigned int npools; - apr_random_pool_t *pools; - unsigned int next_pool; - unsigned int generation; - apr_size_t rehash_size; - apr_size_t reseed_size; - apr_crypto_hash_t *key_hash; -#define K_size(g) ((g)->key_hash->size) - apr_crypto_hash_t *prng_hash; -#define B_size(g) ((g)->prng_hash->size) - - unsigned char *H; - unsigned char *H_waiting; -#define H_size(g) (B_size(g)+K_size(g)) -#define H_current(g) (((g)->insecure_started && !(g)->secure_started) \ - ? (g)->H_waiting : (g)->H) - - unsigned char *randomness; - apr_size_t random_bytes; - unsigned int g_for_insecure; - unsigned int g_for_secure; - unsigned int secure_base; - unsigned int insecure_started:1; - unsigned int secure_started:1; - - apr_random_t *next; -}; - -static apr_random_t *all_random; - -static apr_status_t random_cleanup(void *data) -{ - apr_random_t *remove_this = data, - *cur = all_random, - **prev_ptr = &all_random; - while (cur) { - if (cur == remove_this) { - *prev_ptr = cur->next; - break; - } - prev_ptr = &cur->next; - cur = cur->next; - } - return APR_SUCCESS; -} - - APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash) { - unsigned int n; - - g->apr_pool = p; - - g->pool_hash = pool_hash; - g->key_hash = key_hash; - g->prng_hash = prng_hash; - - g->npools = APR_RANDOM_DEFAULT_POOLS; - g->pools = apr_palloc(p,g->npools*sizeof *g->pools); - for (n = 0; n < g->npools; ++n) { - g->pools[n].bytes = g->pools[n].pool_size = 0; - g->pools[n].pool = NULL; - } - g->next_pool = 0; - - g->generation = 0; - - g->rehash_size = APR_RANDOM_DEFAULT_REHASH_SIZE; - /* Ensure that the rehash size is twice the size of the pool hasher */ - g->rehash_size = ((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size - /2)*g->pool_hash->size*2; - g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE; - - g->H = apr_pcalloc(p,H_size(g)); - g->H_waiting = apr_pcalloc(p,H_size(g)); - - g->randomness = apr_palloc(p,B_size(g)); - g->random_bytes = 0; - - g->g_for_insecure = APR_RANDOM_DEFAULT_G_FOR_INSECURE; - g->secure_base = 0; - g->g_for_secure = APR_RANDOM_DEFAULT_G_FOR_SECURE; - g->secure_started = g->insecure_started = 0; - - g->next = all_random; - all_random = g; - apr_pool_cleanup_register(p, g, random_cleanup, apr_pool_cleanup_null); + (void)g; + (void)p; + (void)pool_hash; + (void)key_hash; + (void)prng_hash; } -static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) -{ - hash_init(g->key_hash); - hash_add(g->key_hash,H,H_size(g)); - hash_add(g->key_hash,&pid,sizeof pid); - hash_finish(g->key_hash,H); -} - -static void mixer(apr_random_t *g,pid_t pid) -{ - unsigned char *H = H_current(g); - - /* mix the PID into the current H */ - mix_pid(g,H,pid); - /* if we are in waiting, then also mix into main H */ - if (H != g->H) - mix_pid(g,g->H,pid); - /* change order of pool mixing for good measure - note that going - backwards is much better than going forwards */ - --g->generation; - /* blow away any lingering randomness */ - g->random_bytes = 0; -} - APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc) { - apr_random_t *r; - - for (r = all_random; r; r = r->next) - /* - * XXX Note: the pid does not provide sufficient entropy to - * actually call this secure. See Ben's paper referenced at - * the top of this file. - */ - mixer(r,proc->pid); + (void)proc; } APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p) { - apr_random_t *r = apr_palloc(p,sizeof *r); - - apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), - apr_crypto_sha256_new(p)); - return r; + /* apr_random_t is an opaque struct type. */ + return (void *)0x1; } -static void rekey(apr_random_t *g) -{ - unsigned int n; - unsigned char *H = H_current(g); - - hash_init(g->key_hash); - hash_add(g->key_hash,H,H_size(g)); - for (n = 0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) - ; ++n) { - hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); - g->pools[n].bytes = 0; - } - hash_finish(g->key_hash,H+B_size(g)); - - ++g->generation; - if (!g->insecure_started && g->generation > g->g_for_insecure) { - g->insecure_started = 1; - if (!g->secure_started) { - memcpy(g->H_waiting,g->H,H_size(g)); - g->secure_base = g->generation; - } - } - - if (!g->secure_started && g->generation > g->secure_base+g->g_for_secure) { - g->secure_started = 1; - memcpy(g->H,g->H_waiting,H_size(g)); - } -} - APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, apr_size_t bytes) { - unsigned int n; - const unsigned char *entropy = entropy_; - - for (n = 0; n < bytes; ++n) { - apr_random_pool_t *p = &g->pools[g->next_pool]; - - if (++g->next_pool == g->npools) - g->next_pool = 0; - - if (p->pool_size < p->bytes+1) { - unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); - - memcpy(np,p->pool,p->bytes); - p->pool = np; - p->pool_size = (p->bytes+1)*2; - } - p->pool[p->bytes++] = entropy[n]; - - if (p->bytes == g->rehash_size) { - apr_size_t r; - - for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) - hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); - p->bytes/=2; - } - assert(p->bytes < g->rehash_size); - } - - if (g->pools[0].bytes >= g->reseed_size) - rekey(g); + (void)g; + (void)entropy_; + (void)bytes; } -/* This will give g->B_size bytes of randomness */ -static void apr_random_block(apr_random_t *g,unsigned char *random) -{ - /* FIXME: in principle, these are different hashes */ - hash(g->prng_hash,g->H,g->H,H_size(g)); - hash(g->prng_hash,random,g->H,B_size(g)); -} - -static void apr_random_bytes(apr_random_t *g,unsigned char *random, - apr_size_t bytes) -{ - apr_size_t n; - - for (n = 0; n < bytes; ) { - apr_size_t l; - - if (g->random_bytes == 0) { - apr_random_block(g,g->randomness); - g->random_bytes = B_size(g); - } - l = min(bytes-n,g->random_bytes); - memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); - g->random_bytes-=l; - n+=l; - } -} - APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes) { - if (!g->secure_started) - return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + (void)g; + arc4random_buf(random, bytes); return APR_SUCCESS; } @@ -299,28 +65,24 @@ APR_DECLARE(apr_status_t) apr_random_insecure_bytes(ap void *random, apr_size_t bytes) { - if (!g->insecure_started) - return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + (void)g; + arc4random_buf(random, bytes); return APR_SUCCESS; } APR_DECLARE(void) apr_random_barrier(apr_random_t *g) { - g->secure_started = 0; - g->secure_base = g->generation; + (void)g; } APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r) { - if (!r->secure_started) - return APR_ENOTENOUGHENTROPY; + (void)r; return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r) { - if (!r->insecure_started) - return APR_ENOTENOUGHENTROPY; + (void)r; return APR_SUCCESS; } From owner-svn-src-all@freebsd.org Thu Jan 30 18:28:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCCE51F99B0; Thu, 30 Jan 2020 18:28:03 +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 487pkW3TkSz4SsM; Thu, 30 Jan 2020 18:28:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 725BB122B; Thu, 30 Jan 2020 18:28:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UIS3ek050450; Thu, 30 Jan 2020 18:28:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UIS3UF050449; Thu, 30 Jan 2020 18:28:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001301828.00UIS3UF050449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 30 Jan 2020 18:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357302 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 18:28:03 -0000 Author: jhb Date: Thu Jan 30 18:28:02 2020 New Revision: 357302 URL: https://svnweb.freebsd.org/changeset/base/357302 Log: Fix use of an uninitialized variable. ctx (and thus ctx.flags) is stack garbage at the start of this function, so initialize ctx.flags to an explicit value instead of using binary operations on the garbage. Reported by: gcc9 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23368 Modified: head/sys/kern/subr_stats.c Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Thu Jan 30 18:12:41 2020 (r357301) +++ head/sys/kern/subr_stats.c Thu Jan 30 18:28:02 2020 (r357302) @@ -1583,9 +1583,7 @@ stats_v1_blob_iter(struct statsblobv1 *sb, stats_v1_bl int i, j, firstvoi; ctx.usrctx = usrctx; - ctx.flags |= SB_IT_FIRST_CB; - ctx.flags &= ~(SB_IT_FIRST_VOI | SB_IT_LAST_VOI | SB_IT_FIRST_VOISTAT | - SB_IT_LAST_VOISTAT); + ctx.flags = SB_IT_FIRST_CB; firstvoi = 1; for (i = 0; i < NVOIS(sb); i++) { From owner-svn-src-all@freebsd.org Thu Jan 30 18:34:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57A371F9D11; Thu, 30 Jan 2020 18:34:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487psY1f1Lz4TJJ; Thu, 30 Jan 2020 18:34:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 339801400; Thu, 30 Jan 2020 18:34:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UIY9VR056073; Thu, 30 Jan 2020 18:34:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UIY9aT056072; Thu, 30 Jan 2020 18:34:09 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202001301834.00UIY9aT056072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 30 Jan 2020 18:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357303 - head/usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 357303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 18:34:09 -0000 Author: brooks Date: Thu Jan 30 18:34:08 2020 New Revision: 357303 URL: https://svnweb.freebsd.org/changeset/base/357303 Log: Fix an indentation bug in r357169. Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Jan 30 18:28:02 2020 (r357302) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Jan 30 18:34:08 2020 (r357303) @@ -287,7 +287,7 @@ detrunc(struct denode *dep, u_long length, int flags, return (error); } memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); - bwrite(bp); + bwrite(bp); } } From owner-svn-src-all@freebsd.org Thu Jan 30 18:49:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C690D1FA1F9; Thu, 30 Jan 2020 18:49:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487qC34v7lz4V1F; Thu, 30 Jan 2020 18:49:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A351615FC; Thu, 30 Jan 2020 18:49:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UInJPd062566; Thu, 30 Jan 2020 18:49:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UInJeO062565; Thu, 30 Jan 2020 18:49:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001301849.00UInJeO062565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 30 Jan 2020 18:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357304 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 18:49:19 -0000 Author: andrew Date: Thu Jan 30 18:49:19 2020 New Revision: 357304 URL: https://svnweb.freebsd.org/changeset/base/357304 Log: Shift the ITS processor ID after reading it. When using the processor ID value we mask off the low and high bits that should be zero. Unfortunatly we don't shift the ID value so it won't be affected. Add the shift when reading the ID as this will need to align with the address based target value. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu Jan 30 18:34:08 2020 (r357303) +++ head/sys/arm64/arm64/gicv3_its.c Thu Jan 30 18:49:19 2020 (r357304) @@ -685,7 +685,8 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) target = vtophys(rman_get_virtual(&rpcpu->res)); } else { /* This ITS wants the unique processor number */ - target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)); + target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)) << + CMD_TARGET_SHIFT; } sc->sc_its_cols[cpuid]->col_target = target; From owner-svn-src-all@freebsd.org Thu Jan 30 19:04:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F5AA1FAA42 for ; Thu, 30 Jan 2020 19:04:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 487qXD0jwBz4W4H for ; Thu, 30 Jan 2020 19:04:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1580411050; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=cdkZDFc8fPnvIpRgAnd+rEsMsLk6f3S0KVZKaeDnrph+mLCa2Q9VbCOQ5RiihDihQvjTypjWLs2Fc oum0CCUCOM6DZfgHCiuThY+n8qSDKflRx8w7cRgS4AnEfol7mbJPKkPFXKqE3jrHWXiwoW2vb22Hxr YqbvhbQJuNTX6aD08PjXinWa7mN7v+jaw4IVu86iU5RnB/E7yaPvmYDuEJB1vA6trcpNFHmBUeZQ7B X1djhx4/d2AEy39hHxD40G3dg+tPyTamvBwym0QL6rr/qZIy0P/Lh+dqzJ6UO9RVGuy2Y/KelYde/S TdiJ8/Jp31aBxhjCwMexpikxV9N6yLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=EuzSx73AuuXx5VKBaVaZH3a3AW4grDotd44WHI5kV/Q=; b=DTHdPRHyOs7y10PM1YaYDtiJ4HsLgdHHhoGH2HSPtp6GAGCOgkjHIyve+Yt3Vmid9NOrxV+6l36am bGMFv4jd09GIwXELfQGwL8flKAxoTilA+SPiuzZW9cvO1ab/WgOUypfiwf2hDjeiOwBcPWP0xK6cOo P91K3QcGdE9Dc3Le3ZJMgcYUp3QYUkNcsbn6QLbVIQ3XNZ6f6DVz/aGuSPTZFB64WWxqybLBSEmDGL p5OQ5IsK0ngPhbp2C7lpG5s13++0cUwGuSPkqwPwb3spnuvkqcgZEw9sIcZ3zObHkdjTRCurX9ZvAB KyXXU2SAhZbN5YBapoi5JEghRDwygFA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=EuzSx73AuuXx5VKBaVaZH3a3AW4grDotd44WHI5kV/Q=; b=bi4/UPSh1HLb/F/4pA7f0E9XAPvlWs5RdAfw8c9/A1TMDOD0athqJK65wk+9DSTKgYbvDgNyx5dkE nhXdspgjZWiaSFAvbKTbVvtULDISEQDByOtzNRAC1dFDuysE9NGfQzjito6J0mkHQh0nfhInVO7fPV 820DS88QX0hLS9Cs7Swgl2UAbnSJ/OqypJOg5+IevHisV4C3s5OTgsRi7U6G7cNS/G5Xf0K5l+IdMM IDF+bB493tW+DnvVYRexezucpu7veq4VhxV5dY/NveajEYcYn4ojKyu1K2HQMDRrGaBceyEgrMpagB /SEvyM8OvnXd+aQQ9io8znvAgLwFajg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 4b0367b5-4393-11ea-b80d-052b4a66b6b2 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 outbound3.ore.mailhop.org (Halon) with ESMTPSA id 4b0367b5-4393-11ea-b80d-052b4a66b6b2; Thu, 30 Jan 2020 19:04:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 00UJ48GI021417; Thu, 30 Jan 2020 12:04:08 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <88fdb889b1c899412f699bb7f3abf4c6fee3aaaf.camel@freebsd.org> Subject: Re: svn commit: r357288 - head/sys/dev/usb/wlan From: Ian Lepore To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 30 Jan 2020 12:04:08 -0700 In-Reply-To: <202001300941.00U9fm6s037993@repo.freebsd.org> References: <202001300941.00U9fm6s037993@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 487qXD0jwBz4W4H X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-0.98)[-0.976,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:04:12 -0000 On Thu, 2020-01-30 at 09:41 +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Jan 30 09:41:48 2020 > New Revision: 357288 > URL: https://svnweb.freebsd.org/changeset/base/357288 > > Log: > Widen EPOCH(9) usage in USB WLAN drivers. > > This patch should unbreak the USB WLAN drivers after r357004. > > Pointy hat: glebius@ > Sponsored by: Mellanox Technologies > > Modified: > head/sys/dev/usb/wlan/if_rum.c > head/sys/dev/usb/wlan/if_run.c > head/sys/dev/usb/wlan/if_uath.c > head/sys/dev/usb/wlan/if_upgt.c > head/sys/dev/usb/wlan/if_ural.c > head/sys/dev/usb/wlan/if_urtw.c > head/sys/dev/usb/wlan/if_zyd.c > This is another piece of evidence illustratitng what a bad idea it was to try to handle network interrupts as some sort of special case in the wrong layer of the OS. Network drivers know who they are and can do the right thing. The interrupt dispatching code can only guess at what's going on by using flags that were intended for a whole other purpose. We now how multiple demonstrations of the fact that those flags cannot reliably be used as an indication of whether network packets are going to be handled during the interrupt or not. -- Ian From owner-svn-src-all@freebsd.org Thu Jan 30 19:15:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3521A1FB036; Thu, 30 Jan 2020 19:15:28 +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 487qnD0cJnz4WgG; Thu, 30 Jan 2020 19:15:28 +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 100CE1B76; Thu, 30 Jan 2020 19:15:28 +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 00UJFRDW080064; Thu, 30 Jan 2020 19:15:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJFR8x080061; Thu, 30 Jan 2020 19:15:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001301915.00UJFR8x080061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 30 Jan 2020 19:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357305 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 357305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:15:28 -0000 Author: jhb Date: Thu Jan 30 19:15:27 2020 New Revision: 357305 URL: https://svnweb.freebsd.org/changeset/base/357305 Log: Remove unused fields from struct pcb. cpu_switch/throw() and savectx() do not save or restore any values in these fields which mostly held non-callee-save registers. makectx() copied these fields from kdb_frame, but they weren't used except for PC_REGS using pcb_sepc. Change PC_REGS to use kdb_frame->tf_sepc directly instead. Reviewed by: br MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23395 Modified: head/sys/riscv/include/db_machdep.h head/sys/riscv/include/pcb.h head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/include/db_machdep.h ============================================================================== --- head/sys/riscv/include/db_machdep.h Thu Jan 30 18:49:19 2020 (r357304) +++ head/sys/riscv/include/db_machdep.h Thu Jan 30 19:15:27 2020 (r357305) @@ -47,7 +47,7 @@ typedef vm_offset_t db_addr_t; typedef long db_expr_t; -#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_sepc) +#define PC_REGS() ((db_addr_t)kdb_frame->tf_sepc) #define BKPT_INST (0x00100073) #define BKPT_SIZE (INSN_SIZE) Modified: head/sys/riscv/include/pcb.h ============================================================================== --- head/sys/riscv/include/pcb.h Thu Jan 30 18:49:19 2020 (r357304) +++ head/sys/riscv/include/pcb.h Thu Jan 30 19:15:27 2020 (r357305) @@ -46,15 +46,12 @@ struct pcb { uint64_t pcb_sp; /* Stack pointer */ uint64_t pcb_gp; /* Global pointer */ uint64_t pcb_tp; /* Thread pointer */ - uint64_t pcb_t[7]; /* Temporary registers */ uint64_t pcb_s[12]; /* Saved registers */ - uint64_t pcb_a[8]; /* Argument registers */ uint64_t pcb_x[32][2]; /* Floating point registers */ uint64_t pcb_fcsr; /* Floating point control reg */ uint64_t pcb_fpflags; /* Floating point flags */ #define PCB_FP_STARTED 0x1 #define PCB_FP_USERMASK 0x1 - uint64_t pcb_sepc; /* Supervisor exception pc */ vm_offset_t pcb_onfault; /* Copyinout fault handler */ }; Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Thu Jan 30 18:49:19 2020 (r357304) +++ head/sys/riscv/riscv/genassym.c Thu Jan 30 19:15:27 2020 (r357305) @@ -69,9 +69,7 @@ ASSYM(PCB_RA, offsetof(struct pcb, pcb_ra)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_GP, offsetof(struct pcb, pcb_gp)); ASSYM(PCB_TP, offsetof(struct pcb, pcb_tp)); -ASSYM(PCB_T, offsetof(struct pcb, pcb_t)); ASSYM(PCB_S, offsetof(struct pcb, pcb_s)); -ASSYM(PCB_A, offsetof(struct pcb, pcb_a)); ASSYM(PCB_X, offsetof(struct pcb, pcb_x)); ASSYM(PCB_FCSR, offsetof(struct pcb, pcb_fcsr)); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Jan 30 18:49:19 2020 (r357304) +++ head/sys/riscv/riscv/machdep.c Thu Jan 30 19:15:27 2020 (r357305) @@ -558,15 +558,12 @@ void makectx(struct trapframe *tf, struct pcb *pcb) { - memcpy(pcb->pcb_t, tf->tf_t, sizeof(tf->tf_t)); memcpy(pcb->pcb_s, tf->tf_s, sizeof(tf->tf_s)); - memcpy(pcb->pcb_a, tf->tf_a, sizeof(tf->tf_a)); pcb->pcb_ra = tf->tf_ra; pcb->pcb_sp = tf->tf_sp; pcb->pcb_gp = tf->tf_gp; pcb->pcb_tp = tf->tf_tp; - pcb->pcb_sepc = tf->tf_sepc; } void From owner-svn-src-all@freebsd.org Thu Jan 30 19:34:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22E811FBD62; Thu, 30 Jan 2020 19:34:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487rCK6zJ8z4Xrv; Thu, 30 Jan 2020 19:34:37 +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 EAC211F63; Thu, 30 Jan 2020 19:34:37 +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 00UJYb2r091903; Thu, 30 Jan 2020 19:34:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJYb2v091902; Thu, 30 Jan 2020 19:34:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001301934.00UJYb2v091902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Jan 2020 19:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357306 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 357306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:34:38 -0000 Author: kib Date: Thu Jan 30 19:34:37 2020 New Revision: 357306 URL: https://svnweb.freebsd.org/changeset/base/357306 Log: Fix a bug in r357199. Around a generic call to null_nodeget(), there is nothing that would prevent the unmount of the nullfs mp until we process to the insmntque1() point. Calculate the VV_ROOT flag after insmntque1() to not access mp->mnt_data before we have an exclusively locked vnode from this mount point on the mp vnode list. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Thu Jan 30 19:15:27 2020 (r357305) +++ head/sys/fs/nullfs/null_subr.c Thu Jan 30 19:34:37 2020 (r357306) @@ -252,11 +252,12 @@ null_nodeget(mp, lowervp, vpp) vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; - if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) - vp->v_vflag |= VV_ROOT; error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); + if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp) + vp->v_vflag |= VV_ROOT; + /* * Atomically insert our new node into the hash or vget existing * if someone else has beaten us to it. From owner-svn-src-all@freebsd.org Thu Jan 30 19:38:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA6DA1FBE4D; Thu, 30 Jan 2020 19:38:12 +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 487rHS5t8Tz4Y27; Thu, 30 Jan 2020 19:38:12 +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 C4D681F69; Thu, 30 Jan 2020 19:38:12 +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 00UJcCdY092120; Thu, 30 Jan 2020 19:38:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJcCdQ092119; Thu, 30 Jan 2020 19:38:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001301938.00UJcCdQ092119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 19:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357307 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:38:13 -0000 Author: mjg Date: Thu Jan 30 19:38:12 2020 New Revision: 357307 URL: https://svnweb.freebsd.org/changeset/base/357307 Log: vfs: keep the mount point referenced across sys_quotactl Otherwise we risk running into use-after-free. In particular this codepath ends up dropping all protection before suspending writes: ufs_quotactl -> quotaoff_inchange -> vfs_write_suspend_umnt Reported by: pho Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jan 30 19:34:37 2020 (r357306) +++ head/sys/kern/vfs_syscalls.c Thu Jan 30 19:38:12 2020 (r357307) @@ -189,9 +189,10 @@ sys_quotactl(struct thread *td, struct quotactl_args * vfs_ref(mp); vput(nd.ni_vp); error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) + if (error != 0) { + vfs_rel(mp); return (error); + } error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg); /* @@ -208,6 +209,7 @@ sys_quotactl(struct thread *td, struct quotactl_args * if ((uap->cmd >> SUBCMDSHIFT) != Q_QUOTAON && (uap->cmd >> SUBCMDSHIFT) != Q_QUOTAOFF) vfs_unbusy(mp); + vfs_rel(mp); return (error); } From owner-svn-src-all@freebsd.org Thu Jan 30 19:38:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD3C41FBF04; Thu, 30 Jan 2020 19:38:51 +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 487rJC49pjz4Y8g; Thu, 30 Jan 2020 19:38:51 +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 8ACF71F6A; Thu, 30 Jan 2020 19:38:51 +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 00UJcpsW092190; Thu, 30 Jan 2020 19:38:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJcpt1092189; Thu, 30 Jan 2020 19:38:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001301938.00UJcpt1092189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 19:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357308 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:38:51 -0000 Author: mjg Date: Thu Jan 30 19:38:51 2020 New Revision: 357308 URL: https://svnweb.freebsd.org/changeset/base/357308 Log: Assert that smp_rendezvous_cpus is called with interrupts enabled. Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Thu Jan 30 19:38:12 2020 (r357307) +++ head/sys/kern/subr_smp.c Thu Jan 30 19:38:51 2020 (r357308) @@ -563,6 +563,12 @@ smp_rendezvous_cpus(cpuset_t map, return; } + /* + * Make sure we come here with interrupts enabled. Otherwise we + * livelock if smp_ipi_mtx is owned by a thread which sent as an IPI. + */ + MPASS(curthread->td_md.md_spinlock_count == 0); + CPU_FOREACH(i) { if (CPU_ISSET(i, &map)) ncpus++; From owner-svn-src-all@freebsd.org Thu Jan 30 19:56:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC4E41FC73C; Thu, 30 Jan 2020 19:56: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 487rhQ4Ym9z4Z3N; Thu, 30 Jan 2020 19:56: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 97BE02318; Thu, 30 Jan 2020 19:56: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 00UJuMTb004093; Thu, 30 Jan 2020 19:56:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJuMC3004092; Thu, 30 Jan 2020 19:56:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001301956.00UJuMC3004092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 19:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357309 - 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: 357309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:56:22 -0000 Author: mjg Date: Thu Jan 30 19:56:22 2020 New Revision: 357309 URL: https://svnweb.freebsd.org/changeset/base/357309 Log: amd64: speed up failing case for memcmp Instead of branching on up to 8 bytes, drop the size to 4. Assorted clean ups while here. Validated with glibc test suite. Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Thu Jan 30 19:38:51 2020 (r357308) +++ head/sys/amd64/amd64/support.S Thu Jan 30 19:56:22 2020 (r357309) @@ -107,7 +107,7 @@ END(sse2_pagezero) /* * memcmpy(b1, b2, len) - * rdi,rsi,len + * rdi,rsi,rdx */ ENTRY(memcmp) PUSH_FRAME_POINTER @@ -123,7 +123,7 @@ ENTRY(memcmp) movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq -8(%rdi,%rdx),%r8 movq -8(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -133,25 +133,25 @@ ENTRY(memcmp) 100408: cmpb $4,%dl jl 100204f - movl (%rsi),%r8d - movl (%rdi),%r9d + movl (%rdi),%r8d + movl (%rsi),%r9d cmpl %r8d,%r9d - jne 1f - movl -4(%rsi,%rdx),%r8d - movl -4(%rdi,%rdx),%r9d + jne 80f + movl -4(%rdi,%rdx),%r8d + movl -4(%rsi,%rdx),%r9d cmpl %r8d,%r9d - jne 1f + jne 10040804f POP_FRAME_POINTER ret 100204: cmpb $2,%dl jl 100001f - movzwl (%rsi),%r8d - movzwl (%rdi),%r9d + movzwl (%rdi),%r8d + movzwl (%rsi),%r9d cmpl %r8d,%r9d jne 1f - movzwl -2(%rsi,%rdx),%r8d - movzwl -2(%rdi,%rdx),%r9d + movzwl -2(%rdi,%rdx),%r8d + movzwl -2(%rsi,%rdx),%r9d cmpl %r8d,%r9d jne 1f POP_FRAME_POINTER @@ -159,10 +159,9 @@ ENTRY(memcmp) 100001: cmpb $1,%dl jl 100000f - movzbl (%rdi),%r8d - movzbl (%rsi),%r9d - cmpb %r8b,%r9b - jne 1f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax 100000: POP_FRAME_POINTER ret @@ -173,11 +172,11 @@ ALIGN_TEXT movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq 8(%rdi),%r8 movq 8(%rsi),%r9 cmpq %r8,%r9 - jne 10163208f + jne 10163208f movq -16(%rdi,%rdx),%r8 movq -16(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -194,14 +193,14 @@ ALIGN_TEXT movq 8(%rdi),%r9 subq (%rsi),%r8 subq 8(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320000f movq 16(%rdi),%r8 movq 24(%rdi),%r9 subq 16(%rsi),%r8 subq 24(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320016f leaq 32(%rdi),%rdi @@ -214,40 +213,57 @@ ALIGN_TEXT POP_FRAME_POINTER ret +/* + * Mismatch was found. + * + * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). + */ +ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi 10320000: -/* - * Mismatch was found within a 16 bytes range. The part of the routine - * which calculates it only operates on sizes up to 8 bytes. Find the - * right part. - */ movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT +10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163208: -10081608: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10040804: + leaq -4(%rdi,%rdx),%rdi + leaq -4(%rsi,%rdx),%rsi jmp 1f +ALIGN_TEXT +80: + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + leaq 4(%rdi),%rdi + leaq 4(%rsi),%rsi + /* - * Mismatch was found. We have no more than 8 bytes to inspect. + * We have up to 4 bytes to inspect. */ -ALIGN_TEXT 1: movzbl (%rdi),%eax movzbl (%rsi),%r8d @@ -266,32 +282,6 @@ ALIGN_TEXT movzbl 3(%rdi),%eax movzbl 3(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 4(%rdi),%eax - movzbl 4(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 5(%rdi),%eax - movzbl 5(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 6(%rdi),%eax - movzbl 6(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 7(%rdi),%eax - movzbl 7(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - xorl %eax,%eax - POP_FRAME_POINTER - ret 2: subl %r8d,%eax POP_FRAME_POINTER From owner-svn-src-all@freebsd.org Thu Jan 30 19:57:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 392AE1FC7E5; Thu, 30 Jan 2020 19:57:06 +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 487rjG0gLyz4Z9l; Thu, 30 Jan 2020 19:57:06 +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 1226C2319; Thu, 30 Jan 2020 19:57:06 +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 00UJv51k004172; Thu, 30 Jan 2020 19:57:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UJv50w004171; Thu, 30 Jan 2020 19:57:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001301957.00UJv50w004171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 19:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357310 - head/lib/libc/amd64/string X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/amd64/string X-SVN-Commit-Revision: 357310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 19:57:06 -0000 Author: mjg Date: Thu Jan 30 19:57:05 2020 New Revision: 357310 URL: https://svnweb.freebsd.org/changeset/base/357310 Log: amd64: sync up libc memcmp with the kernel version (r357309) Modified: head/lib/libc/amd64/string/memcmp.S Modified: head/lib/libc/amd64/string/memcmp.S ============================================================================== --- head/lib/libc/amd64/string/memcmp.S Thu Jan 30 19:56:22 2020 (r357309) +++ head/lib/libc/amd64/string/memcmp.S Thu Jan 30 19:57:05 2020 (r357310) @@ -45,7 +45,7 @@ ENTRY(memcmp) movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq -8(%rdi,%rdx),%r8 movq -8(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -54,34 +54,33 @@ ENTRY(memcmp) 100408: cmpb $4,%dl jl 100204f - movl (%rsi),%r8d - movl (%rdi),%r9d + movl (%rdi),%r8d + movl (%rsi),%r9d cmpl %r8d,%r9d - jne 1f - movl -4(%rsi,%rdx),%r8d - movl -4(%rdi,%rdx),%r9d + jne 80f + movl -4(%rdi,%rdx),%r8d + movl -4(%rsi,%rdx),%r9d cmpl %r8d,%r9d - jne 1f + jne 10040804f ret 100204: cmpb $2,%dl jl 100001f - movzwl (%rsi),%r8d - movzwl (%rdi),%r9d + movzwl (%rdi),%r8d + movzwl (%rsi),%r9d cmpl %r8d,%r9d jne 1f - movzwl -2(%rsi,%rdx),%r8d - movzwl -2(%rdi,%rdx),%r9d + movzwl -2(%rdi,%rdx),%r8d + movzwl -2(%rsi,%rdx),%r9d cmpl %r8d,%r9d jne 1f ret 100001: cmpb $1,%dl jl 100000f - movzbl (%rdi),%r8d - movzbl (%rsi),%r9d - cmpb %r8b,%r9b - jne 1f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax 100000: ret ALIGN_TEXT @@ -91,11 +90,11 @@ ALIGN_TEXT movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq 8(%rdi),%r8 movq 8(%rsi),%r9 cmpq %r8,%r9 - jne 10163208f + jne 10163208f movq -16(%rdi,%rdx),%r8 movq -16(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -111,14 +110,14 @@ ALIGN_TEXT movq 8(%rdi),%r9 subq (%rsi),%r8 subq 8(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320000f movq 16(%rdi),%r8 movq 24(%rdi),%r9 subq 16(%rsi),%r8 subq 24(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320016f leaq 32(%rdi),%rdi @@ -130,40 +129,57 @@ ALIGN_TEXT jne 10b ret +/* + * Mismatch was found. + * + * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). + */ +ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi 10320000: -/* - * Mismatch was found within a 16 bytes range. The part of the routine - * which calculates it only operates on sizes up to 8 bytes. Find the - * right part. - */ movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT +10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163208: -10081608: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10040804: + leaq -4(%rdi,%rdx),%rdi + leaq -4(%rsi,%rdx),%rsi jmp 1f +ALIGN_TEXT +80: + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + leaq 4(%rdi),%rdi + leaq 4(%rsi),%rsi + /* - * Mismatch was found. We have no more than 8 bytes to inspect. + * We have up to 4 bytes to inspect. */ -ALIGN_TEXT 1: movzbl (%rdi),%eax movzbl (%rsi),%r8d @@ -182,31 +198,6 @@ ALIGN_TEXT movzbl 3(%rdi),%eax movzbl 3(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 4(%rdi),%eax - movzbl 4(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 5(%rdi),%eax - movzbl 5(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 6(%rdi),%eax - movzbl 6(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 7(%rdi),%eax - movzbl 7(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - xorl %eax,%eax - ret 2: subl %r8d,%eax ret From owner-svn-src-all@freebsd.org Thu Jan 30 20:02:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A19F1FCCA4; Thu, 30 Jan 2020 20:02:15 +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 487rqC1Jqkz4Zp1; Thu, 30 Jan 2020 20:02:15 +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 2869723D8; Thu, 30 Jan 2020 20:02:15 +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 00UK2FH2011660; Thu, 30 Jan 2020 20:02:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UK2FF5011659; Thu, 30 Jan 2020 20:02:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001302002.00UK2FF5011659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 20:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357311 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:02:15 -0000 Author: mjg Date: Thu Jan 30 20:02:14 2020 New Revision: 357311 URL: https://svnweb.freebsd.org/changeset/base/357311 Log: Tidy up 2 comments in smp_rendezvous_cpus. Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Thu Jan 30 19:57:05 2020 (r357310) +++ head/sys/kern/subr_smp.c Thu Jan 30 20:02:14 2020 (r357311) @@ -550,7 +550,7 @@ smp_rendezvous_cpus(cpuset_t map, { int curcpumap, i, ncpus = 0; - /* Look comments in the !SMP case. */ + /* See comments in the !SMP case. */ if (!smp_started) { spinlock_enter(); if (setup_func != NULL) @@ -565,7 +565,7 @@ smp_rendezvous_cpus(cpuset_t map, /* * Make sure we come here with interrupts enabled. Otherwise we - * livelock if smp_ipi_mtx is owned by a thread which sent as an IPI. + * livelock if smp_ipi_mtx is owned by a thread which sent us an IPI. */ MPASS(curthread->td_md.md_spinlock_count == 0); From owner-svn-src-all@freebsd.org Thu Jan 30 20:05:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 158A61FCDD1; Thu, 30 Jan 2020 20:05:20 +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 487rtm0NzYz4Zyl; Thu, 30 Jan 2020 20:05:20 +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 E22522512; Thu, 30 Jan 2020 20:05:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00UK5JJn011894; Thu, 30 Jan 2020 20:05:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UK55YU011830; Thu, 30 Jan 2020 20:05:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001302005.00UK55YU011830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jan 2020 20:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357312 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:05:20 -0000 Author: mjg Date: Thu Jan 30 20:05:05 2020 New Revision: 357312 URL: https://svnweb.freebsd.org/changeset/base/357312 Log: Remove duplicated empty lines from kern/*.c No functional changes. Modified: head/sys/kern/imgact_binmisc.c head/sys/kern/imgact_elf.c head/sys/kern/init_main.c head/sys/kern/kern_alq.c head/sys/kern/kern_conf.c head/sys/kern/kern_exit.c head/sys/kern/kern_hhook.c head/sys/kern/kern_jail.c head/sys/kern/kern_kcov.c head/sys/kern/kern_kthread.c head/sys/kern/kern_linker.c head/sys/kern/kern_lockf.c head/sys/kern/kern_mib.c head/sys/kern/kern_mtxpool.c head/sys/kern/kern_pmc.c head/sys/kern/kern_poll.c head/sys/kern/kern_resource.c head/sys/kern/kern_sig.c head/sys/kern/kern_switch.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_tc.c head/sys/kern/kern_time.c head/sys/kern/kern_ubsan.c head/sys/kern/kern_umtx.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_acl_posix1e.c head/sys/kern/subr_blist.c head/sys/kern/subr_bufring.c head/sys/kern/subr_bus.c head/sys/kern/subr_clock.c head/sys/kern/subr_csan.c head/sys/kern/subr_fattime.c head/sys/kern/subr_filter.c head/sys/kern/subr_gtaskqueue.c head/sys/kern/subr_hints.c head/sys/kern/subr_intr.c head/sys/kern/subr_kdb.c head/sys/kern/subr_sbuf.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_smp.c head/sys/kern/subr_stats.c head/sys/kern/subr_unit.c head/sys/kern/subr_vmem.c head/sys/kern/subr_witness.c head/sys/kern/sys_generic.c head/sys/kern/sys_pipe.c head/sys/kern/sys_process.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_shm.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_init.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/imgact_binmisc.c Thu Jan 30 20:05:05 2020 (r357312) @@ -609,7 +609,6 @@ imgact_binmisc_exec(struct image_params *imgp) fname = sbuf_data(sname); } - /* * We need to "push" the interpreter in the arg[] list. To do this, * we first shift all the other values in the `begin_argv' area to @@ -706,7 +705,6 @@ imgact_binmisc_exec(struct image_params *imgp) if (!error) imgp->interpreter_name = imgp->args->begin_argv; - done: if (sname) Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/imgact_elf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -630,7 +630,6 @@ __elfN(load_section)(struct image_params *imgp, vm_oof return (0); } - /* * We have to get the remaining bit of the file into the first part * of the oversized map segment. This is normally because the .data Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/init_main.c Thu Jan 30 20:05:05 2020 (r357312) @@ -115,7 +115,6 @@ linux_alloc_current_noop(struct thread *td __unused, i } int (*lkpi_alloc_current)(struct thread *, int) = linux_alloc_current_noop; - #ifndef BOOTHOWTO #define BOOTHOWTO 0 #endif Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_alq.c Thu Jan 30 20:05:05 2020 (r357312) @@ -120,7 +120,6 @@ static void alq_shutdown(struct alq *); static void alq_destroy(struct alq *); static int alq_doio(struct alq *); - /* * Add a new queue to the global list. Fail if we're shutting down. */ @@ -422,7 +421,6 @@ static struct kproc_desc ald_kp = { SYSINIT(aldthread, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &ald_kp); SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, ald_startup, NULL); - /* User visible queue functions */ /* @@ -501,7 +499,6 @@ alq_open(struct alq **alqp, const char *file, struct u return (ret); } - /* * Copy a new entry into the queue. If the operation would block either Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_conf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -950,7 +950,6 @@ dev_dependsl(struct cdev *pdev, struct cdev *cdev) LIST_INSERT_HEAD(&pdev->si_children, cdev, si_siblings); } - void dev_depends(struct cdev *pdev, struct cdev *cdev) { @@ -1324,7 +1323,6 @@ clone_create(struct clonedevs **cdp, struct cdevsw *cs ("Too high unit (0x%x) in clone_create", *up)); KASSERT(csw->d_flags & D_NEEDMINOR, ("clone_create() on cdevsw without minor numbers")); - /* * Search the list for a lot of things in one go: Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_exit.c Thu Jan 30 20:05:05 2020 (r357312) @@ -686,7 +686,6 @@ exit1(struct thread *td, int rval, int signo) thread_exit(); } - #ifndef _SYS_SYSPROTO_H_ struct abort2_args { char *why; @@ -762,7 +761,6 @@ out: exit1(td, 0, sig); return (0); } - #ifdef COMPAT_43 /* Modified: head/sys/kern/kern_hhook.c ============================================================================== --- head/sys/kern/kern_hhook.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_hhook.c Thu Jan 30 20:05:05 2020 (r357312) @@ -508,7 +508,6 @@ hhook_vnet_uninit(const void *unused __unused) HHHLIST_UNLOCK(); } - /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_jail.c Thu Jan 30 20:05:05 2020 (r357312) @@ -436,7 +436,6 @@ kern_jail(struct thread *td, struct jail *j) return (error); } - /* * struct jail_set_args { * struct iovec *iovp; @@ -1896,7 +1895,6 @@ kern_jail_set(struct thread *td, struct uio *optuio, i return (error); } - /* * struct jail_get_args { * struct iovec *iovp; @@ -2208,7 +2206,6 @@ kern_jail_get(struct thread *td, struct uio *optuio, i return (error); } - /* * struct jail_remove_args { * int jid; @@ -2308,7 +2305,6 @@ prison_remove_one(struct prison *pr) prison_deref(pr, deuref | PD_DEREF); } - /* * struct jail_attach_args { * int jid; @@ -2425,7 +2421,6 @@ do_jail_attach(struct thread *td, struct prison *pr) return (error); } - /* * Returns a locked prison instance, or NULL on failure. */ @@ -3426,7 +3421,6 @@ prison_path(struct prison *pr1, struct prison *pr2) return (path2 + len1); return (path2); } - /* * Jail-related sysctls. Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_kcov.c Thu Jan 30 20:05:05 2020 (r357312) @@ -321,7 +321,6 @@ kcov_close(struct cdev *dev, int fflag, int devtype, s struct kcov_info *info; int error; - if ((error = devfs_get_cdevpriv((void **)&info)) != 0) return (error); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_kthread.c Thu Jan 30 20:05:05 2020 (r357312) @@ -230,7 +230,6 @@ kproc_suspend_check(struct proc *p) PROC_UNLOCK(p); } - /* * Start a kernel thread. * Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_linker.c Thu Jan 30 20:05:05 2020 (r357312) @@ -133,7 +133,6 @@ retry: \ (a) = next_file_id; \ } while(0) - /* XXX wrong name; we're looking at version provision tags here, not modules */ typedef TAILQ_HEAD(, modlist) modlisthead_t; struct modlist { Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_lockf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -886,7 +886,6 @@ lf_free_edge(struct lockf_edge *e) free(e, M_LOCKF); } - /* * Ensure that the lock's owner has a corresponding vertex in the * owner graph. Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_mib.c Thu Jan 30 20:05:05 2020 (r357312) @@ -518,7 +518,6 @@ sysctl_build_id(SYSCTL_HANDLER_ARGS) return (ENOENT); } - hashlen = sectionlen - BUILD_ID_HEADER_LEN; for (int i = 0; i < hashlen; i++) { uint8_t c = __build_id_start[i+BUILD_ID_HEADER_LEN]; Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_mtxpool.c Thu Jan 30 20:05:05 2020 (r357312) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include - static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool"); /* Pool sizes must be a power of two */ Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_pmc.c Thu Jan 30 20:05:05 2020 (r357312) @@ -183,7 +183,6 @@ pmc_cpu_is_primary(int cpu) #endif } - /* * Return the maximum CPU number supported by the system. The return * value is used for scaling internal data structures and for runtime Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_poll.c Thu Jan 30 20:05:05 2020 (r357312) @@ -247,7 +247,6 @@ static uint32_t idlepoll_sleeping; /* idlepoll is slee SYSCTL_UINT(_kern_polling, OID_AUTO, idlepoll_sleeping, CTLFLAG_RD, &idlepoll_sleeping, 0, "idlepoll is sleeping"); - #define POLL_LIST_LEN 128 struct pollrec { poll_handler_t *handler; @@ -272,7 +271,6 @@ init_device_poll(void) SHUTDOWN_PRI_LAST); } SYSINIT(device_poll, SI_SUB_SOFTINTR, SI_ORDER_MIDDLE, init_device_poll, NULL); - /* * Hook from hardclock. Tries to schedule a netisr, but keeps track Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_resource.c Thu Jan 30 20:05:05 2020 (r357312) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include - static MALLOC_DEFINE(M_PLIMIT, "plimit", "plimit structures"); static MALLOC_DEFINE(M_UIDINFO, "uidinfo", "uidinfo structures"); #define UIHASH(uid) (&uihashtbl[(uid) & uihash]) Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_sig.c Thu Jan 30 20:05:05 2020 (r357312) @@ -865,7 +865,6 @@ freebsd4_sigaction(struct thread *td, struct freebsd4_ struct sigaction *actp, *oactp; int error; - actp = (uap->act != NULL) ? &act : NULL; oactp = (uap->oact != NULL) ? &oact : NULL; if (actp) { @@ -1964,7 +1963,6 @@ pgsignal(struct pgrp *pgrp, int sig, int checkctty, ks } } - /* * Recalculate the signal mask and reset the signal disposition after * usermode frame for delivery is formed. Should be called after @@ -1986,7 +1984,6 @@ postsig_done(int sig, struct thread *td, struct sigact if (SIGISMEMBER(ps->ps_sigreset, sig)) sigdflt(ps, sig); } - /* * Send a signal caused by a trap to the current thread. If it will be Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_switch.c Thu Jan 30 20:05:05 2020 (r357312) @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_sysctl.c Thu Jan 30 20:05:05 2020 (r357312) @@ -737,7 +737,6 @@ sysctl_remove_name(struct sysctl_oid *parent, const ch return (error); } - static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse) { @@ -1293,7 +1292,6 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) return (error); } - static SYSCTL_NODE(_sysctl, CTL_SYSCTL_OIDFMT, oidfmt, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_oidfmt, ""); @@ -1545,7 +1543,6 @@ sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) *(int *)arg1 = tt; return (0); } - /* * Handle a long, signed or unsigned. Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_tc.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1540,7 +1540,6 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTL 0, 0, sysctl_kern_timecounter_hardware, "A", "Timecounter hardware selected"); - /* Report the available timecounter hardware. */ static int sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_time.c Thu Jan 30 20:05:05 2020 (r357312) @@ -118,7 +118,6 @@ int itimespecfix(struct timespec *ts); SYSINIT(posix_timer, SI_SUB_P1003_1B, SI_ORDER_FIRST+4, itimer_start, NULL); - static int settime(struct thread *td, struct timeval *tv) { Modified: head/sys/kern/kern_ubsan.c ============================================================================== --- head/sys/kern/kern_ubsan.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_ubsan.c Thu Jan 30 20:05:05 2020 (r357312) @@ -26,7 +26,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ - /* * The micro UBSan implementation for the userland (uUBSan) and kernel (kUBSan). * The uBSSan versions is suitable for inclusion into libc or used standalone Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/kern_umtx.c Thu Jan 30 20:05:05 2020 (r357312) @@ -715,7 +715,6 @@ umtxq_signal_queue(struct umtx_key *key, int n_wake, i return (ret); } - /* * Wake up specified thread. */ @@ -1577,7 +1576,6 @@ umtx_pi_setowner(struct umtx_pi *pi, struct thread *ow pi->pi_owner = owner; TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); } - /* * Disown a PI mutex, and remove it from the owned list. Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/link_elf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1314,7 +1314,6 @@ elf_relocaddr(linker_file_t lf, Elf_Addr x) return (x); } - static void link_elf_unload_file(linker_file_t file) { Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/link_elf_obj.c Thu Jan 30 20:05:05 2020 (r357312) @@ -87,7 +87,6 @@ typedef struct { int sec; } Elf_relaent; - typedef struct elf_file { struct linker_file lf; /* Common fields */ @@ -1269,7 +1268,6 @@ relocate_file(elf_file_t ef) int i; Elf_Size symidx; Elf_Addr base; - /* Perform relocations without addend if there are any: */ for (i = 0; i < ef->nreltab; i++) { Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sched_4bsd.c Thu Jan 30 20:05:05 2020 (r357312) @@ -828,7 +828,6 @@ static void sched_priority(struct thread *td, u_char prio) { - KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); @@ -1297,7 +1296,6 @@ sched_add(struct thread *td, int flags) KTR_ATTR_LINKED, sched_tdname(td)); SDT_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, flags & SRQ_PREEMPTED); - /* * Now that the thread is moving to the run-queue, set the lock Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sched_ule.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1506,7 +1506,6 @@ sched_initticks(void *dummy) sched_idlespinthresh = 2 * max(10000, 6 * hz) / realstathz; } - /* * This is the core of the interactivity algorithm. Determines a score based * on past behavior. It is the ratio of sleep time to run time scaled to Modified: head/sys/kern/subr_acl_posix1e.c ============================================================================== --- head/sys/kern/subr_acl_posix1e.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_acl_posix1e.c Thu Jan 30 20:05:05 2020 (r357312) @@ -652,7 +652,6 @@ acl_posix1e_newfilemode(mode_t cmode, struct acl *dacl return (mode); } - static int acl_posix1e_modload(module_t mod, int what, void *arg) { Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_blist.c Thu Jan 30 20:05:05 2020 (r357312) @@ -192,7 +192,6 @@ bitrange(int n, int count) ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - (n + count)))); } - /* * Find the first bit set in a u_daddr_t. */ Modified: head/sys/kern/subr_bufring.c ============================================================================== --- head/sys/kern/subr_bufring.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_bufring.c Thu Jan 30 20:05:05 2020 (r357312) @@ -29,14 +29,12 @@ #include __FBSDID("$FreeBSD$"); - #include #include #include #include #include #include - struct buf_ring * buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *lock) Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_bus.c Thu Jan 30 20:05:05 2020 (r357312) @@ -3591,7 +3591,6 @@ resource_list_release_active(struct resource_list *rl, return (retval); } - /** * @brief Fully release a reserved resource * @@ -3906,7 +3905,6 @@ bus_generic_resume(device_t dev) } return (0); } - /** * @brief Helper function for implementing BUS_RESET_POST Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_clock.c Thu Jan 30 20:05:05 2020 (r357312) @@ -84,7 +84,6 @@ SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock, CTLFLA * Derived from NetBSD arch/hp300/hp300/clock.c */ - #define FEBRUARY 2 #define days_in_year(y) (leapyear(y) ? 366 : 365) #define days_in_month(y, m) \ Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_csan.c Thu Jan 30 20:05:05 2020 (r357312) @@ -493,7 +493,6 @@ kcsan_copyout(const void *kaddr, void *uaddr, size_t l atomic_subtract_##name(ptr, val); \ } - #define CSAN_ATOMIC_FUNC_SUBTRACT(name, type) \ _CSAN_ATOMIC_FUNC_SUBTRACT(name, type) \ _CSAN_ATOMIC_FUNC_SUBTRACT(acq_##name, type) \ @@ -535,7 +534,6 @@ kcsan_copyout(const void *kaddr, void *uaddr, size_t l return (atomic_testandset_##name(ptr, val)); \ } - CSAN_ATOMIC_FUNC_ADD(8, uint8_t) CSAN_ATOMIC_FUNC_CLEAR(8, uint8_t) CSAN_ATOMIC_FUNC_CMPSET(8, uint8_t) @@ -659,7 +657,6 @@ CSAN_ATOMIC_FUNC_TESTANDSET(ptr, uintptr_t) { \ atomic_thread_fence_##name(); \ } - CSAN_ATOMIC_FUNC_THREAD_FENCE(acq) CSAN_ATOMIC_FUNC_THREAD_FENCE(acq_rel) Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_fattime.c Thu Jan 30 20:05:05 2020 (r357312) @@ -135,7 +135,6 @@ static const struct { { NOV + 3 * YEAR + 1, ENC(3, 12) } }; - void timespec2fattime(const struct timespec *tsp, int utc, uint16_t *ddp, uint16_t *dtp, uint8_t *dhp) Modified: head/sys/kern/subr_filter.c ============================================================================== --- head/sys/kern/subr_filter.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_filter.c Thu Jan 30 20:05:05 2020 (r357312) @@ -133,7 +133,6 @@ setup_time_filter_small(struct time_filter_small *tf, return(0); } - static void check_update_times(struct time_filter *tf, uint64_t value, uint32_t now) { @@ -204,8 +203,6 @@ check_update_times_small(struct time_filter_small *tf, } } - - void filter_reduce_by(struct time_filter *tf, uint64_t reduce_by, uint32_t now) { @@ -294,7 +291,6 @@ forward_filter_clock(struct time_filter *tf, uint32_t } } - void forward_filter_clock_small(struct time_filter_small *tf, uint32_t ticks_forward) { @@ -309,7 +305,6 @@ forward_filter_clock_small(struct time_filter_small *t } } - void tick_filter_clock(struct time_filter *tf, uint32_t now) { @@ -452,7 +447,6 @@ apply_filter_max(struct time_filter *tf, uint64_t valu check_update_times(tf, value, now); return (tf->entries[0].value); } - uint32_t apply_filter_max_small(struct time_filter_small *tf, Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_gtaskqueue.c Thu Jan 30 20:05:05 2020 (r357312) @@ -156,7 +156,6 @@ _gtaskqueue_create(const char *name, int mflags, return (queue); } - /* * Signal a taskqueue thread to terminate. */ @@ -570,7 +569,6 @@ gtaskqueue_thread_enqueue(void *context) wakeup_any(tq); } - static struct gtaskqueue * gtaskqueue_create_fast(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context) @@ -578,7 +576,6 @@ gtaskqueue_create_fast(const char *name, int mflags, return _gtaskqueue_create(name, mflags, enqueue, context, MTX_SPIN, "fast_taskqueue"); } - struct taskqgroup_cpu { LIST_HEAD(, grouptask) tgc_tasks; Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_hints.c Thu Jan 30 20:05:05 2020 (r357312) @@ -135,7 +135,6 @@ res_find(char **hintp_cookie, int *line, int *startln, char *hintp, *p; bool dyn_used = false; - /* * We are expecting that the caller will pass us a hintp_cookie that * they are tracking. Upon entry, if *hintp_cookie is *not* set, this @@ -448,7 +447,6 @@ resource_find_match(int *anchor, const char **name, in *anchor = newln; return ret; } - /* * err = resource_find_dev(&anchor, name, &unit, res, value); Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_intr.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1262,7 +1262,6 @@ void intr_free_intr_map_data(struct intr_map_data *dat free(data, M_INTRNG); } - /* * Register a MSI/MSI-X interrupt controller */ @@ -1376,7 +1375,6 @@ intr_alloc_msix(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); - err = MSI_ALLOC_MSIX(pic->pic_dev, child, &pdev, &isrc); if (err != 0) return (err); @@ -1445,7 +1443,6 @@ intr_map_msi(device_t pci, device_t child, intptr_t xr return (err); } - void dosoftints(void); void dosoftints(void) @@ -1594,7 +1591,6 @@ intr_map_copy_map_data(u_int res_id, device_t *map_dev *map_xref = irq_map[res_id]->xref; mtx_unlock(&irq_map_lock); } - /* * Allocate and fill new entry in irq_map table. Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_kdb.c Thu Jan 30 20:05:05 2020 (r357312) @@ -258,7 +258,6 @@ kdb_sysctl_stack_overflow(SYSCTL_HANDLER_ARGS) return (0); } - void kdb_panic(const char *msg) { Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_sbuf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -302,7 +302,6 @@ void sbuf_set_flags(struct sbuf *s, int flags) { - s->s_flags |= (flags & SBUF_USRFLAGMSK); } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_sleepqueue.c Thu Jan 30 20:05:05 2020 (r357312) @@ -92,7 +92,6 @@ __FBSDID("$FreeBSD$"); #include #endif - /* * Constants for the hash table of sleep queue chains. * SC_TABLESIZE must be a power of two for SC_MASK to work properly. Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_smp.c Thu Jan 30 20:05:05 2020 (r357312) @@ -803,7 +803,6 @@ smp_topo_2level(int l2share, int l2count, int l1share, return (top); } - struct cpu_group * smp_topo_find(struct cpu_group *top, int cpu) { @@ -1005,7 +1004,6 @@ sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, &active, sizeof(active)); return (error); } - #ifdef SMP void Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_stats.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1733,7 +1733,6 @@ stats_voistatdata_tdgst_tostr(enum vsd_dtype voi_dtype sizeof(qstr)); sbuf_cat(buf, qstr); - switch (fmt) { case SB_STRFMT_FREEFORM: fmtstr = is32bit ? ",cnt=%u}" : ",cnt=%ju}"; Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_unit.c Thu Jan 30 20:05:05 2020 (r357312) @@ -143,7 +143,6 @@ _Malloc(size_t foo, int line) struct unrhdr; - struct mtx { int state; } unitmtx; @@ -225,7 +224,6 @@ ub_full(struct unrb *ub, int len) return (first_clear == -1); } - #if defined(DIAGNOSTIC) || !defined(_KERNEL) /* * Consistency check function. @@ -276,7 +274,6 @@ check_unrhdr(struct unrhdr *uh __unused, int line __un #endif - /* * Userland memory management. Just use calloc and keep track of how * many elements we have allocated for check_unrhdr(). @@ -1044,7 +1041,6 @@ main(int argc, char **argv) usage(argv); exit(2); } - } Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_vmem.c Thu Jan 30 20:05:05 2020 (r357312) @@ -201,7 +201,6 @@ static uma_zone_t vmem_zone; #define VMEM_CONDVAR_WAIT(vm) cv_wait(&vm->vm_cv, &vm->vm_lock) #define VMEM_CONDVAR_BROADCAST(vm) cv_broadcast(&vm->vm_cv) - #define VMEM_LOCK(vm) mtx_lock(&vm->vm_lock) #define VMEM_TRYLOCK(vm) mtx_trylock(&vm->vm_lock) #define VMEM_UNLOCK(vm) mtx_unlock(&vm->vm_lock) Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/subr_witness.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1915,7 +1915,6 @@ depart(struct witness *w) witness_increment_graph_generation(); } - static void adopt(struct witness *parent, struct witness *child) { @@ -2893,7 +2892,6 @@ witness_hash_djb2(const uint8_t *key, uint32_t size) return (hash); } - /* * Initializes the two witness hash tables. Called exactly once from * witness_initialize(). @@ -2965,7 +2963,6 @@ witness_hash_put(struct witness *w) w_hash.wh_array[hash] = w; w_hash.wh_count++; } - static struct witness_lock_order_data * witness_lock_order_get(struct witness *parent, struct witness *child) Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sys_generic.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1525,7 +1525,6 @@ pollrescan(struct thread *td) return (0); } - static int pollout(struct thread *td, struct pollfd *fds, struct pollfd *ufds, u_int nfd) { Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sys_pipe.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1606,7 +1606,6 @@ pipeclose(struct pipe *cpipe) pipelock(cpipe, 0); } - /* * Disconnect from peer, if any. */ Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sys_process.c Thu Jan 30 20:05:05 2020 (r357312) @@ -880,7 +880,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } } - /* OK */ break; Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sysv_msg.c Thu Jan 30 20:05:05 2020 (r357312) @@ -99,7 +99,6 @@ static int msg_prison_get(void *, void *); static int msg_prison_remove(void *, void *); static void msg_prison_cleanup(struct prison *); - #ifdef MSG_DEBUG #define DPRINTF(a) printf a #else @@ -351,7 +350,6 @@ msgunload() mtx_destroy(&msq_mtx); return (0); } - static int sysvmsg_modload(struct module *module, int cmd, void *arg) Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/sysv_shm.c Thu Jan 30 20:05:05 2020 (r357312) @@ -609,7 +609,6 @@ kern_shmctl(struct thread *td, int shmid, int cmd, voi return (error); } - #ifndef _SYS_SYSPROTO_H_ struct shmctl_args { int shmid; @@ -657,7 +656,6 @@ done: } return (error); } - static int shmget_existing(struct thread *td, struct shmget_args *uap, int mode, Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/uipc_mbuf.c Thu Jan 30 20:05:05 2020 (r357312) @@ -2113,7 +2113,6 @@ mbprof_clr_handler(SYSCTL_HANDLER_ARGS) return (error); } - SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofile, CTLTYPE_STRING|CTLFLAG_RD, NULL, 0, mbprof_handler, "A", "mbuf profiling statistics"); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/uipc_usrreq.c Thu Jan 30 20:05:05 2020 (r357312) @@ -316,7 +316,6 @@ static int unp_externalize_fp(struct file *); static struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); static void unp_process_defers(void * __unused, int); - static void unp_pcb_hold(struct unpcb *unp) { @@ -385,7 +384,6 @@ unp_pcb_owned_lock2_slowpath(struct unpcb *unp, struct unp_pcb_owned_lock2_slowpath((unp), &(unp2), &freed); \ } while (0) - /* * Definitions of protocols supported in the LOCAL domain. */ @@ -705,7 +703,6 @@ uipc_close(struct socket *so) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_close: unp == NULL")); - vplock = NULL; if ((vp = unp->unp_vnode) != NULL) { vplock = mtx_pool_find(mtxpool_sleep, vp); @@ -1025,7 +1022,6 @@ connect_internal(struct socket *so, struct sockaddr *n } return (error); } - static int uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_acl.c Thu Jan 30 20:05:05 2020 (r357312) @@ -67,7 +67,6 @@ CTASSERT(ACL_MAX_ENTRIES >= OLDACL_MAX_ENTRIES); MALLOC_DEFINE(M_ACL, "acl", "Access Control Lists"); - static int kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, struct acl *aclp, int follow); static int kern___acl_delete_path(struct thread *td, const char *path, Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_bio.c Thu Jan 30 20:05:05 2020 (r357312) @@ -779,7 +779,6 @@ bufspace_wait(struct bufdomain *bd, struct vnode *vp, BD_UNLOCK(bd); } - /* * bufspace_daemon: * @@ -941,7 +940,6 @@ waitrunningbufspace(void) } mtx_unlock(&rbreqlock); } - /* * vfs_buf_test_cache: Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_cluster.c Thu Jan 30 20:05:05 2020 (r357312) @@ -802,7 +802,6 @@ cluster_write(struct vnode *vp, struct buf *bp, u_quad vp->v_lasta = bp->b_blkno; } - /* * This is an awful lot like cluster_rbuild...wish they could be combined. * The last lbn argument is the current block on which I/O is being Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_extattr.c Thu Jan 30 20:05:05 2020 (r357312) @@ -673,7 +673,6 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, v return (error); } - #ifndef _SYS_SYSPROTO_H_ struct extattr_list_fd_args { int fd; Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_init.c Thu Jan 30 20:05:05 2020 (r357312) @@ -523,7 +523,6 @@ vfs_register(struct vfsconf *vfc) return (0); } - /* Remove registration of a filesystem type */ static int vfs_unregister(struct vfsconf *vfc) Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_subr.c Thu Jan 30 20:05:05 2020 (r357312) @@ -699,7 +699,6 @@ vntblinit(void *dummy __unused) } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL); - /* * Mark a mount point as busy. Used to synchronize access and to delay * unmounting. Eventually, mountlist_mtx is not released on failure. @@ -6129,7 +6128,6 @@ vfs_cache_root_set(struct mount *mp, struct vnode *vp) * * This interface replaces MNT_VNODE_FOREACH. */ - struct vnode * __mnt_vnode_next_all(struct vnode **mvp, struct mount *mp) Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_syscalls.c Thu Jan 30 20:05:05 2020 (r357312) @@ -4199,7 +4199,6 @@ getvnode(struct thread *td, int fd, cap_rights_t *righ return (0); } - /* * Get an (NFS) file handle. */ Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jan 30 20:02:14 2020 (r357311) +++ head/sys/kern/vfs_vnops.c Thu Jan 30 20:05:05 2020 (r357312) @@ -1293,7 +1293,6 @@ vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, return (0); } - /* * File table truncate routine. */ @@ -1855,7 +1854,6 @@ vn_finished_write(struct mount *mp) MNT_IUNLOCK(mp); } - /* * Filesystem secondary write operation has completed. If we are * suspending and this operation is the last one, notify the suspender @@ -1876,8 +1874,6 @@ vn_finished_secondary_write(struct mount *mp) wakeup(&mp->mnt_secondary_writes); MNT_IUNLOCK(mp); } - - /* * Request a filesystem to suspend write operations. From owner-svn-src-all@freebsd.org Thu Jan 30 20:29:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A4B51FDA6A; Thu, 30 Jan 2020 20:29:42 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 487sQt2YN8z4c80; Thu, 30 Jan 2020 20:29:41 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00UKTXuJ057145 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 30 Jan 2020 12:29:33 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00UKTXuH057144; Thu, 30 Jan 2020 12:29:33 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 30 Jan 2020 12:29:33 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap Message-ID: <20200130202933.GI1268@FreeBSD.org> References: <202001301028.00UAS1s1063130@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001301028.00UAS1s1063130@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 487sQt2YN8z4c80 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:29:42 -0000 On Thu, Jan 30, 2020 at 10:28:01AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Thu Jan 30 10:28:01 2020 H> New Revision: 357291 H> URL: https://svnweb.freebsd.org/changeset/base/357291 H> H> Log: H> Widen EPOCH(9) usage in PCI WLAN drivers. H> H> Make sure all occurrences of ieee80211_input_xxx() in sys/dev are H> covered by a network epoch section. Do not depend on the interrupt H> handler nor any taskqueues being in a network epoch section. H> H> This patch should unbreak the PCI WLAN drivers after r357004. H> H> Pointy hat: glebius@ H> Sponsored by: Mellanox Technologies Just looking at the very first driver in the patch - bwi. Why do you call it "broken"? It doesn't need any "unbreaking after r357004". Can you please show me a callgraph where epoch_enter you added to bwi_intr() will not be unnecessary? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 30 20:32:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B4D01FE0F0 for ; Thu, 30 Jan 2020 20:32:44 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (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 487sVM3Nb8z4cfF for ; Thu, 30 Jan 2020 20:32:43 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pg1-x542.google.com with SMTP id k3so2252567pgc.3 for ; Thu, 30 Jan 2020 12:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=05XS7HCYlQY4MGtmWVVxOSJ4dvhLdfnndVkUErdUOZo=; b=NwZGl70yNtTM+o7Ssxp27UepD+ykpFumQYj9UJB1xi0fJERt4JMjaZfXH8t2Or2xnX qifa2D2UBSVv9Eq+zGh/wloS8+xP1jjdnNssTb3umT09QDw1fNv4iVu+/I0Ch49TXUOY NLDOAvXzrD8pIKxHjyT2D9h6HetNmBDHv6pftS2jSukYwmx4owRBEpHGLcCo5OMjX/C/ QPqSRd+rQBzucU71u6CLQlFuTg7vd5/agM+xmf9dCR0xSp6mHNOInqIEbYcMsEwDpEDp A53mJeIkEokfbkFDiU9cWOjwmXHV4/YYunbj+nfeAg5lHlvA+7eh163xK0dshP1UQ8ck bEzw== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=05XS7HCYlQY4MGtmWVVxOSJ4dvhLdfnndVkUErdUOZo=; b=ZPKw5LHkqnSRyBilNw7mycHmWa6gjNBeMYkxvJwD0Rw/enIxa0Onjr9Olggd8HiSEl dM+7Y88FulQHCAgEXWGjxrtCJ0KGMzPQmdvE7v7Q6yMAnth4O17loNTKgoWFbvjvN+R9 PHO7muZB+t6jYpmoYSvQrvU5PzPhkGpVIBqrZQCAiBUxFW4k6EI7LR+AHtu15E+piF3S s85HtpMuE+YknoKiptC9Eu8lIeokUXJ+kiLzcPMDAcf3D0jFwxLMi1F3QTcFjpMVWkV1 2hkbmAFlMmdkpa8OTIgIdhkDOtGq+SSV0QuobWaCMi9bkrlxcZ0sdcfVn1rY6q18ewXn cGqw== X-Gm-Message-State: APjAAAUzop/etKJlOruS+uZi4TxO7hSm4b94PJvUENrOV6Uo3kE+/Eu2 zrF/6Accv/KkptJDTo9qDSZ5gg== X-Google-Smtp-Source: APXvYqx0RDT0uPDoWhmZGieaXt+qNeOzCCINKV88pJVaemadadtiF4S9ct5NvhXPBett6KGcUUtAaQ== X-Received: by 2002:a62:e912:: with SMTP id j18mr6809933pfh.4.1580416361039; Thu, 30 Jan 2020 12:32:41 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id 70sm7628645pgf.90.2020.01.30.12.32.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jan 2020 12:32:40 -0800 (PST) Date: Thu, 30 Jan 2020 10:32:38 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Hans Petter Selasky cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap In-Reply-To: <202001301028.00UAS1s1063130@repo.freebsd.org> Message-ID: References: <202001301028.00UAS1s1063130@repo.freebsd.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 487sVM3Nb8z4cfF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=NwZGl70y; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::542) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.91)[ip: (-0.67), ipnet: 2607:f8b0::/32(-2.03), asn: 15169(-1.78), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:32:44 -0000 On Thu, 30 Jan 2020, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Jan 30 10:28:01 2020 > New Revision: 357291 > URL: https://svnweb.freebsd.org/changeset/base/357291 > > Log: > Widen EPOCH(9) usage in PCI WLAN drivers. > > Make sure all occurrences of ieee80211_input_xxx() in sys/dev are > covered by a network epoch section. Do not depend on the interrupt > handler nor any taskqueues being in a network epoch section. > > This patch should unbreak the PCI WLAN drivers after r357004. > > Pointy hat: glebius@ I understand your frustration at the bugs introduced by this change but the passive aggressive "pointy hat" is not appropriate. It is sufficient to note the revision. Jeff > Sponsored by: Mellanox Technologies > > Modified: > head/sys/dev/bwi/if_bwi.c > head/sys/dev/bwn/if_bwn.c > head/sys/dev/ipw/if_ipw.c > head/sys/dev/iwi/if_iwi.c > head/sys/dev/iwm/if_iwm.c > head/sys/dev/iwn/if_iwn.c > head/sys/dev/malo/if_malo.c > head/sys/dev/mwl/if_mwl.c > head/sys/dev/ral/rt2560.c > head/sys/dev/ral/rt2661.c > head/sys/dev/ral/rt2860.c > head/sys/dev/rtwn/pci/rtwn_pci_rx.c > head/sys/dev/wi/if_wi.c > head/sys/dev/wpi/if_wpi.c > head/sys/dev/wtap/if_wtap.c > > Modified: head/sys/dev/bwi/if_bwi.c > ============================================================================== > --- head/sys/dev/bwi/if_bwi.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/bwi/if_bwi.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1506,6 +1506,7 @@ bwi_stop_locked(struct bwi_softc *sc, int statechg) > void > bwi_intr(void *xsc) > { > + struct epoch_tracker et; > struct bwi_softc *sc = xsc; > struct bwi_mac *mac; > uint32_t intr_status; > @@ -1625,7 +1626,9 @@ bwi_intr(void *xsc) > device_printf(sc->sc_dev, "intr noise\n"); > > if (txrx_intr_status[0] & BWI_TXRX_INTR_RX) { > + NET_EPOCH_ENTER(et); > rx_data = sc->sc_rxeof(sc); > + NET_EPOCH_EXIT(et); > if (sc->sc_flags & BWI_F_STOP) { > BWI_UNLOCK(sc); > return; > > Modified: head/sys/dev/bwn/if_bwn.c > ============================================================================== > --- head/sys/dev/bwn/if_bwn.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/bwn/if_bwn.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -5072,6 +5072,7 @@ bwn_intr(void *arg) > static void > bwn_intrtask(void *arg, int npending) > { > + struct epoch_tracker et; > struct bwn_mac *mac = arg; > struct bwn_softc *sc = mac->mac_sc; > uint32_t merged = 0; > @@ -5132,6 +5133,7 @@ bwn_intrtask(void *arg, int npending) > if (mac->mac_reason_intr & BWN_INTR_NOISESAMPLE_OK) > bwn_intr_noise(mac); > > + NET_EPOCH_ENTER(et); > if (mac->mac_flags & BWN_MAC_FLAG_DMA) { > if (mac->mac_reason[0] & BWN_DMAINTR_RX_DONE) { > bwn_dma_rx(mac->mac_method.dma.rx); > @@ -5139,6 +5141,7 @@ bwn_intrtask(void *arg, int npending) > } > } else > rx = bwn_pio_rx(&mac->mac_method.pio.rx); > + NET_EPOCH_EXIT(et); > > KASSERT(!(mac->mac_reason[1] & BWN_DMAINTR_RX_DONE), ("%s", __func__)); > KASSERT(!(mac->mac_reason[2] & BWN_DMAINTR_RX_DONE), ("%s", __func__)); > > Modified: head/sys/dev/ipw/if_ipw.c > ============================================================================== > --- head/sys/dev/ipw/if_ipw.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/ipw/if_ipw.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1159,6 +1159,7 @@ static void > ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_status *status, > struct ipw_soft_bd *sbd, struct ipw_soft_buf *sbuf) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct mbuf *mnew, *m; > struct ieee80211_node *ni; > @@ -1230,11 +1231,13 @@ ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_stat > > IPW_UNLOCK(sc); > ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void) ieee80211_input(ni, m, rssi - nf, nf); > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi - nf, nf); > + NET_EPOCH_EXIT(et); > IPW_LOCK(sc); > > bus_dmamap_sync(sc->rbd_dmat, sc->rbd_map, BUS_DMASYNC_PREWRITE); > > Modified: head/sys/dev/iwi/if_iwi.c > ============================================================================== > --- head/sys/dev/iwi/if_iwi.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/iwi/if_iwi.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1181,6 +1181,7 @@ static void > iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i, > struct iwi_frame *frame) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct mbuf *mnew, *m; > struct ieee80211_node *ni; > @@ -1270,11 +1271,13 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_dat > IWI_UNLOCK(sc); > > ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > type = ieee80211_input(ni, m, rssi, nf); > ieee80211_free_node(ni); > } else > type = ieee80211_input_all(ic, m, rssi, nf); > + NET_EPOCH_EXIT(et); > > IWI_LOCK(sc); > if (sc->sc_softled) { > > Modified: head/sys/dev/iwm/if_iwm.c > ============================================================================== > --- head/sys/dev/iwm/if_iwm.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/iwm/if_iwm.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -3465,6 +3465,7 @@ static bool > iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, > bool stolen) > { > + struct epoch_tracker et; > struct ieee80211com *ic; > struct ieee80211_frame *wh; > struct ieee80211_node *ni; > @@ -3484,6 +3485,8 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint > ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); > > IWM_UNLOCK(sc); > + > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m); > ieee80211_input_mimo(ni, m); > @@ -3492,6 +3495,8 @@ iwm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint > IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m); > ieee80211_input_mimo_all(ic, m); > } > + NET_EPOCH_EXIT(et); > + > IWM_LOCK(sc); > > return true; > > Modified: head/sys/dev/iwn/if_iwn.c > ============================================================================== > --- head/sys/dev/iwn/if_iwn.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/iwn/if_iwn.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -3031,6 +3031,7 @@ static void > iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, > struct iwn_rx_data *data) > { > + struct epoch_tracker et; > struct iwn_ops *ops = &sc->ops; > struct ieee80211com *ic = &sc->sc_ic; > struct iwn_rx_ring *ring = &sc->rxq; > @@ -3190,6 +3191,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc * > } > > IWN_UNLOCK(sc); > + NET_EPOCH_ENTER(et); > > /* Send the frame to the 802.11 layer. */ > if (ni != NULL) { > @@ -3201,6 +3203,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc * > } else > (void)ieee80211_input_all(ic, m, rssi - nf, nf); > > + NET_EPOCH_EXIT(et); > IWN_LOCK(sc); > > DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); > > Modified: head/sys/dev/malo/if_malo.c > ============================================================================== > --- head/sys/dev/malo/if_malo.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/malo/if_malo.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1939,6 +1939,7 @@ malo_set_channel(struct ieee80211com *ic) > static void > malo_rx_proc(void *arg, int npending) > { > + struct epoch_tracker et; > struct malo_softc *sc = arg; > struct ieee80211com *ic = &sc->malo_ic; > struct malo_rxbuf *bf; > @@ -2071,11 +2072,13 @@ malo_rx_proc(void *arg, int npending) > /* dispatch */ > ni = ieee80211_find_rxnode(ic, > (struct ieee80211_frame_min *)wh); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void) ieee80211_input(ni, m, rssi, ds->nf); > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi, ds->nf); > + NET_EPOCH_EXIT(et); > rx_next: > /* NB: ignore ENOMEM so we process more descriptors */ > (void) malo_rxbuf_init(sc, bf); > > Modified: head/sys/dev/mwl/if_mwl.c > ============================================================================== > --- head/sys/dev/mwl/if_mwl.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/mwl/if_mwl.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -2608,6 +2608,7 @@ cvtrssi(uint8_t ssi) > static void > mwl_rx_proc(void *arg, int npending) > { > + struct epoch_tracker et; > struct mwl_softc *sc = arg; > struct ieee80211com *ic = &sc->sc_ic; > struct mwl_rxbuf *bf; > @@ -2796,6 +2797,8 @@ mwl_rx_proc(void *arg, int npending) > /* dispatch */ > ni = ieee80211_find_rxnode(ic, > (const struct ieee80211_frame_min *) wh); > + > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > mn = MWL_NODE(ni); > #ifdef MWL_ANT_INFO_SUPPORT > @@ -2811,6 +2814,7 @@ mwl_rx_proc(void *arg, int npending) > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi, nf); > + NET_EPOCH_EXIT(et); > rx_next: > /* NB: ignore ENOMEM so we process more descriptors */ > (void) mwl_rxbuf_init(sc, bf); > > Modified: head/sys/dev/ral/rt2560.c > ============================================================================== > --- head/sys/dev/ral/rt2560.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/ral/rt2560.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1086,6 +1086,7 @@ rt2560_prio_intr(struct rt2560_softc *sc) > static void > rt2560_decryption_intr(struct rt2560_softc *sc) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct rt2560_rx_desc *desc; > struct rt2560_rx_data *data; > @@ -1196,12 +1197,13 @@ rt2560_decryption_intr(struct rt2560_softc *sc) > wh = mtod(m, struct ieee80211_frame *); > ni = ieee80211_find_rxnode(ic, > (struct ieee80211_frame_min *)wh); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void) ieee80211_input(ni, m, rssi, nf); > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi, nf); > - > + NET_EPOCH_EXIT(et); > RAL_LOCK(sc); > sc->sc_flags &= ~RT2560_F_INPUT_RUNNING; > skip: desc->flags = htole32(RT2560_RX_BUSY); > > Modified: head/sys/dev/ral/rt2661.c > ============================================================================== > --- head/sys/dev/ral/rt2661.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/ral/rt2661.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -958,6 +958,7 @@ rt2661_tx_dma_intr(struct rt2661_softc *sc, struct rt2 > static void > rt2661_rx_intr(struct rt2661_softc *sc) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct rt2661_rx_desc *desc; > struct rt2661_rx_data *data; > @@ -1074,11 +1075,13 @@ rt2661_rx_intr(struct rt2661_softc *sc) > /* send the frame to the 802.11 layer */ > ni = ieee80211_find_rxnode(ic, > (struct ieee80211_frame_min *)wh); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void) ieee80211_input(ni, m, rssi, nf); > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi, nf); > + NET_EPOCH_EXIT(et); > > RAL_LOCK(sc); > sc->sc_flags &= ~RAL_INPUT_RUNNING; > > Modified: head/sys/dev/ral/rt2860.c > ============================================================================== > --- head/sys/dev/ral/rt2860.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/ral/rt2860.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1179,6 +1179,7 @@ rt2860_maxrssi_chain(struct rt2860_softc *sc, const st > static void > rt2860_rx_intr(struct rt2860_softc *sc) > { > + struct epoch_tracker et; > struct rt2860_rx_radiotap_header *tap; > struct ieee80211com *ic = &sc->sc_ic; > struct ieee80211_frame *wh; > @@ -1326,11 +1327,13 @@ rt2860_rx_intr(struct rt2860_softc *sc) > /* send the frame to the 802.11 layer */ > ni = ieee80211_find_rxnode(ic, > (struct ieee80211_frame_min *)wh); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void)ieee80211_input(ni, m, rssi - nf, nf); > ieee80211_free_node(ni); > } else > (void)ieee80211_input_all(ic, m, rssi - nf, nf); > + NET_EPOCH_EXIT(et); > > RAL_LOCK(sc); > > > Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c > ============================================================================== > --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > @@ -85,6 +86,7 @@ rtwn_pci_setup_rx_desc(struct rtwn_pci_softc *pc, > static void > rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) > { > + struct epoch_tracker et; > struct rtwn_softc *sc = &pc->pc_sc; > struct rtwn_rx_ring *ring = &pc->rx_ring; > struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; > @@ -164,12 +166,15 @@ rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) > > /* Send the frame to the 802.11 layer. */ > RTWN_UNLOCK(sc); > + > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void)ieee80211_input_mimo(ni, m); > /* Node is no longer needed. */ > ieee80211_free_node(ni); > } else > (void)ieee80211_input_mimo_all(ic, m); > + NET_EPOCH_EXIT(et); > > RTWN_LOCK(sc); > > > Modified: head/sys/dev/wi/if_wi.c > ============================================================================== > --- head/sys/dev/wi/if_wi.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/wi/if_wi.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1254,6 +1254,7 @@ wi_sync_bssid(struct wi_softc *sc, u_int8_t new_bssid[ > static __noinline void > wi_rx_intr(struct wi_softc *sc) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct wi_frame frmhdr; > struct mbuf *m; > @@ -1349,11 +1350,14 @@ wi_rx_intr(struct wi_softc *sc) > WI_UNLOCK(sc); > > ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); > + > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > (void) ieee80211_input(ni, m, rssi, nf); > ieee80211_free_node(ni); > } else > (void) ieee80211_input_all(ic, m, rssi, nf); > + NET_EPOCH_EXIT(et); > > WI_LOCK(sc); > } > > Modified: head/sys/dev/wpi/if_wpi.c > ============================================================================== > --- head/sys/dev/wpi/if_wpi.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/wpi/if_wpi.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -1909,6 +1909,7 @@ static void > wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc, > struct wpi_rx_data *data) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct wpi_rx_ring *ring = &sc->rxq; > struct wpi_rx_stat *stat; > @@ -2028,6 +2029,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc * > } > > WPI_UNLOCK(sc); > + NET_EPOCH_ENTER(et); > > /* Send the frame to the 802.11 layer. */ > if (ni != NULL) { > @@ -2037,6 +2039,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc * > } else > (void)ieee80211_input_all(ic, m, stat->rssi, WPI_RSSI_OFFSET); > > + NET_EPOCH_EXIT(et); > WPI_LOCK(sc); > > return; > > Modified: head/sys/dev/wtap/if_wtap.c > ============================================================================== > --- head/sys/dev/wtap/if_wtap.c Thu Jan 30 09:56:57 2020 (r357290) > +++ head/sys/dev/wtap/if_wtap.c Thu Jan 30 10:28:01 2020 (r357291) > @@ -451,6 +451,7 @@ wtap_inject(struct wtap_softc *sc, struct mbuf *m) > void > wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) > { > + struct epoch_tracker et; > struct ieee80211com *ic = &sc->sc_ic; > struct ieee80211_node *ni; > int type; > @@ -472,6 +473,7 @@ wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) > */ > ni = ieee80211_find_rxnode_withkey(ic, > mtod(m, const struct ieee80211_frame_min *),IEEE80211_KEYIX_NONE); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > /* > * Sending station is known, dispatch directly. > @@ -481,11 +483,13 @@ wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) > } else { > type = ieee80211_input_all(ic, m, 1<<7, 10); > } > + NET_EPOCH_EXIT(et); > } > > static void > wtap_rx_proc(void *arg, int npending) > { > + struct epoch_tracker et; > struct wtap_softc *sc = (struct wtap_softc *)arg; > struct ieee80211com *ic = &sc->sc_ic; > struct mbuf *m; > @@ -526,6 +530,7 @@ wtap_rx_proc(void *arg, int npending) > ni = ieee80211_find_rxnode_withkey(ic, > mtod(m, const struct ieee80211_frame_min *), > IEEE80211_KEYIX_NONE); > + NET_EPOCH_ENTER(et); > if (ni != NULL) { > /* > * Sending station is known, dispatch directly. > @@ -535,7 +540,8 @@ wtap_rx_proc(void *arg, int npending) > } else { > type = ieee80211_input_all(ic, m, 1<<7, 10); > } > - > + NET_EPOCH_EXIT(et); > + > /* The mbufs are freed by the Net80211 stack */ > free(bf, M_WTAP_RXBUF); > } > From owner-svn-src-all@freebsd.org Thu Jan 30 20:43:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12CFD1FE5F5; Thu, 30 Jan 2020 20:43:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 487skh4sMcz4dV1; Thu, 30 Jan 2020 20:43:23 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00UKhMNr057207 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 30 Jan 2020 12:43:22 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00UKhMgq057206; Thu, 30 Jan 2020 12:43:22 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 30 Jan 2020 12:43:22 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap Message-ID: <20200130204322.GJ1268@FreeBSD.org> References: <202001301028.00UAS1s1063130@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001301028.00UAS1s1063130@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 487skh4sMcz4dV1 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:43:25 -0000 On Thu, Jan 30, 2020 at 10:28:01AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Thu Jan 30 10:28:01 2020 H> New Revision: 357291 H> URL: https://svnweb.freebsd.org/changeset/base/357291 H> H> Log: H> Widen EPOCH(9) usage in PCI WLAN drivers. H> H> Make sure all occurrences of ieee80211_input_xxx() in sys/dev are H> covered by a network epoch section. Do not depend on the interrupt H> handler nor any taskqueues being in a network epoch section. H> H> This patch should unbreak the PCI WLAN drivers after r357004. H> H> Pointy hat: glebius@ H> Sponsored by: Mellanox Technologies Hey, I have reviewed all of them. The following drivers were not broken, and your change does 100% recursive epoch_enter: bwi, ipw, iwi, iwm, iwn, ral, rtwn, wi, wpi The following drivers use taskq and would be fixed by D23408: bwn, malo, mwl, wtap P.S. A funny note about wtap. You modified even a function that is a dead code - wtap_rx_deliver(). Gives some clue on quality of your sweep over all drivers. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 30 20:51:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6048F1FE7E8 for ; Thu, 30 Jan 2020 20:51:28 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 487svz4vGvz4f04 for ; Thu, 30 Jan 2020 20:51:27 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pg1-x541.google.com with SMTP id j4so2277651pgi.1 for ; Thu, 30 Jan 2020 12:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=lNJXXJVgisz+eNZ7HJMPfNGPQ3CJY70H3/D8rEVQvnM=; b=SZctwgSVrgxxo5EaxTNW0V7gMloWz3i/0NWaiLG4q+5QAZsUqH4ucnJ/9APWVoCH9w zlNXDdgYHCKLtVmGkybtSsC4VFgZo3enFOYu5/2QRZbbvIRGDE9ukjuAaq5RhdJ15PtP M3zDObSFFSRmMXog1WXs9kvsAmXx31VW0rmjLaK81nniSvtzURpN1pt3P7xr7QRfI34N 3FCB0pT9d+Yrfv7LOfNBLwxB+1ndeHBTdxcgXrqQZn0xAMe5zZ0e8EpUdf5cdq0SAxlZ JFLGB/QqDi5Jc0V2bJDRqZzZlOd1D9zwECQoLCvc2FhX6LoRzaFqg0A8SgG/s0aNDVZy Z6zQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=lNJXXJVgisz+eNZ7HJMPfNGPQ3CJY70H3/D8rEVQvnM=; b=eaQUICvFZ0JSX0W7M7arC9dwzwD4WPWeW9ktm2G0AFz9xj/wZJDSRShjSf/XjHN72m mJfk+vxrtdbJGIFaNWTyEvKGxTPOoCuxe+8cDOI7gr/BdXRURyxllpcRaU8ar4fxYyqw Wd0n8LDgYM3QxDdu31vKyNVv0eHYSB+Zr+SBtkbJUEQ9NXksnvPONF5LitxZQF1nU5yF OuoZqPR/iPPvS39zFxjYotaYXP4cyoocrEBZaiU6QudYneS1FZapMcI/Q7a3+3Kkn8C9 q9Lxt7yTYpQEptVsSxhd39EQprWHiQyJOlgSBb5uhACq/HqE7DDSVrim2eeMz857wp10 3YsQ== X-Gm-Message-State: APjAAAUJGX3UWiICbRjHtpOHF2gm8CE/K7Qb21atF0EHxIDQZfQiPbh9 SQdQ7qtOLqAUrlqHPDTqsHemlw== X-Google-Smtp-Source: APXvYqyq64SLt0j42UL5Ek677+5T+40uGBfmp8OvqBCoya/dBYenNx84m/2JT+65YBrBZhZcV/DbtQ== X-Received: by 2002:a62:1883:: with SMTP id 125mr6684199pfy.166.1580417485840; Thu, 30 Jan 2020 12:51:25 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id h3sm7257423pji.9.2020.01.30.12.51.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jan 2020 12:51:25 -0800 (PST) Date: Thu, 30 Jan 2020 10:51:23 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap In-Reply-To: <20200130204322.GJ1268@FreeBSD.org> Message-ID: References: <202001301028.00UAS1s1063130@repo.freebsd.org> <20200130204322.GJ1268@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 487svz4vGvz4f04 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=SZctwgSV; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::541) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.91)[ip: (-0.71), ipnet: 2607:f8b0::/32(-2.03), asn: 15169(-1.78), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:51:28 -0000 On Thu, 30 Jan 2020, Gleb Smirnoff wrote: > On Thu, Jan 30, 2020 at 10:28:01AM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Thu Jan 30 10:28:01 2020 > H> New Revision: 357291 > H> URL: https://svnweb.freebsd.org/changeset/base/357291 > H> > H> Log: > H> Widen EPOCH(9) usage in PCI WLAN drivers. > H> > H> Make sure all occurrences of ieee80211_input_xxx() in sys/dev are > H> covered by a network epoch section. Do not depend on the interrupt > H> handler nor any taskqueues being in a network epoch section. > H> > H> This patch should unbreak the PCI WLAN drivers after r357004. > H> > H> Pointy hat: glebius@ > H> Sponsored by: Mellanox Technologies > > Hey, I have reviewed all of them. > > The following drivers were not broken, and your change does 100% > recursive epoch_enter: > > bwi, ipw, iwi, iwm, iwn, ral, rtwn, wi, wpi > > The following drivers use taskq and would be fixed by D23408: > > bwn, malo, mwl, wtap > > P.S. A funny note about wtap. You modified even a function that > is a dead code - wtap_rx_deliver(). Gives some clue on quality > of your sweep over all drivers. I would strongly suggest that we not make more changes to this area without a discussion on a review to make sure we're all in agreement. There are some fine technical details which would benefit from multiple eyes and failing to act together is creating more conflict than is necessary. I volunteer to be on the reviews as an impartial third party. Thanks, Jeff > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Thu Jan 30 20:56:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DACD1FEB57; Thu, 30 Jan 2020 20:56:32 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 487t1q5r8lz4fDv; Thu, 30 Jan 2020 20:56:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00UKuTS4057287 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 30 Jan 2020 12:56:29 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00UKuTAI057286; Thu, 30 Jan 2020 12:56:29 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 30 Jan 2020 12:56:29 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357293 - head/sys/net Message-ID: <20200130205629.GK1268@FreeBSD.org> References: <202001301204.00UC43Rw022059@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001301204.00UC43Rw022059@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 487t1q5r8lz4fDv X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:56:32 -0000 On Thu, Jan 30, 2020 at 12:04:03PM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Thu Jan 30 12:04:02 2020 H> New Revision: 357293 H> URL: https://svnweb.freebsd.org/changeset/base/357293 H> H> Log: H> Widen EPOCH(9) usage in netisr. H> H> Software interrupt handlers are allowed to sleep. In swi_net() there H> is a read lock behind NETISR_RLOCK() which in turn ends up calling H> msleep() which means the whole of swi_net() cannot be protected by an H> EPOCH(9) section. By default the NETISR_LOCKING feature is disabled. H> H> This issue was introduced by r357004. This is a preparation step for H> replacing the functionality provided by r357004. H> H> Found by: kib@ H> Sponsored by: Mellanox Technologies What?! NETISR_RLOCK() which in turn ends up calling msleep()? Can you please explain this nonsense? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 30 20:57:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92BE51FEC07; Thu, 30 Jan 2020 20:57:41 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 487t381RKSz4fNw; Thu, 30 Jan 2020 20:57:39 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00UKvbFE057302 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 30 Jan 2020 12:57:37 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00UKvbOe057301; Thu, 30 Jan 2020 12:57:37 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 30 Jan 2020 12:57:37 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357291 - in head/sys/dev: bwi bwn ipw iwi iwm iwn malo mwl ral rtwn/pci wi wpi wtap Message-ID: <20200130205737.GL1268@FreeBSD.org> References: <202001301028.00UAS1s1063130@repo.freebsd.org> <20200130204322.GJ1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 487t381RKSz4fNw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.83 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.96)[-0.960,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.87)[-0.872,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 20:57:41 -0000 On Thu, Jan 30, 2020 at 10:51:23AM -1000, Jeff Roberson wrote: J> On Thu, 30 Jan 2020, Gleb Smirnoff wrote: J> J> > On Thu, Jan 30, 2020 at 10:28:01AM +0000, Hans Petter Selasky wrote: J> > H> Author: hselasky J> > H> Date: Thu Jan 30 10:28:01 2020 J> > H> New Revision: 357291 J> > H> URL: https://svnweb.freebsd.org/changeset/base/357291 J> > H> J> > H> Log: J> > H> Widen EPOCH(9) usage in PCI WLAN drivers. J> > H> J> > H> Make sure all occurrences of ieee80211_input_xxx() in sys/dev are J> > H> covered by a network epoch section. Do not depend on the interrupt J> > H> handler nor any taskqueues being in a network epoch section. J> > H> J> > H> This patch should unbreak the PCI WLAN drivers after r357004. J> > H> J> > H> Pointy hat: glebius@ J> > H> Sponsored by: Mellanox Technologies J> > J> > Hey, I have reviewed all of them. J> > J> > The following drivers were not broken, and your change does 100% J> > recursive epoch_enter: J> > J> > bwi, ipw, iwi, iwm, iwn, ral, rtwn, wi, wpi J> > J> > The following drivers use taskq and would be fixed by D23408: J> > J> > bwn, malo, mwl, wtap J> > J> > P.S. A funny note about wtap. You modified even a function that J> > is a dead code - wtap_rx_deliver(). Gives some clue on quality J> > of your sweep over all drivers. J> J> I would strongly suggest that we not make more changes to this area J> without a discussion on a review to make sure we're all in agreement. J> There are some fine technical details which would benefit from multiple J> eyes and failing to act together is creating more conflict than is J> necessary. I volunteer to be on the reviews as an impartial third party. Don't worry, I'm not going to participate in the commit war Hans started. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 30 21:09:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF44E1FF1AB for ; Thu, 30 Jan 2020 21:09:51 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0: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 487tKC1zLNz4g20 for ; Thu, 30 Jan 2020 21:09:51 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf1-x442.google.com with SMTP id 4so2116842pfz.9 for ; Thu, 30 Jan 2020 13:09:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=2eJE1u5aSy2CaM4+lwy2L/ECnB3wcS58D5RhiPrA5tc=; b=f0BUWt0iolnS5ObLadlO15KkdJjN+QxvPoNysUeoKTZEP1TSywDOtRQK22ReOuzyN1 sSfol7kxa3Yk0xaKbXnDTHdYB9l19AP26nD+nMjsniEzZJ3r2GH4lZSLuVCMy84n4g9E 5gOzUc3qsaoOJPNmQ/MMj6Vys+LnUCLiCyqbtW7MA/im5ICxM0xhMGCWnwpKwYvVYbFt p8Xg3oj6YN0LrVNGNnmAsXCYO62TLGkC+U+X14YY2/a9z0XKZoi1egvU+RpJihI+ZT0Q 312aRmjmRAxnEf804XZv4RodOC9hPQHHw0bou4DTuK14QYMZO8j7j2/Xgn2r86SljZxO HdPg== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=2eJE1u5aSy2CaM4+lwy2L/ECnB3wcS58D5RhiPrA5tc=; b=SuJi6p5mwDa0bb6ss/U3QVCWCBt0ZJwMd0nxMsdG3M6VBMOaaIhbPbrb/hgCv/HeVi VtuqA2uUozLV8h1IFhE+21IjeocuAj9xGj9qWzvXzJtU3YsJVFP7o08WNSl+OvlHMZKr CxJ49DkcS95J2yp5B+OgNtcLOqEeWKVkXH3aT0/SBcO2YWb367INvXWe3+nqInGLNfjZ 4ApKjQFNop65ZzmpbJ791G1Oks/zoTdJMycUfoXQoX4p2EuL0n2Q5QxickZf3ppUNoL7 hsMe0Jx6GtmBLOSZemgnoi7JB9/4cBMqzdIbOQsukAzZU181G+zq/b3y59zVPtp+NVPz HfnA== X-Gm-Message-State: APjAAAV4pql15KuWwXjFGDf7fICrG2ElP1q3OvgWHaE6JAl1il3aaCFn +KUlwdlpxPdbhQR4cdeSuDU7fw== X-Google-Smtp-Source: APXvYqysVTyKOSJ9la5HUzvOdoCC8u45b5/48tY2qUG9kYGr5IXLa8nvzN0t4bJpgTVi+9OE4Gj9iQ== X-Received: by 2002:a63:cb47:: with SMTP id m7mr6639701pgi.309.1580418589813; Thu, 30 Jan 2020 13:09:49 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id g7sm7813603pfq.33.2020.01.30.13.09.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jan 2020 13:09:49 -0800 (PST) Date: Thu, 30 Jan 2020 11:09:42 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357293 - head/sys/net In-Reply-To: <20200130205629.GK1268@FreeBSD.org> Message-ID: References: <202001301204.00UC43Rw022059@repo.freebsd.org> <20200130205629.GK1268@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 487tKC1zLNz4g20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=f0BUWt0i; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::442) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.70 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; 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.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.90)[ip: (-0.65), ipnet: 2607:f8b0::/32(-2.03), asn: 15169(-1.78), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 21:09:52 -0000 On Thu, 30 Jan 2020, Gleb Smirnoff wrote: > On Thu, Jan 30, 2020 at 12:04:03PM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Thu Jan 30 12:04:02 2020 > H> New Revision: 357293 > H> URL: https://svnweb.freebsd.org/changeset/base/357293 > H> > H> Log: > H> Widen EPOCH(9) usage in netisr. > H> > H> Software interrupt handlers are allowed to sleep. In swi_net() there > H> is a read lock behind NETISR_RLOCK() which in turn ends up calling > H> msleep() which means the whole of swi_net() cannot be protected by an > H> EPOCH(9) section. By default the NETISR_LOCKING feature is disabled. > H> > H> This issue was introduced by r357004. This is a preparation step for > H> replacing the functionality provided by r357004. > H> > H> Found by: kib@ > H> Sponsored by: Mellanox Technologies > > What?! NETISR_RLOCK() which in turn ends up calling msleep()? Can you please > explain this nonsense? It does not look like NETISR_RLOCK is configured as sleepable so it just uses a mtx. Jeff > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Thu Jan 30 21:12:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A977B1FF346; Thu, 30 Jan 2020 21:12:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 487tN244dfz3Bqq; Thu, 30 Jan 2020 21:12:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 505A92600F6; Thu, 30 Jan 2020 22:12:09 +0100 (CET) Subject: Re: svn commit: r357293 - head/sys/net To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001301204.00UC43Rw022059@repo.freebsd.org> <20200130205629.GK1268@FreeBSD.org> From: Hans Petter Selasky Message-ID: <1bd0ae2c-3b5a-dfd7-747b-75af6f8d4d03@selasky.org> Date: Thu, 30 Jan 2020 22:09:45 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200130205629.GK1268@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 487tN244dfz3Bqq X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 21:12:18 -0000 On 2020-01-30 21:56, Gleb Smirnoff wrote: > On Thu, Jan 30, 2020 at 12:04:03PM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Thu Jan 30 12:04:02 2020 > H> New Revision: 357293 > H> URL: https://svnweb.freebsd.org/changeset/base/357293 > H> > H> Log: > H> Widen EPOCH(9) usage in netisr. > H> > H> Software interrupt handlers are allowed to sleep. In swi_net() there > H> is a read lock behind NETISR_RLOCK() which in turn ends up calling > H> msleep() which means the whole of swi_net() cannot be protected by an > H> EPOCH(9) section. By default the NETISR_LOCKING feature is disabled. > H> > H> This issue was introduced by r357004. This is a preparation step for > H> replacing the functionality provided by r357004. > H> > H> Found by: kib@ > H> Sponsored by: Mellanox Technologies > > What?! NETISR_RLOCK() which in turn ends up calling msleep()? Can you please > explain this nonsense? > See rms_rlock_fallback() in kern_rmlock.c . --HPS From owner-svn-src-all@freebsd.org Thu Jan 30 21:14:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC20E1FF5C0 for ; Thu, 30 Jan 2020 21:14:27 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (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 487tQV5RkTz3C4g for ; Thu, 30 Jan 2020 21:14:26 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pl1-x62c.google.com with SMTP id b22so1809352pls.12 for ; Thu, 30 Jan 2020 13:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=mK7je99l1WH3SlaRe1g9ESQocfMDfltdN8N7FcCRf0M=; b=cSZFJWziJkVtzYYW0RidLFTuqAJUHgpnPeMcJN0JImwTbtqcZJOVLaIVKVe/WhUBvL mC6HfPusH5FGv+/yf3HgZyZ2uet6HYY1xu/ASTInKebPajAEP496otPuGd0k2i1dhK6d S2tB2n0gR08tuP+/9l7EiHx5EKSBwRWMC/D3PN1wttUftsDfujgkSIRzn1wgspyKNgjN nb7aTcfn+5KFXHBBMUd5b0xqU7t+noXql23IZW3f8qqiPvkJzHvyIltpzmSRXNydw2eD jYTvXJAfU7c/x5Hdsf0Et4zTcdWKp7XjOKhTETT6gzcrXlSk2PaiMym4BwD7dfx61khe 1onA== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=mK7je99l1WH3SlaRe1g9ESQocfMDfltdN8N7FcCRf0M=; b=RmJV1DJsmdNemYm/wByRRg140Acx6+GtnsCcQiCC3dmuSyzWM/oajMYVqUW5ygfSg1 vB9Jnxxgma5H24tCIG81NdtRVdOmO7dB1hkCh6CXiTFsWDtoCfkiHgmideO7Dmsqrd+s n7zbW1aamxFnJkmS8RkpdS3OFGqL4s4t9/VVIhBpvBeFoCmUqVUSbMo4RQuxpkOFW8sP N2UeE/o6OYAexf7HiPglz3URV6RYQSFAdEGg+wcUDd/6oJOmEHbeeRWk37vUJZt8bRdP fElKP+NOV/+4RujTHfa18IWlbXrj/JqJ+EAFffLfIRja9r8bjFACEKWrRY0gKeJhheSL rvDQ== X-Gm-Message-State: APjAAAXGfNwc5IqFmdK7I4IQn1bjM96jarA15920q/tFsTmHPXS/b4MP 9a3gXoetpIZ98hM3Pztb2NLQmgs56q8= X-Google-Smtp-Source: APXvYqzBHkga2XR9IpLcx/WCMyok3csM4tMw4CeTGcRekRgCjUD3RQGLHnxN+zLX1OTS/jPuWalIRA== X-Received: by 2002:a17:90a:ff15:: with SMTP id ce21mr8106339pjb.124.1580418865382; Thu, 30 Jan 2020 13:14:25 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id y3sm7738807pff.52.2020.01.30.13.14.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jan 2020 13:14:24 -0800 (PST) Date: Thu, 30 Jan 2020 11:14:22 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Hans Petter Selasky cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357293 - head/sys/net In-Reply-To: <1bd0ae2c-3b5a-dfd7-747b-75af6f8d4d03@selasky.org> Message-ID: References: <202001301204.00UC43Rw022059@repo.freebsd.org> <20200130205629.GK1268@FreeBSD.org> <1bd0ae2c-3b5a-dfd7-747b-75af6f8d4d03@selasky.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 487tQV5RkTz3C4g X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=cSZFJWzi; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::62c) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-4.28 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[c.2.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.48)[ip: (-8.55), ipnet: 2607:f8b0::/32(-2.03), asn: 15169(-1.78), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 21:14:27 -0000 On Thu, 30 Jan 2020, Hans Petter Selasky wrote: > On 2020-01-30 21:56, Gleb Smirnoff wrote: >> On Thu, Jan 30, 2020 at 12:04:03PM +0000, Hans Petter Selasky wrote: >> H> Author: hselasky >> H> Date: Thu Jan 30 12:04:02 2020 >> H> New Revision: 357293 >> H> URL: https://svnweb.freebsd.org/changeset/base/357293 >> H> >> H> Log: >> H> Widen EPOCH(9) usage in netisr. >> H> >> H> Software interrupt handlers are allowed to sleep. In swi_net() there >> H> is a read lock behind NETISR_RLOCK() which in turn ends up calling >> H> msleep() which means the whole of swi_net() cannot be protected by an >> H> EPOCH(9) section. By default the NETISR_LOCKING feature is disabled. >> H> >> H> This issue was introduced by r357004. This is a preparation step for >> H> replacing the functionality provided by r357004. >> H> >> H> Found by: kib@ >> H> Sponsored by: Mellanox Technologies >> >> What?! NETISR_RLOCK() which in turn ends up calling msleep()? Can you >> please >> explain this nonsense? >> > > See rms_rlock_fallback() in kern_rmlock.c . The network stack uses rm_ not rms_. Jeff > > --HPS > From owner-svn-src-all@freebsd.org Thu Jan 30 22:19:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A65A42290FA; Thu, 30 Jan 2020 22:19:49 +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 487vsx1t9Vz3G0N; Thu, 30 Jan 2020 22:19:49 +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 3BCA64132; Thu, 30 Jan 2020 22:19:49 +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 00UMJn4m088602; Thu, 30 Jan 2020 22:19:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00UMJnN5088601; Thu, 30 Jan 2020 22:19:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001302219.00UMJnN5088601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 30 Jan 2020 22:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357313 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 22:19:49 -0000 Author: jhb Date: Thu Jan 30 22:19:48 2020 New Revision: 357313 URL: https://svnweb.freebsd.org/changeset/base/357313 Log: Trim duplicate CSR swaps from user exceptions. The stack pointer is swapped with the sscratch CSR just before the jump to cpu_exception_handler_user where the first instruction swaps it again. The two swaps together are a no-op, but the csr swap instructions can be expensive (e.g. on Bluespec RISC-V cores csr swap instructions force a full pipeline stall). Reported by: jrtc27 Reviewed by: br MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23394 Modified: head/sys/riscv/riscv/exception.S Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Thu Jan 30 20:05:05 2020 (r357312) +++ head/sys/riscv/riscv/exception.S Thu Jan 30 22:19:48 2020 (r357313) @@ -208,7 +208,6 @@ ENTRY(cpu_exception_handler) csrrw sp, sscratch, sp beqz sp, 1f /* User mode detected */ - csrrw sp, sscratch, sp j cpu_exception_handler_user 1: /* Supervisor mode detected */ @@ -225,7 +224,6 @@ ENTRY(cpu_exception_handler_supervisor) END(cpu_exception_handler_supervisor) ENTRY(cpu_exception_handler_user) - csrrw sp, sscratch, sp save_registers 0 mv a0, sp call _C_LABEL(do_trap_user) From owner-svn-src-all@freebsd.org Thu Jan 30 22:47:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8267229F12; Thu, 30 Jan 2020 22:47:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from ecc05.stack.nl (ws0.zlo.nu [190.2.135.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.stack.nl", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487wTl1v9Kz3HYd; Thu, 30 Jan 2020 22:47:22 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail03.stack.nl (blade.stack.nl [51.15.111.152]) by ecc05.stack.nl (Postfix) with ESMTPS id 9E352100267; Thu, 30 Jan 2020 23:47:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=stack.nl; s=mail; t=1580424435; bh=ggpGnMtQxZmZOowq7r37cVV7LNLjdfz6n2W4gppPzzU=; h=From:Subject:To:References:Date:In-Reply-To:From; b=RnJ8EUalXXTe23jYp/lvJIX1CeEPCX/0vwsT2OW3ZbZA41Ut1IKzaEtkObUOWOTH5 zYJi5SQsZue5qhumiibJ8AinGt2YiRFrFqcF2STvoJegMJhUPCfaSn8bYAKLExLzyi f98FQaJeH9N1Dt2p3GqJQzr7dF9hMu2U4UVv4rF621VBO4z3VS2X9sqXoNuGmQjAGF oYEKwarnl7PCnDefhs4ah/Ctf3/4kAbDAnnQkQyS9icrzIbpW8wXobOYavgsSpmpeD ZQNhXFNjoFOI4//TEEY6vcb43Rlf8A8cQyXrvW1F1pcSJg/Nw1bCpD4DiVPX6ZMcCA xFnvt2bNFq7NA== Received: from localhost (localhost.localdomain [127.0.0.1]) by mail03.stack.nl (Postfix) with ESMTP id 667D72E6; Thu, 30 Jan 2020 22:47:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail03.stack.nl Received: from mail03.stack.nl ([127.0.0.1]) by localhost (mail03.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xUlQ-TWfczVO; Thu, 30 Jan 2020 22:47:12 +0000 (UTC) Received: from lion.tjoelker.org (unknown [193.84.188.49]) by mail03.stack.nl (Postfix) with ESMTPSA id AB06816C; Thu, 30 Jan 2020 22:47:12 +0000 (UTC) From: Jilles Tjoelker Subject: Re: svn commit: r357138 - head/bin/pwait To: Pawel Jakub Dawidek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001261049.00QAnORw063681@repo.freebsd.org> Message-ID: <6cb2e1c2-f81d-7e06-80a3-a0d7fee00c6a@stack.nl> Date: Thu, 30 Jan 2020 23:47:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001261049.00QAnORw063681@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 487wTl1v9Kz3HYd X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stack.nl header.s=mail header.b=RnJ8EUal; dmarc=none; spf=pass (mx1.freebsd.org: domain of jilles@stack.nl designates 190.2.135.243 as permitted sender) smtp.mailfrom=jilles@stack.nl X-Spamd-Result: default: False [-3.17 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[stack.nl:s=mail]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:190.2.135.243]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[stack.nl]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.67)[ip: (-1.76), ipnet: 190.2.128.0/20(-0.88), asn: 49981(-0.73), country: NL(0.03)]; DKIM_TRACE(0.00)[stack.nl:+]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:49981, ipnet:190.2.128.0/20, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 22:47:24 -0000 On 26-01-2020 11:49, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sun Jan 26 10:49:24 2020 > New Revision: 357138 > URL: https://svnweb.freebsd.org/changeset/base/357138 > > Log: > - Be consistent with using sysexits(3) codes. > - Turn fprintf()+exit() into errx(). > > Sponsored by: Fudo Security > > Modified: > head/bin/pwait/pwait.c > > Modified: head/bin/pwait/pwait.c > ============================================================================== > --- head/bin/pwait/pwait.c Sun Jan 26 07:24:49 2020 (r357137) > +++ head/bin/pwait/pwait.c Sun Jan 26 10:49:24 2020 (r357138) > @@ -53,8 +53,7 @@ static void > usage(void) > { > > - fprintf(stderr, "usage: pwait [-t timeout] [-v] pid ...\n"); > - exit(EX_USAGE); > + errx(EX_USAGE, "usage: pwait [-t timeout] [-v] pid ..."); This adds a "pwait: " before the line, which most other programs do not do. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Fri Jan 31 00:49:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCF7E22DB28; Fri, 31 Jan 2020 00:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487zC44VcTz3P7j; Fri, 31 Jan 2020 00:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954CA5D2B; Fri, 31 Jan 2020 00:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V0nq0M077231; Fri, 31 Jan 2020 00:49:52 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V0np1a077223; Fri, 31 Jan 2020 00:49:51 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001310049.00V0np1a077223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 31 Jan 2020 00:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357314 - in head/sys: conf kern sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: conf kern sys vm X-SVN-Commit-Revision: 357314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 00:49:52 -0000 Author: jeff Date: Fri Jan 31 00:49:51 2020 New Revision: 357314 URL: https://svnweb.freebsd.org/changeset/base/357314 Log: Implement a safe memory reclamation feature that is tightly coupled with UMA. This is in the same family of algorithms as Epoch/QSBR/RCU/PARSEC but is a unique algorithm. This has 3x the performance of epoch in a write heavy workload with less than half of the read side cost. The memory overhead is significantly lessened by limiting the free-to-use latency. A synthetic test uses 1/20th of the memory vs Epoch. There is significant further discussion in the comments and code review. This code should be considered experimental. I will write a man page after it has settled. After further validation the VM will begin using this feature to permit lockless page lookups. Both markj and cperciva tested on arm64 at large core counts to verify fences on weaker ordering architectures. I will commit a stress testing tool in a follow-up. Reviewed by: mmacy, markj, rlibby, hselasky Discussed with: sbahara Differential Revision: https://reviews.freebsd.org/D22586 Added: head/sys/kern/subr_smr.c (contents, props changed) head/sys/sys/_smr.h (contents, props changed) head/sys/sys/smr.h (contents, props changed) Modified: head/sys/conf/files head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 30 22:19:48 2020 (r357313) +++ head/sys/conf/files Fri Jan 31 00:49:51 2020 (r357314) @@ -3848,6 +3848,7 @@ kern/subr_scanf.c standard kern/subr_sglist.c standard kern/subr_sleepqueue.c standard kern/subr_smp.c standard +kern/subr_smr.c standard kern/subr_stack.c optional ddb | stack | ktr kern/subr_stats.c optional stats kern/subr_taskqueue.c standard Added: head/sys/kern/subr_smr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_smr.c Fri Jan 31 00:49:51 2020 (r357314) @@ -0,0 +1,387 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * This is a novel safe memory reclamation technique inspired by + * epoch based reclamation from Samy Al Bahra's concurrency kit which + * in turn was based on work described in: + * Fraser, K. 2004. Practical Lock-Freedom. PhD Thesis, University + * of Cambridge Computing Laboratory. + * And shares some similarities with: + * Wang, Stamler, Parmer. 2016 Parallel Sections: Scaling System-Level + * Data-Structures + * + * This is not an implementation of hazard pointers or related + * techniques. The term safe memory reclamation is used as a + * generic descriptor for algorithms that defer frees to avoid + * use-after-free errors with lockless datastructures. + * + * The basic approach is to maintain a monotonic write sequence + * number that is updated on some application defined granularity. + * Readers record the most recent write sequence number they have + * observed. A shared read sequence number records the lowest + * sequence number observed by any reader as of the last poll. Any + * write older than this value has been observed by all readers + * and memory can be reclaimed. Like Epoch we also detect idle + * readers by storing an invalid sequence number in the per-cpu + * state when the read section exits. Like Parsec we establish + * a global write clock that is used to mark memory on free. + * + * The write and read sequence numbers can be thought of as a two + * handed clock with readers always advancing towards writers. SMR + * maintains the invariant that all readers can safely access memory + * that was visible at the time they loaded their copy of the sequence + * number. Periodically the read sequence or hand is polled and + * advanced as far towards the write sequence as active readers allow. + * Memory which was freed between the old and new global read sequence + * number can now be reclaimed. When the system is idle the two hands + * meet and no deferred memory is outstanding. Readers never advance + * any sequence number, they only observe them. The shared read + * sequence number is consequently never higher than the write sequence. + * A stored sequence number that falls outside of this range has expired + * and needs no scan to reclaim. + * + * A notable distinction between this SMR and Epoch, qsbr, rcu, etc. is + * that advancing the sequence number is decoupled from detecting its + * observation. This results in a more granular assignment of sequence + * numbers even as read latencies prohibit all or some expiration. + * It also allows writers to advance the sequence number and save the + * poll for expiration until a later time when it is likely to + * complete without waiting. The batch granularity and free-to-use + * latency is dynamic and can be significantly smaller than in more + * strict systems. + * + * This mechanism is primarily intended to be used in coordination with + * UMA. By integrating with the allocator we avoid all of the callout + * queue machinery and are provided with an efficient way to batch + * sequence advancement and waiting. The allocator accumulates a full + * per-cpu cache of memory before advancing the sequence. It then + * delays waiting for this sequence to expire until the memory is + * selected for reuse. In this way we only increment the sequence + * value once for n=cache-size frees and the waits are done long + * after the sequence has been expired so they need only be verified + * to account for pathological conditions and to advance the read + * sequence. Tying the sequence number to the bucket size has the + * nice property that as the zone gets busier the buckets get larger + * and the sequence writes become fewer. If the coherency of advancing + * the write sequence number becomes too costly we can advance + * it for every N buckets in exchange for higher free-to-use + * latency and consequently higher memory consumption. + * + * If the read overhead of accessing the shared cacheline becomes + * especially burdensome an invariant TSC could be used in place of the + * sequence. The algorithm would then only need to maintain the minimum + * observed tsc. This would trade potential cache synchronization + * overhead for local serialization and cpu timestamp overhead. + */ + +/* + * A simplified diagram: + * + * 0 UINT_MAX + * | -------------------- sequence number space -------------------- | + * ^ rd seq ^ wr seq + * | ----- valid sequence numbers ---- | + * ^cpuA ^cpuC + * | -- free -- | --------- deferred frees -------- | ---- free ---- | + * + * + * In this example cpuA has the lowest sequence number and poll can + * advance rd seq. cpuB is not running and is considered to observe + * wr seq. + * + * Freed memory that is tagged with a sequence number between rd seq and + * wr seq can not be safely reclaimed because cpuA may hold a reference to + * it. Any other memory is guaranteed to be unreferenced. + * + * Any writer is free to advance wr seq at any time however it may busy + * poll in pathological cases. + */ + +static uma_zone_t smr_shared_zone; +static uma_zone_t smr_zone; + +#ifndef INVARIANTS +#define SMR_SEQ_INIT 1 /* All valid sequence numbers are odd. */ +#define SMR_SEQ_INCR 2 + +/* + * SMR_SEQ_MAX_DELTA is the maximum distance allowed between rd_seq and + * wr_seq. For the modular arithmetic to work a value of UNIT_MAX / 2 + * would be possible but it is checked after we increment the wr_seq so + * a safety margin is left to prevent overflow. + * + * We will block until SMR_SEQ_MAX_ADVANCE sequence numbers have progressed + * to prevent integer wrapping. See smr_advance() for more details. + */ +#define SMR_SEQ_MAX_DELTA (UINT_MAX / 4) +#define SMR_SEQ_MAX_ADVANCE (SMR_SEQ_MAX_DELTA - 1024) +#else +/* We want to test the wrapping feature in invariants kernels. */ +#define SMR_SEQ_INCR (UINT_MAX / 10000) +#define SMR_SEQ_INIT (UINT_MAX - 100000) +/* Force extra polls to test the integer overflow detection. */ +#define SMR_SEQ_MAX_DELTA (1000) +#define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 +#endif + +/* + * Advance the write sequence and return the new value for use as the + * wait goal. This guarantees that any changes made by the calling + * thread prior to this call will be visible to all threads after + * rd_seq meets or exceeds the return value. + * + * This function may busy loop if the readers are roughly 1 billion + * sequence numbers behind the writers. + */ +smr_seq_t +smr_advance(smr_t smr) +{ + smr_shared_t s; + smr_seq_t goal; + + /* + * It is illegal to enter while in an smr section. + */ + KASSERT(curthread->td_critnest == 0, + ("smr_advance: Not allowed in a critical section.")); + + /* + * Modifications not done in a smr section need to be visible + * before advancing the seq. + */ + atomic_thread_fence_rel(); + + /* + * Increment the shared write sequence by 2. Since it is + * initialized to 1 this means the only valid values are + * odd and an observed value of 0 in a particular CPU means + * it is not currently in a read section. + */ + s = smr->c_shared; + goal = atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_INCR; + + /* + * Force a synchronization here if the goal is getting too + * far ahead of the read sequence number. This keeps the + * wrap detecting arithmetic working in pathological cases. + */ + if (goal - atomic_load_int(&s->s_rd_seq) >= SMR_SEQ_MAX_DELTA) + smr_wait(smr, goal - SMR_SEQ_MAX_ADVANCE); + + return (goal); +} + +/* + * Poll to determine whether all readers have observed the 'goal' write + * sequence number. + * + * If wait is true this will spin until the goal is met. + * + * This routine will updated the minimum observed read sequence number in + * s_rd_seq if it does a scan. It may not do a scan if another call has + * advanced s_rd_seq beyond the callers goal already. + * + * Returns true if the goal is met and false if not. + */ +bool +smr_poll(smr_t smr, smr_seq_t goal, bool wait) +{ + smr_shared_t s; + smr_t c; + smr_seq_t s_wr_seq, s_rd_seq, rd_seq, c_seq; + int i; + bool success; + + /* + * It is illegal to enter while in an smr section. + */ + KASSERT(!wait || curthread->td_critnest == 0, + ("smr_poll: Blocking not allowed in a critical section.")); + + /* + * Use a critical section so that we can avoid ABA races + * caused by long preemption sleeps. + */ + success = true; + critical_enter(); + s = smr->c_shared; + + /* + * Acquire barrier loads s_wr_seq after s_rd_seq so that we can not + * observe an updated read sequence that is larger than write. + */ + s_rd_seq = atomic_load_acq_int(&s->s_rd_seq); + s_wr_seq = smr_current(smr); + + /* + * Detect whether the goal is valid and has already been observed. + * + * The goal must be in the range of s_wr_seq >= goal >= s_rd_seq for + * it to be valid. If it is not then the caller held on to it and + * the integer wrapped. If we wrapped back within range the caller + * will harmlessly scan. + * + * A valid goal must be greater than s_rd_seq or we have not verified + * that it has been observed and must fall through to polling. + */ + if (SMR_SEQ_GEQ(s_rd_seq, goal) || SMR_SEQ_LT(s_wr_seq, goal)) + goto out; + + /* + * Loop until all cores have observed the goal sequence or have + * gone inactive. Keep track of the oldest sequence currently + * active as rd_seq. + */ + rd_seq = s_wr_seq; + CPU_FOREACH(i) { + c = zpcpu_get_cpu(smr, i); + c_seq = SMR_SEQ_INVALID; + for (;;) { + c_seq = atomic_load_int(&c->c_seq); + if (c_seq == SMR_SEQ_INVALID) + break; + + /* + * There is a race described in smr.h:smr_enter that + * can lead to a stale seq value but not stale data + * access. If we find a value out of range here we + * pin it to the current min to prevent it from + * advancing until that stale section has expired. + * + * The race is created when a cpu loads the s_wr_seq + * value in a local register and then another thread + * advances s_wr_seq and calls smr_poll() which will + * oberve no value yet in c_seq and advance s_rd_seq + * up to s_wr_seq which is beyond the register + * cached value. This is only likely to happen on + * hypervisor or with a system management interrupt. + */ + if (SMR_SEQ_LT(c_seq, s_rd_seq)) + c_seq = s_rd_seq; + + /* + * If the sequence number meets the goal we are + * done with this cpu. + */ + if (SMR_SEQ_GEQ(c_seq, goal)) + break; + + /* + * If we're not waiting we will still scan the rest + * of the cpus and update s_rd_seq before returning + * an error. + */ + if (!wait) { + success = false; + break; + } + cpu_spinwait(); + } + + /* + * Limit the minimum observed rd_seq whether we met the goal + * or not. + */ + if (c_seq != SMR_SEQ_INVALID && SMR_SEQ_GT(rd_seq, c_seq)) + rd_seq = c_seq; + } + + /* + * Advance the rd_seq as long as we observed the most recent one. + */ + s_rd_seq = atomic_load_int(&s->s_rd_seq); + do { + if (SMR_SEQ_LEQ(rd_seq, s_rd_seq)) + break; + } while (atomic_fcmpset_int(&s->s_rd_seq, &s_rd_seq, rd_seq) == 0); + +out: + critical_exit(); + + return (success); +} + +smr_t +smr_create(const char *name) +{ + smr_t smr, c; + smr_shared_t s; + int i; + + s = uma_zalloc(smr_shared_zone, M_WAITOK); + smr = uma_zalloc(smr_zone, M_WAITOK); + + s->s_name = name; + s->s_rd_seq = s->s_wr_seq = SMR_SEQ_INIT; + + /* Initialize all CPUS, not just those running. */ + for (i = 0; i <= mp_maxid; i++) { + c = zpcpu_get_cpu(smr, i); + c->c_seq = SMR_SEQ_INVALID; + c->c_shared = s; + } + atomic_thread_fence_seq_cst(); + + return (smr); +} + +void +smr_destroy(smr_t smr) +{ + + smr_synchronize(smr); + uma_zfree(smr_shared_zone, smr->c_shared); + uma_zfree(smr_zone, smr); +} + +/* + * Initialize the UMA slab zone. + */ +void +smr_init(void) +{ + + smr_shared_zone = uma_zcreate("SMR SHARED", sizeof(struct smr_shared), + NULL, NULL, NULL, NULL, (CACHE_LINE_SIZE * 2) - 1, 0); + smr_zone = uma_zcreate("SMR CPU", sizeof(struct smr), + NULL, NULL, NULL, NULL, (CACHE_LINE_SIZE * 2) - 1, UMA_ZONE_PCPU); +} Added: head/sys/sys/_smr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_smr.h Fri Jan 31 00:49:51 2020 (r357314) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019,2020 Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _SYS__SMR_H_ +#define _SYS__SMR_H_ + +typedef uint32_t smr_seq_t; +typedef struct smr *smr_t; + +#endif /* __SYS_SMR_H_ */ Added: head/sys/sys/smr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/smr.h Fri Jan 31 00:49:51 2020 (r357314) @@ -0,0 +1,180 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019,2020 Jeffrey Roberson + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _SYS_SMR_H_ +#define _SYS_SMR_H_ + +#include + +/* + * Safe memory reclamation. See subr_smr.c for a description of the + * algorithm. + * + * Readers synchronize with smr_enter()/exit() and writers may either + * free directly to a SMR UMA zone or use smr_synchronize or wait. + */ + +/* + * Modular arithmetic for comparing sequence numbers that have + * potentially wrapped. Copied from tcp_seq.h. + */ +#define SMR_SEQ_LT(a, b) ((int32_t)((a)-(b)) < 0) +#define SMR_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define SMR_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) +#define SMR_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) + +#define SMR_SEQ_INVALID 0 + +/* Shared SMR state. */ +struct smr_shared { + const char *s_name; /* Name for debugging/reporting. */ + smr_seq_t s_wr_seq; /* Current write sequence #. */ + smr_seq_t s_rd_seq; /* Minimum observed read sequence. */ +}; +typedef struct smr_shared *smr_shared_t; + +/* Per-cpu SMR state. */ +struct smr { + smr_seq_t c_seq; /* Current observed sequence. */ + smr_shared_t c_shared; /* Shared SMR state. */ +}; + +/* + * Return the current write sequence number. + */ +static inline smr_seq_t +smr_current(smr_t smr) +{ + + return (atomic_load_int(&smr->c_shared->s_wr_seq)); +} + +/* + * Enter a read section. + */ +static inline void +smr_enter(smr_t smr) +{ + + critical_enter(); + smr = zpcpu_get(smr); + KASSERT(smr->c_seq == 0, + ("smr_enter(%s) does not support recursion.", + smr->c_shared->s_name)); + + /* + * Store the current observed write sequence number in our + * per-cpu state so that it can be queried via smr_poll(). + * Frees that are newer than this stored value will be + * deferred until we call smr_exit(). + * + * An acquire barrier is used to synchronize with smr_exit() + * and smr_poll(). + * + * It is possible that a long delay between loading the wr_seq + * and storing the c_seq could create a situation where the + * rd_seq advances beyond our stored c_seq. In this situation + * only the observed wr_seq is stale, the fence still orders + * the load. See smr_poll() for details on how this condition + * is detected and handled there. + */ + /* This is an add because we do not have atomic_store_acq_int */ + atomic_add_acq_int(&smr->c_seq, smr_current(smr)); +} + +/* + * Exit a read section. + */ +static inline void +smr_exit(smr_t smr) +{ + + smr = zpcpu_get(smr); + CRITICAL_ASSERT(curthread); + KASSERT(smr->c_seq != SMR_SEQ_INVALID, + ("smr_exit(%s) not in a smr section.", smr->c_shared->s_name)); + + /* + * Clear the recorded sequence number. This allows poll() to + * detect CPUs not in read sections. + * + * Use release semantics to retire any stores before the sequence + * number is cleared. + */ + atomic_store_rel_int(&smr->c_seq, SMR_SEQ_INVALID); + critical_exit(); +} + +/* + * Advances the write sequence number. Returns the sequence number + * required to ensure that all modifications are visible to readers. + */ +smr_seq_t smr_advance(smr_t smr); + +/* + * Returns true if a goal sequence has been reached. If + * wait is true this will busy loop until success. + */ +bool smr_poll(smr_t smr, smr_seq_t goal, bool wait); + +/* Create a new SMR context. */ +smr_t smr_create(const char *name); +void smr_destroy(smr_t smr); + +/* + * Blocking wait for all readers to observe 'goal'. + */ +static inline bool +smr_wait(smr_t smr, smr_seq_t goal) +{ + + return (smr_poll(smr, goal, true)); +} + +/* + * Synchronize advances the write sequence and returns when all + * readers have observed it. + * + * If your application can cache a sequence number returned from + * smr_advance() and poll or wait at a later time there will + * be less chance of busy looping while waiting for readers. + */ +static inline void +smr_synchronize(smr_t smr) +{ + + smr_wait(smr, smr_advance(smr)); +} + +/* Only at startup. */ +void smr_init(void); + +#endif /* _SYS_SMR_H_ */ Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Thu Jan 30 22:19:48 2020 (r357313) +++ head/sys/vm/uma.h Fri Jan 31 00:49:51 2020 (r357314) @@ -40,6 +40,7 @@ #include /* For NULL */ #include /* For M_* */ +#include /* User visible parameters */ #define UMA_SMALLEST_UNIT 8 /* Smallest item allocated */ @@ -259,16 +260,27 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * mini-dumps. */ #define UMA_ZONE_PCPU 0x8000 /* - * Allocates mp_maxid + 1 slabs of PAGE_SIZE + * Allocates mp_maxid + 1 slabs of + * PAGE_SIZE */ #define UMA_ZONE_FIRSTTOUCH 0x10000 /* First touch NUMA policy */ #define UMA_ZONE_ROUNDROBIN 0x20000 /* Round-robin NUMA policy. */ +#define UMA_ZONE_SMR 0x40000 /* + * Safe memory reclamation defers + * frees until all read sections + * have exited. This flag creates + * a unique SMR context for this + * zone. To share contexts see + * uma_zone_set_smr() below. + * + * See sys/smr.h for more details. + */ /* In use by UMA_ZFLAGs: 0xffe00000 */ /* - * These flags are shared between the keg and zone. In zones wishing to add - * new kegs these flags must be compatible. Some are determined based on - * physical parameters of the request and may not be provided by the consumer. + * These flags are shared between the keg and zone. Some are determined + * based on physical parameters of the request and may not be provided by + * the consumer. */ #define UMA_ZONE_INHERIT \ (UMA_ZONE_NOTOUCH | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ @@ -310,8 +322,13 @@ void uma_zdestroy(uma_zone_t zone); */ void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); + +/* Allocate per-cpu data. Access the correct data with zpcpu_get(). */ void *uma_zalloc_pcpu_arg(uma_zone_t zone, void *arg, int flags); +/* Use with SMR zones. */ +void *uma_zalloc_smr(uma_zone_t zone, int flags); + /* * Allocate an item from a specific NUMA domain. This uses a slow path in * the allocator but is guaranteed to allocate memory from the requested @@ -359,8 +376,13 @@ uma_zalloc_pcpu(uma_zone_t zone, int flags) */ void uma_zfree_arg(uma_zone_t zone, void *item, void *arg); + +/* Use with PCPU zones. */ void uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void *arg); +/* Use with SMR zones. */ +void uma_zfree_smr(uma_zone_t zone, void *item); + /* * Frees an item back to the specified zone's domain specific pool. * @@ -599,6 +621,17 @@ void uma_zone_set_allocf(uma_zone_t zone, uma_alloc al */ void uma_zone_set_freef(uma_zone_t zone, uma_free freef); + +/* + * Associate a zone with a smr context that is allocated after creation + * so that multiple zones may share the same context. + */ +void uma_zone_set_smr(uma_zone_t zone, smr_t smr); + +/* + * Fetch the smr context that was set or made in uma_zcreate(). + */ +smr_t uma_zone_get_smr(uma_zone_t zone); /* * These flags are setable in the allocf and visible in the freef. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 30 22:19:48 2020 (r357313) +++ head/sys/vm/uma_core.c Fri Jan 31 00:49:51 2020 (r357314) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -103,6 +104,12 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INVARIANTS +#define UMA_ALWAYS_CTORDTOR 1 +#else +#define UMA_ALWAYS_CTORDTOR 0 +#endif + /* * This is the zone and keg from which all zones are spawned. */ @@ -273,6 +280,8 @@ static int keg_ctor(void *, int, void *, int); static void keg_dtor(void *, int, void *); static int zone_ctor(void *, int, void *, int); static void zone_dtor(void *, int, void *); +static inline void item_dtor(uma_zone_t zone, void *item, int size, + void *udata, enum zfreeskip skip); static int zero_init(void *, int, int); static void zone_foreach(void (*zfunc)(uma_zone_t, void *), void *); static void zone_foreach_unlocked(void (*zfunc)(uma_zone_t, void *), void *); @@ -454,9 +463,9 @@ bucket_alloc(uma_zone_t zone, void *udata, int flags) uma_bucket_t bucket; /* - * Don't allocate buckets in low memory situations. + * Don't allocate buckets early in boot. */ - if (bucketdisable) + if (__predict_false(booted < BOOT_KVA)) return (NULL); /* @@ -488,6 +497,9 @@ bucket_alloc(uma_zone_t zone, void *udata, int flags) #endif bucket->ub_cnt = 0; bucket->ub_entries = ubz->ubz_entries; + bucket->ub_seq = SMR_SEQ_INVALID; + CTR3(KTR_UMA, "bucket_alloc: zone %s(%p) allocated bucket %p", + zone->uz_name, zone, bucket); } return (bucket); @@ -500,6 +512,8 @@ bucket_free(uma_zone_t zone, uma_bucket_t bucket, void KASSERT(bucket->ub_cnt == 0, ("bucket_free: Freeing a non free bucket.")); + KASSERT(bucket->ub_seq == SMR_SEQ_INVALID, + ("bucket_free: Freeing an SMR bucket.")); if ((zone->uz_flags & UMA_ZFLAG_BUCKET) == 0) udata = (void *)(uintptr_t)zone->uz_flags; ubz = bucket_zone_lookup(bucket->ub_entries); @@ -517,23 +531,39 @@ bucket_zone_drain(void) /* * Attempt to satisfy an allocation by retrieving a full bucket from one of the - * zone's caches. + * zone's caches. If a bucket is found the zone is not locked on return. */ static uma_bucket_t zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom) { uma_bucket_t bucket; + int i; + bool dtor = false; ZONE_LOCK_ASSERT(zone); - if ((bucket = TAILQ_FIRST(&zdom->uzd_buckets)) != NULL) { - MPASS(zdom->uzd_nitems >= bucket->ub_cnt); - TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); - zdom->uzd_nitems -= bucket->ub_cnt; - if (zdom->uzd_imin > zdom->uzd_nitems) - zdom->uzd_imin = zdom->uzd_nitems; - zone->uz_bkt_count -= bucket->ub_cnt; + if ((bucket = TAILQ_FIRST(&zdom->uzd_buckets)) == NULL) + return (NULL); + + if ((zone->uz_flags & UMA_ZONE_SMR) != 0 && + bucket->ub_seq != SMR_SEQ_INVALID) { + if (!smr_poll(zone->uz_smr, bucket->ub_seq, false)) + return (NULL); + bucket->ub_seq = SMR_SEQ_INVALID; + dtor = (zone->uz_dtor != NULL) | UMA_ALWAYS_CTORDTOR; } + MPASS(zdom->uzd_nitems >= bucket->ub_cnt); + TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); + zdom->uzd_nitems -= bucket->ub_cnt; + if (zdom->uzd_imin > zdom->uzd_nitems) + zdom->uzd_imin = zdom->uzd_nitems; + zone->uz_bkt_count -= bucket->ub_cnt; + ZONE_UNLOCK(zone); + if (dtor) + for (i = 0; i < bucket->ub_cnt; i++) + item_dtor(zone, bucket->ub_bucket[i], zone->uz_size, + NULL, SKIP_NONE); + return (bucket); } @@ -551,7 +581,7 @@ zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdo KASSERT(!ws || zone->uz_bkt_count < zone->uz_bkt_max, ("%s: zone %p overflow", __func__, zone)); - if (ws) + if (ws && bucket->ub_seq == SMR_SEQ_INVALID) TAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); else TAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); @@ -941,12 +971,23 @@ bucket_drain(uma_zone_t zone, uma_bucket_t bucket) if (bucket == NULL || bucket->ub_cnt == 0) return; + if ((zone->uz_flags & UMA_ZONE_SMR) != 0 && + bucket->ub_seq != SMR_SEQ_INVALID) { + smr_wait(zone->uz_smr, bucket->ub_seq); + for (i = 0; i < bucket->ub_cnt; i++) + item_dtor(zone, bucket->ub_bucket[i], + zone->uz_size, NULL, SKIP_NONE); + bucket->ub_seq = SMR_SEQ_INVALID; + } if (zone->uz_fini) for (i = 0; i < bucket->ub_cnt; i++) zone->uz_fini(bucket->ub_bucket[i], zone->uz_size); zone->uz_release(zone->uz_arg, bucket->ub_bucket, bucket->ub_cnt); if (zone->uz_max_items > 0) zone_free_limit(zone, bucket->ub_cnt); +#ifdef INVARIANTS + bzero(bucket->ub_bucket, sizeof(void *) * bucket->ub_cnt); +#endif bucket->ub_cnt = 0; } @@ -1035,12 +1076,21 @@ cache_drain_safe_cpu(uma_zone_t zone, void *unused) zone_put_bucket(zone, &zone->uz_domain[domain], b1, false); b1 = NULL; } + + /* + * Don't flush SMR zone buckets. This leaves the zone without a + * bucket and forces every free to synchronize(). + */ + if ((zone->uz_flags & UMA_ZONE_SMR) != 0) + goto out; b2 = cache_bucket_unload_free(cache); if (b2 != NULL && b2->ub_cnt != 0) { zone_put_bucket(zone, &zone->uz_domain[domain], b2, false); b2 = NULL; } b3 = cache_bucket_unload_cross(cache); + +out: critical_exit(); ZONE_UNLOCK(zone); if (b1) @@ -1135,7 +1185,7 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain) target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - zdom->uzd_imin); while (zdom->uzd_nitems > target) { - bucket = TAILQ_LAST(&zdom->uzd_buckets, uma_bucketlist); + bucket = TAILQ_FIRST(&zdom->uzd_buckets); if (bucket == NULL) break; tofree = bucket->ub_cnt; @@ -2294,7 +2344,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_bucket_size = 0; zone->uz_bucket_size_min = 0; zone->uz_bucket_size_max = BUCKET_MAX; - zone->uz_flags = 0; + zone->uz_flags = (arg->flags & UMA_ZONE_SMR); zone->uz_warning = NULL; /* The domain structures follow the cpu structures. */ zone->uz_domain = @@ -2375,7 +2425,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) karg.uminit = arg->uminit; karg.fini = arg->fini; karg.align = arg->align; - karg.flags = arg->flags; + karg.flags = (arg->flags & ~UMA_ZONE_SMR); karg.zone = zone; error = keg_ctor(arg->keg, sizeof(struct uma_keg), &karg, flags); @@ -2399,6 +2449,10 @@ out: zone->uz_fails = EARLY_COUNTER; } + /* Caller requests a private SMR context. */ + if ((zone->uz_flags & UMA_ZONE_SMR) != 0) + zone->uz_smr = smr_create(zone->uz_name); + KASSERT((arg->flags & (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET)) != (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET), ("Invalid zone flag combination")); @@ -2600,6 +2654,7 @@ uma_startup1(vm_offset_t virtual_avail) NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZFLAG_INTERNAL); bucket_init(); + smr_init(); } #ifndef UMA_MD_SMALL_ALLOC @@ -2844,14 +2899,9 @@ uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void * uma_zfree_arg(zone, item, udata); } -#ifdef INVARIANTS -#define UMA_ALWAYS_CTORDTOR 1 -#else -#define UMA_ALWAYS_CTORDTOR 0 -#endif - -static void * -item_ctor(uma_zone_t zone, int size, void *udata, int flags, void *item) +static inline void * +item_ctor(uma_zone_t zone, int uz_flags, int size, void *udata, int flags, + void *item) { #ifdef INVARIANTS bool skipdbg; @@ -2861,7 +2911,9 @@ item_ctor(uma_zone_t zone, int size, void *udata, int zone->uz_ctor != trash_ctor) trash_ctor(item, size, udata, flags); #endif - if (__predict_false(zone->uz_ctor != NULL) && + /* Check flags before loading ctor pointer. */ + if (__predict_false((uz_flags & UMA_ZFLAG_CTORDTOR) != 0) && + __predict_false(zone->uz_ctor != NULL) && zone->uz_ctor(item, size, udata, flags) != 0) { counter_u64_add(zone->uz_fails, 1); zone_free_item(zone, item, udata, SKIP_DTOR | SKIP_CNT); @@ -2903,58 +2955,151 @@ item_dtor(uma_zone_t zone, void *item, int size, void } } -/* See uma.h */ -void * -uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) +#if defined(INVARIANTS) || defined(DEBUG_MEMGUARD) || defined(WITNESS) +#define UMA_ZALLOC_DEBUG +static int +uma_zalloc_debug(uma_zone_t zone, void **itemp, void *udata, int flags) { - uma_cache_bucket_t bucket; - uma_cache_t cache; - void *item; - int domain, size, uz_flags; + int error; - /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ - random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); - - /* This is the fast path allocation */ - CTR3(KTR_UMA, "uma_zalloc_arg zone %s(%p) flags %d", zone->uz_name, - zone, flags); - + error = 0; #ifdef WITNESS if (flags & M_WAITOK) { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "uma_zalloc_arg: zone \"%s\"", zone->uz_name); + "uma_zalloc_debug: zone \"%s\"", zone->uz_name); } #endif #ifdef INVARIANTS - KASSERT((flags & M_EXEC) == 0, ("uma_zalloc_arg: called with M_EXEC")); + KASSERT((flags & M_EXEC) == 0, + ("uma_zalloc_debug: called with M_EXEC")); KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), - ("uma_zalloc_arg: called with spinlock or critical section held")); - if (zone->uz_flags & UMA_ZONE_PCPU) - KASSERT((flags & M_ZERO) == 0, ("allocating from a pcpu zone " - "with M_ZERO passed")); + ("uma_zalloc_debug: called within spinlock or critical section")); + KASSERT((zone->uz_flags & UMA_ZONE_PCPU) == 0 || (flags & M_ZERO) == 0, + ("uma_zalloc_debug: allocating from a pcpu zone with M_ZERO")); #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 31 02:03:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3A4C22F309; Fri, 31 Jan 2020 02:03:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4880qt3lrWz3xJm; Fri, 31 Jan 2020 02:03:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C2016BC6; Fri, 31 Jan 2020 02:03:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V23MRf023941; Fri, 31 Jan 2020 02:03:22 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V23ME7023940; Fri, 31 Jan 2020 02:03:22 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001310203.00V23ME7023940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 31 Jan 2020 02:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357315 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 02:03:22 -0000 Author: jeff Date: Fri Jan 31 02:03:22 2020 New Revision: 357315 URL: https://svnweb.freebsd.org/changeset/base/357315 Log: Fix LINT build with MEMGUARD. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jan 31 00:49:51 2020 (r357314) +++ head/sys/vm/uma_core.c Fri Jan 31 02:03:22 2020 (r357315) @@ -2980,7 +2980,7 @@ uma_zalloc_debug(uma_zone_t zone, void **itemp, void * #endif #ifdef DEBUG_MEMGUARD - if ((zone->uz_flags & UMA_ZONE_SMR == 0) && memguard_cmp_zone(zone)) { + if ((zone->uz_flags & UMA_ZONE_SMR) == 0 && memguard_cmp_zone(zone)) { void *item; item = memguard_alloc(zone->uz_size, flags); if (item != NULL) { @@ -3014,7 +3014,7 @@ uma_zfree_debug(uma_zone_t zone, void *item, void *uda ("uma_zfree_debug: called with spinlock or critical section held")); #ifdef DEBUG_MEMGUARD - if ((zone->uz_flags & UMA_ZONE_SMR == 0) && is_memguard_addr(item)) { + if ((zone->uz_flags & UMA_ZONE_SMR) == 0 && is_memguard_addr(item)) { if (zone->uz_dtor != NULL) zone->uz_dtor(item, zone->uz_size, udata); if (zone->uz_fini != NULL) From owner-svn-src-all@freebsd.org Fri Jan 31 02:08:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00F8F22F3E2; Fri, 31 Jan 2020 02:08:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4880xQ61ZNz3xSl; Fri, 31 Jan 2020 02:08:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C52446BCA; Fri, 31 Jan 2020 02:08:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V28AP7024198; Fri, 31 Jan 2020 02:08:10 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V28AQo024196; Fri, 31 Jan 2020 02:08:10 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001310208.00V28AQo024196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 31 Jan 2020 02:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357316 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 02:08:11 -0000 Author: jeff Date: Fri Jan 31 02:08:09 2020 New Revision: 357316 URL: https://svnweb.freebsd.org/changeset/base/357316 Log: Don't use "All rights reserved" in new copyrights. Requested by: rgrimes Modified: head/sys/kern/subr_smr.c head/sys/sys/_smr.h head/sys/sys/smr.h Modified: head/sys/kern/subr_smr.c ============================================================================== --- head/sys/kern/subr_smr.c Fri Jan 31 02:03:22 2020 (r357315) +++ head/sys/kern/subr_smr.c Fri Jan 31 02:08:09 2020 (r357316) @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2019 Jeffrey Roberson - * All rights reserved. + * Copyright (c) 2019,2020 Jeffrey Roberson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/sys/_smr.h ============================================================================== --- head/sys/sys/_smr.h Fri Jan 31 02:03:22 2020 (r357315) +++ head/sys/sys/_smr.h Fri Jan 31 02:08:09 2020 (r357316) @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2019,2020 Jeffrey Roberson - * All rights reserved. + * Copyright (c) 2019, 2020 Jeffrey Roberson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/sys/smr.h ============================================================================== --- head/sys/sys/smr.h Fri Jan 31 02:03:22 2020 (r357315) +++ head/sys/sys/smr.h Fri Jan 31 02:08:09 2020 (r357316) @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2019,2020 Jeffrey Roberson - * All rights reserved. + * Copyright (c) 2019, 2020 Jeffrey Roberson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Fri Jan 31 02:18:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D038422F87D; Fri, 31 Jan 2020 02:18:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48819r5BnJz3y5f; Fri, 31 Jan 2020 02:18:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD1EF6D9B; Fri, 31 Jan 2020 02:18:56 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V2IuHF030526; Fri, 31 Jan 2020 02:18:56 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V2IunR030525; Fri, 31 Jan 2020 02:18:56 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001310218.00V2IunR030525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 31 Jan 2020 02:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357317 - in head/tools/uma: . smrstress X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/tools/uma: . smrstress X-SVN-Commit-Revision: 357317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 02:18:56 -0000 Author: jeff Date: Fri Jan 31 02:18:56 2020 New Revision: 357317 URL: https://svnweb.freebsd.org/changeset/base/357317 Log: Implement a simple UMA SMR stress testing tool. Added: head/tools/uma/ head/tools/uma/smrstress/ head/tools/uma/smrstress/Makefile (contents, props changed) head/tools/uma/smrstress/smrstress.c (contents, props changed) Added: head/tools/uma/smrstress/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/uma/smrstress/Makefile Fri Jan 31 02:18:56 2020 (r357317) @@ -0,0 +1,8 @@ +# +# $FreeBSD$ +# + +KMOD= smrstress +SRCS= smrstress.c + +.include Added: head/tools/uma/smrstress/smrstress.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/uma/smrstress/smrstress.c Fri Jan 31 02:18:56 2020 (r357317) @@ -0,0 +1,227 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jeffrey Roberson + * + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +static uma_zone_t smrs_zone; +static smr_t smrs_smr; + +static int smrs_cpus; +static int smrs_writers; +static int smrs_started; +static int smrs_iterations = 10000000; +static int smrs_failures = 0; +static volatile int smrs_completed; + +struct smrs { + int generation; + volatile u_int count; +}; + +uintptr_t smrs_current; + +static void +smrs_error(struct smrs *smrs, const char *fmt, ...) +{ + va_list ap; + + atomic_add_int(&smrs_failures, 1); + printf("SMR ERROR: wr_seq %d, rd_seq %d, c_seq %d, generation %d, count %d ", + smrs_smr->c_shared->s_wr_seq, smrs_smr->c_shared->s_rd_seq, + zpcpu_get(smrs_smr)->c_seq, smrs->generation, smrs->count); + va_start(ap, fmt); + (void)vprintf(fmt, ap); + va_end(ap); +} + +static void +smrs_read(void) +{ + struct smrs *cur; + int cnt; + + /* Wait for the writer to exit. */ + while (smrs_completed == 0) { + smr_enter(smrs_smr); + cur = (void *)atomic_load_ptr(&smrs_current); + if (cur->generation == -1) + smrs_error(cur, "read early: Use after free!\n"); + atomic_add_int(&cur->count, 1); + DELAY(100); + cnt = atomic_fetchadd_int(&cur->count, -1); + if (cur->generation == -1) + smrs_error(cur, "read late: Use after free!\n"); + else if (cnt <= 0) + smrs_error(cur, "Invalid ref\n"); + smr_exit(smrs_smr); + maybe_yield(); + } +} + +static void +smrs_write(void) +{ + struct smrs *cur; + int i; + + for (i = 0; i < smrs_iterations; i++) { + cur = uma_zalloc_smr(smrs_zone, M_WAITOK); + cur = (void *)atomic_swap_ptr(&smrs_current, (uintptr_t)cur); + uma_zfree_smr(smrs_zone, cur); + } +} + +static void +smrs_thread(void *arg) +{ + int rw = (intptr_t)arg; + + if (rw < smrs_writers) + smrs_write(); + else + smrs_read(); + atomic_add_int(&smrs_completed, 1); +} + +static void +smrs_start(void) +{ + struct smrs *cur; + int i; + + smrs_cpus = mp_ncpus; + if (mp_ncpus > 3) + smrs_writers = 2; + else + smrs_writers = 1; + smrs_started = smrs_cpus; + smrs_completed = 0; + atomic_store_rel_ptr(&smrs_current, + (uintptr_t)uma_zalloc_smr(smrs_zone, M_WAITOK)); + for (i = 0; i < smrs_started; i++) + kthread_add((void (*)(void *))smrs_thread, + (void *)(intptr_t)i, curproc, NULL, 0, 0, "smrs-%d", i); + + while (smrs_completed != smrs_started) + pause("prf", hz/2); + + cur = (void *)smrs_current; + smrs_current = (uintptr_t)NULL; + uma_zfree_smr(smrs_zone, cur); + + printf("Completed %d loops with %d failures\n", + smrs_iterations, smrs_failures); +} + +static int +smrs_ctor(void *mem, int size, void *arg, int flags) +{ + static int smr_generation = 0; + struct smrs *smrs = mem; + + if (smrs->generation != -1 && smrs->generation != 0) + smrs_error(smrs, "ctor: Invalid smr generation on ctor\n"); + else if (smrs->count != 0) + smrs_error(smrs, "ctor: Invalid count\n"); + smrs->generation = ++smr_generation; + + return (0); +} + + +static void +smrs_dtor(void *mem, int size, void *arg) +{ + struct smrs *smrs = mem; + + if (smrs->generation == -1) + smrs_error(smrs, "dtor: Invalid generation"); + smrs->generation = -1; + if (smrs->count != 0) + smrs_error(smrs, "dtor: Invalid count\n"); +} + + +static void +smrs_init(void) +{ + + smrs_zone = uma_zcreate("smrs", sizeof(struct smrs), + smrs_ctor, smrs_dtor, NULL, NULL, UMA_ALIGN_PTR, + UMA_ZONE_SMR | UMA_ZONE_ZINIT); + smrs_smr = uma_zone_get_smr(smrs_zone); +} + +static void +smrs_fini(void) +{ + + uma_zdestroy(smrs_zone); +} + +static int +smrs_modevent(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + smrs_init(); + smrs_start(); + break; + case MOD_UNLOAD: + smrs_fini(); + break; + default: + break; + } + return (0); +} + +moduledata_t smrs_meta = { + "smrstress", + smrs_modevent, + NULL +}; +DECLARE_MODULE(smrstress, smrs_meta, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +MODULE_VERSION(smrstress, 1); From owner-svn-src-all@freebsd.org Fri Jan 31 02:23:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4630722FE95; Fri, 31 Jan 2020 02:23:49 +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 4881HT14fYz3ymy; Fri, 31 Jan 2020 02:23:49 +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 205516F72; Fri, 31 Jan 2020 02:23:49 +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 00V2Nn7U036135; Fri, 31 Jan 2020 02:23:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V2NmhU036134; Fri, 31 Jan 2020 02:23:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <202001310223.00V2NmhU036134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 31 Jan 2020 02:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357318 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 357318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 02:23:49 -0000 Author: np Date: Fri Jan 31 02:23:48 2020 New Revision: 357318 URL: https://svnweb.freebsd.org/changeset/base/357318 Log: Fix NOINET builds. Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Jan 31 02:18:56 2020 (r357317) +++ head/sys/netinet6/udp6_usrreq.c Fri Jan 31 02:23:48 2020 (r357318) @@ -1177,7 +1177,9 @@ udp6_close(struct socket *so) static int udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { +#ifdef INET struct epoch_tracker et; +#endif struct inpcb *inp; struct inpcbinfo *pcbinfo; struct sockaddr_in6 *sin6; From owner-svn-src-all@freebsd.org Fri Jan 31 04:05:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C5A3231CC8; Fri, 31 Jan 2020 04:05:38 +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 4883Xx4Hy5z4494; Fri, 31 Jan 2020 04:05:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id xNYjiT9xBnCigxNYkiolBG; Thu, 30 Jan 2020 21:05:35 -0700 X-Authority-Analysis: v=2.3 cv=cZisUULM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Jdjhy38mL1oA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=isZTVz-eGo4FwaFr8wAA:9 a=CjuIK1q_8ugA:10 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 3FEB42BA; Thu, 30 Jan 2020 20:05:32 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 00V45VIV014120; Thu, 30 Jan 2020 20:05:31 -0800 (PST) (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 00V45VZn014071; Thu, 30 Jan 2020 20:05:31 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202001310405.00V45VZn014071@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: Jeff Roberson cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357314 - in head/sys: conf kern sys vm In-reply-to: <202001310049.00V0np1a077223@repo.freebsd.org> References: <202001310049.00V0np1a077223@repo.freebsd.org> Comments: In-reply-to Jeff Roberson message dated "Fri, 31 Jan 2020 00:49:51 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 30 Jan 2020 20:05:31 -0800 X-CMAE-Envelope: MS4wfC+ZVu+YgYELcq2xwbrl3P75Qln9VpHP+0bRom7m5KE0sGTcjuFK2FsFaAbPlOuEdYtDaPjjSFeap2nrRxAJL7BBUHPrhq5NgABtqSdeq4Iozqcn0LDL hIrFg8uQMX8pY1M9QVHDSQz0ExSCRKAwoJoZWf8/Vzv8sEe8IA3iKgrnS8fQ1coRzvOMaz1KHJgAsIgDvG4B9sUEb1tNk+sohO99gJmOptPfkQvvsRT8MVPG ukMzOYJOIWaNvyD9zPS+xNv7KUA0PKHWQFKzS4x5F7cRe/EjcZDc9OB5plwviE/V X-Rspamd-Queue-Id: 4883Xx4Hy5z4494 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 04:05:38 -0000 In message <202001310049.00V0np1a077223@repo.freebsd.org>, Jeff Roberson writes : > Author: jeff > Date: Fri Jan 31 00:49:51 2020 > New Revision: 357314 > URL: https://svnweb.freebsd.org/changeset/base/357314 > > Log: > Implement a safe memory reclamation feature that is tightly coupled with UM > A. > > This is in the same family of algorithms as Epoch/QSBR/RCU/PARSEC but is > a unique algorithm. This has 3x the performance of epoch in a write heavy > workload with less than half of the read side cost. The memory overhead > is significantly lessened by limiting the free-to-use latency. A synthetic > test uses 1/20th of the memory vs Epoch. There is significant further > discussion in the comments and code review. > > This code should be considered experimental. I will write a man page after > it has settled. After further validation the VM will begin using this > feature to permit lockless page lookups. > > Both markj and cperciva tested on arm64 at large core counts to verify > fences on weaker ordering architectures. I will commit a stress testing > tool in a follow-up. > > Reviewed by: mmacy, markj, rlibby, hselasky > Discussed with: sbahara > Differential Revision: https://reviews.freebsd.org/D22586 > > Added: > head/sys/kern/subr_smr.c (contents, props changed) > head/sys/sys/_smr.h (contents, props changed) > head/sys/sys/smr.h (contents, props changed) > Modified: > head/sys/conf/files > head/sys/vm/uma.h > head/sys/vm/uma_core.c > head/sys/vm/uma_int.h > Thank you for all your hard work Jeff. -- 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-all@freebsd.org Fri Jan 31 04:49:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C21E232CB6; Fri, 31 Jan 2020 04:49:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4884Wz3TBZz45m9; Fri, 31 Jan 2020 04:49:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4F62F7393; Fri, 31 Jan 2020 04:49:51 +0000 (UTC) Date: Fri, 31 Jan 2020 04:49:51 +0000 From: Alexey Dokuchaev To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357312 - head/sys/kern Message-ID: <20200131044951.GA70989@FreeBSD.org> References: <202001302005.00UK55YU011830@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001302005.00UK55YU011830@repo.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 04:49:51 -0000 On Thu, Jan 30, 2020 at 08:05:05PM +0000, Mateusz Guzik wrote: > New Revision: 357312 > URL: https://svnweb.freebsd.org/changeset/base/357312 > > Log: > Remove duplicated empty lines from kern/*.c Thank you. Every once in a while when I want/need to hack on src code base, these superfluous newlines drive me away. :-( ./danfe From owner-svn-src-all@freebsd.org Fri Jan 31 08:36:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9D8223857D; Fri, 31 Jan 2020 08:36: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 4889YM4wHfz4HPG; Fri, 31 Jan 2020 08:36: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 A33C3B2E0; Fri, 31 Jan 2020 08:36: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 00V8aNgt057630; Fri, 31 Jan 2020 08:36:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V8aNvN057629; Fri, 31 Jan 2020 08:36:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001310836.00V8aNvN057629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Jan 2020 08:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357319 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 08:36:23 -0000 Author: mjg Date: Fri Jan 31 08:36:23 2020 New Revision: 357319 URL: https://svnweb.freebsd.org/changeset/base/357319 Log: Remove an overzealous assert from rms_runlock. Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Jan 31 02:23:48 2020 (r357318) +++ head/sys/kern/kern_rmlock.c Fri Jan 31 08:36:23 2020 (r357319) @@ -956,8 +956,6 @@ rms_runlock(struct rmslock *rms) { int *influx; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); - critical_enter(); influx = zpcpu_get(rms->readers_influx); __compiler_membar(); From owner-svn-src-all@freebsd.org Fri Jan 31 08:36:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20DB82385E3; Fri, 31 Jan 2020 08:36:50 +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 4889Yt06jTz4HWb; Fri, 31 Jan 2020 08:36:50 +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 F346CB2E1; Fri, 31 Jan 2020 08:36:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V8anWL057690; Fri, 31 Jan 2020 08:36:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V8anjE057688; Fri, 31 Jan 2020 08:36:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001310836.00V8anjE057688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Jan 2020 08:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357320 - 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: 357320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 08:36:50 -0000 Author: mjg Date: Fri Jan 31 08:36:49 2020 New Revision: 357320 URL: https://svnweb.freebsd.org/changeset/base/357320 Log: Add rms_try_rlock and rms_wowned. Modified: head/sys/kern/kern_rmlock.c head/sys/sys/rmlock.h Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Jan 31 08:36:23 2020 (r357319) +++ head/sys/kern/kern_rmlock.c Fri Jan 31 08:36:49 2020 (r357320) @@ -934,6 +934,30 @@ rms_rlock(struct rmslock *rms) critical_exit(); } +int +rms_try_rlock(struct rmslock *rms) +{ + int *influx; + + critical_enter(); + influx = zpcpu_get(rms->readers_influx); + __compiler_membar(); + *influx = 1; + __compiler_membar(); + if (__predict_false(rms->writers > 0)) { + __compiler_membar(); + *influx = 0; + critical_exit(); + return (0); + } + __compiler_membar(); + (*zpcpu_get(rms->readers_pcpu))++; + __compiler_membar(); + *influx = 0; + critical_exit(); + return (1); +} + static void __noinline rms_runlock_fallback(struct rmslock *rms) { Modified: head/sys/sys/rmlock.h ============================================================================== --- head/sys/sys/rmlock.h Fri Jan 31 08:36:23 2020 (r357319) +++ head/sys/sys/rmlock.h Fri Jan 31 08:36:49 2020 (r357320) @@ -136,9 +136,21 @@ struct rm_args { void rms_init(struct rmslock *rms, const char *name); void rms_destroy(struct rmslock *rms); void rms_rlock(struct rmslock *rms); +int rms_try_rlock(struct rmslock *rms); void rms_runlock(struct rmslock *rms); void rms_wlock(struct rmslock *rms); void rms_wunlock(struct rmslock *rms); + +/* + * Writers are not explicitly tracked, thus until that changes the best we can + * do is indicate the lock is taken for writing by *someone*. + */ +static inline int +rms_wowned(struct rmslock *rms) +{ + + return (rms->writers > 0); +} #endif /* _KERNEL */ #endif /* !_SYS_RMLOCK_H_ */ From owner-svn-src-all@freebsd.org Fri Jan 31 08:37:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3ED8D23866D; Fri, 31 Jan 2020 08:37:36 +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 4889Zm0z0cz4HfM; Fri, 31 Jan 2020 08:37:36 +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 1C931B2E3; Fri, 31 Jan 2020 08:37:36 +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 00V8bZrg057769; Fri, 31 Jan 2020 08:37:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V8bZ2W057764; Fri, 31 Jan 2020 08:37:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001310837.00V8bZ2W057764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Jan 2020 08:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357321 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 08:37:36 -0000 Author: mjg Date: Fri Jan 31 08:37:35 2020 New Revision: 357321 URL: https://svnweb.freebsd.org/changeset/base/357321 Log: zfs: provide macros to handle z_teardown_inactive_lock Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jan 31 08:36:49 2020 (r357320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jan 31 08:37:35 2020 (r357321) @@ -90,6 +90,24 @@ struct zfsvfs { #endif }; +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock) + /* * Normal filesystems (those not under .zfs/snapshot) have a total * file ID size limited to 12 bytes (including the length field) due to Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jan 31 08:36:49 2020 (r357320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jan 31 08:37:35 2020 (r357321) @@ -2055,7 +2055,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting zfsvfs->z_log = NULL; } - rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_WRITER); + ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs); /* * If we are not unmounting (ie: online recv) and someone already @@ -2063,7 +2063,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting * or a reopen of z_os failed then just bail out now. */ if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) { - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs); rrm_exit(&zfsvfs->z_teardown_lock, FTAG); return (SET_ERROR(EIO)); } @@ -2091,7 +2091,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting */ if (unmounting) { zfsvfs->z_unmounted = B_TRUE; - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs); rrm_exit(&zfsvfs->z_teardown_lock, FTAG); } @@ -2437,7 +2437,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds) znode_t *zp; ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); - ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); + ASSERT(ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); /* * We already own this, so just update the objset_t, as the one we @@ -2471,7 +2471,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds) bail: /* release the VOPs */ - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs); rrm_exit(&zfsvfs->z_teardown_lock, FTAG); if (err) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jan 31 08:36:49 2020 (r357320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jan 31 08:37:35 2020 (r357321) @@ -4247,13 +4247,13 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t zfsvfs_t *zfsvfs = zp->z_zfsvfs; int error; - rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs); if (zp->z_sa_hdl == NULL) { /* * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs); vrecycle(vp); return; } @@ -4262,7 +4262,7 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t /* * Fast path to recycle a vnode of a removed file. */ - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs); vrecycle(vp); return; } @@ -4282,7 +4282,7 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t dmu_tx_commit(tx); } } - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs); } @@ -5333,10 +5333,10 @@ zfs_freebsd_need_inactive(ap) if (vn_need_pageq_flush(vp)) return (1); - if (!rw_tryenter(&zfsvfs->z_teardown_inactive_lock, RW_READER)) + if (!ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs)) return (1); need = (zp->z_sa_hdl == NULL || zp->z_unlinked || zp->z_atime_dirty); - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs); return (need); } @@ -5359,12 +5359,12 @@ zfs_freebsd_reclaim(ap) * zfs_znode_dmu_fini in zfsvfs_teardown during * force unmount. */ - rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs); if (zp->z_sa_hdl == NULL) zfs_znode_free(zp); else zfs_zinactive(zp); - rw_exit(&zfsvfs->z_teardown_inactive_lock); + ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs); vp->v_data = NULL; return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Jan 31 08:36:49 2020 (r357320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Jan 31 08:37:35 2020 (r357321) @@ -606,7 +606,7 @@ zfs_znode_dmu_fini(znode_t *zp) { ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zp->z_zfsvfs, zp->z_id)) || zp->z_unlinked || - RW_WRITE_HELD(&zp->z_zfsvfs->z_teardown_inactive_lock)); + ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); sa_handle_destroy(zp->z_sa_hdl); zp->z_sa_hdl = NULL; From owner-svn-src-all@freebsd.org Fri Jan 31 08:38:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 854E2238703; Fri, 31 Jan 2020 08:38:39 +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 4889bz30Jwz4HnJ; Fri, 31 Jan 2020 08:38:39 +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 6205AB2E5; Fri, 31 Jan 2020 08:38:39 +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 00V8cd9w057860; Fri, 31 Jan 2020 08:38:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V8ccxJ057858; Fri, 31 Jan 2020 08:38:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001310838.00V8ccxJ057858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Jan 2020 08:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357322 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 08:38:39 -0000 Author: mjg Date: Fri Jan 31 08:38:38 2020 New Revision: 357322 URL: https://svnweb.freebsd.org/changeset/base/357322 Log: zfs: convert z_teardown_inactive_lock to sleepable read-mostly lock This eliminates a global serialisation point. It only gets write locked on unmount. Sample result doing an incremental -j 40 build: before: 173.30s user 458.97s system 2595% cpu 24.358 total after: 168.58s user 254.92s system 2211% cpu 19.147 total Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jan 31 08:37:35 2020 (r357321) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jan 31 08:38:38 2020 (r357322) @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -65,7 +66,7 @@ struct zfsvfs { boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ rrmlock_t z_teardown_lock; - krwlock_t z_teardown_inactive_lock; + struct rmslock z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ struct zfsctl_root *z_ctldir; /* .zfs directory pointer */ @@ -91,22 +92,22 @@ struct zfsvfs { }; #define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ - rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + rms_try_rlock(&(zfsvfs)->z_teardown_inactive_lock) #define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ - rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + rms_rlock(&(zfsvfs)->z_teardown_inactive_lock) #define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ - rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + rms_runlock(&(zfsvfs)->z_teardown_inactive_lock) #define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ - rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER) + rms_wlock(&(zfsvfs)->z_teardown_inactive_lock) #define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ - rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) #define ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ - RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock) + rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) /* * Normal filesystems (those not under .zfs/snapshot) have a total Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jan 31 08:37:35 2020 (r357321) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jan 31 08:38:38 2020 (r357322) @@ -1205,7 +1205,7 @@ zfsvfs_create_impl(zfsvfs_t **zfvp, zfsvfs_t *zfsvfs, #else rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); #endif - rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); + rms_init(&zfsvfs->z_teardown_inactive_lock, "zfs teardown inactive"); rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); for (int i = 0; i != ZFS_OBJ_MTX_SZ; i++) mutex_init(&zfsvfs->z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL); @@ -1322,7 +1322,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) mutex_destroy(&zfsvfs->z_lock); list_destroy(&zfsvfs->z_all_znodes); rrm_destroy(&zfsvfs->z_teardown_lock); - rw_destroy(&zfsvfs->z_teardown_inactive_lock); + rms_destroy(&zfsvfs->z_teardown_inactive_lock); rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) mutex_destroy(&zfsvfs->z_hold_mtx[i]); From owner-svn-src-all@freebsd.org Fri Jan 31 09:51:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B747B23A65D; Fri, 31 Jan 2020 09:51:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488CDB4LhPz4MxR; Fri, 31 Jan 2020 09:51:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76EB9C2FC; Fri, 31 Jan 2020 09:51:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00V9pcJA002383; Fri, 31 Jan 2020 09:51:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00V9pcQe002382; Fri, 31 Jan 2020 09:51:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001310951.00V9pcQe002382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 31 Jan 2020 09:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357323 - head/sys/arm64/acpica X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/acpica X-SVN-Commit-Revision: 357323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 09:51:38 -0000 Author: andrew Date: Fri Jan 31 09:51:38 2020 New Revision: 357323 URL: https://svnweb.freebsd.org/changeset/base/357323 Log: Ignore the SMMUv3 and PMCG interrupt controller in the IORT tables When mapping MSI/MSI-X interrupts throught he Arm IORT ACPI tables we may need to ignore an interrupt controller even if it is within the bounds the entry describes. When the SMMUv3 is not using GSIV (non-MSI/MSI-X) interrupts we need to read the defined field. The Performance Monitoring Counter Group always ignores the first table entry. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/acpica/acpi_iort.c Modified: head/sys/arm64/acpica/acpi_iort.c ============================================================================== --- head/sys/arm64/acpica/acpi_iort.c Fri Jan 31 08:38:38 2020 (r357322) +++ head/sys/arm64/acpica/acpi_iort.c Fri Jan 31 09:51:38 2020 (r357323) @@ -89,6 +89,7 @@ struct iort_node { u_int node_offset; /* offset in IORT - node ID */ u_int nentries; /* items in array below */ u_int usecount; /* for bookkeeping */ + u_int revision; /* node revision */ union { ACPI_IORT_ROOT_COMPLEX pci_rc; /* PCI root complex */ ACPI_IORT_SMMU smmu; @@ -105,6 +106,39 @@ static TAILQ_HEAD(, iort_node) pci_nodes = TAILQ_HEAD_ static TAILQ_HEAD(, iort_node) smmu_nodes = TAILQ_HEAD_INITIALIZER(smmu_nodes); static TAILQ_HEAD(, iort_node) its_groups = TAILQ_HEAD_INITIALIZER(its_groups); +static int +iort_entry_get_id_mapping_index(struct iort_node *node) +{ + + switch(node->type) { + case ACPI_IORT_NODE_SMMU_V3: + /* The ID mapping field was added in version 1 */ + if (node->revision < 1) + return (-1); + + /* + * If all the control interrupts are GISCV based the ID + * mapping field is ignored. + */ + if (node->data.smmu_v3.EventGsiv != 0 && + node->data.smmu_v3.PriGsiv != 0 && + node->data.smmu_v3.GerrGsiv != 0 && + node->data.smmu_v3.SyncGsiv != 0) + return (-1); + + if (node->data.smmu_v3.IdMappingIndex >= node->nentries) + return (-1); + + return (node->data.smmu_v3.IdMappingIndex); + case ACPI_IORT_NODE_PMCG: + return (0); + default: + break; + } + + return (-1); +} + /* * Lookup an ID in the mappings array. If successful, map the input ID * to the output ID and return the output node found. @@ -113,10 +147,13 @@ static struct iort_node * iort_entry_lookup(struct iort_node *node, u_int id, u_int *outid) { struct iort_map_entry *entry; - int i; + int i, id_map; + id_map = iort_entry_get_id_mapping_index(node); entry = node->entries.mappings; for (i = 0; i < node->nentries; i++, entry++) { + if (i == id_map) + continue; if (entry->base <= id && id <= entry->end) break; } @@ -243,6 +280,7 @@ iort_add_nodes(ACPI_IORT_NODE *node_entry, u_int node_ node = malloc(sizeof(*node), M_DEVBUF, M_WAITOK | M_ZERO); node->type = node_entry->Type; node->node_offset = node_offset; + node->revision = node_entry->Revision; /* copy nodes depending on type */ switch(node_entry->Type) { From owner-svn-src-all@freebsd.org Fri Jan 31 10:08:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1E9723AFD0; Fri, 31 Jan 2020 10:08:49 +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 488Cc12jlzz4P4F; Fri, 31 Jan 2020 10:08:48 +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 00VA8l8Y072915; Fri, 31 Jan 2020 02:08:47 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 00VA8kus072914; Fri, 31 Jan 2020 02:08:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202001311008.00VA8kus072914@gndrsh.dnsmgr.net> Subject: Re: svn commit: r357316 - in head/sys: kern sys In-Reply-To: <202001310208.00V28AQo024196@repo.freebsd.org> To: Jeff Roberson Date: Fri, 31 Jan 2020 02:08:46 -0800 (PST) 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: 488Cc12jlzz4P4F X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:08:49 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: jeff > Date: Fri Jan 31 02:08:09 2020 > New Revision: 357316 > URL: https://svnweb.freebsd.org/changeset/base/357316 > > Log: > Don't use "All rights reserved" in new copyrights. > > Requested by: rgrimes Thank you. > > Modified: > head/sys/kern/subr_smr.c > head/sys/sys/_smr.h > head/sys/sys/smr.h > > Modified: head/sys/kern/subr_smr.c > ============================================================================== > --- head/sys/kern/subr_smr.c Fri Jan 31 02:03:22 2020 (r357315) > +++ head/sys/kern/subr_smr.c Fri Jan 31 02:08:09 2020 (r357316) > @@ -1,8 +1,7 @@ > /*- > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > - * Copyright (c) 2019 Jeffrey Roberson > - * All rights reserved. > + * Copyright (c) 2019,2020 Jeffrey Roberson > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/sys/_smr.h > ============================================================================== > --- head/sys/sys/_smr.h Fri Jan 31 02:03:22 2020 (r357315) > +++ head/sys/sys/_smr.h Fri Jan 31 02:08:09 2020 (r357316) > @@ -1,8 +1,7 @@ > /*- > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > - * Copyright (c) 2019,2020 Jeffrey Roberson > - * All rights reserved. > + * Copyright (c) 2019, 2020 Jeffrey Roberson > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > > Modified: head/sys/sys/smr.h > ============================================================================== > --- head/sys/sys/smr.h Fri Jan 31 02:03:22 2020 (r357315) > +++ head/sys/sys/smr.h Fri Jan 31 02:08:09 2020 (r357316) > @@ -1,8 +1,7 @@ > /*- > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > - * Copyright (c) 2019,2020 Jeffrey Roberson > - * All rights reserved. > + * Copyright (c) 2019, 2020 Jeffrey Roberson > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 31 10:30:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 986C923B781; Fri, 31 Jan 2020 10:30:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488D4j3WRrz4Q9g; Fri, 31 Jan 2020 10:30:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73DC7C8EE; Fri, 31 Jan 2020 10:30:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VAUDo8024206; Fri, 31 Jan 2020 10:30:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VAUDTU024205; Fri, 31 Jan 2020 10:30:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001311030.00VAUDTU024205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 31 Jan 2020 10:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357324 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:30:13 -0000 Author: andrew Date: Fri Jan 31 10:30:13 2020 New Revision: 357324 URL: https://svnweb.freebsd.org/changeset/base/357324 Log: Only create one ITS configuration table When there are multiple ITS devices in the system we would allocate a configuration table for each, however only one table is needed as all the ITS devices share this. Allocate a table only when the global table is unset. While here fix the type of this to be a pointer to a uint8_t array as the entries are all 8 bits wide. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Fri Jan 31 09:51:38 2020 (r357323) +++ head/sys/arm64/arm64/gicv3_its.c Fri Jan 31 10:30:13 2020 (r357324) @@ -224,6 +224,7 @@ struct its_col { struct gicv3_its_irqsrc { struct intr_irqsrc gi_isrc; u_int gi_irq; + u_int gi_lpi; struct its_dev *gi_its_dev; }; @@ -241,7 +242,7 @@ struct gicv3_its_softc { * TODO: We should get these from the parent as we only want a * single copy of each across the interrupt controller. */ - vm_offset_t sc_conf_base; + uint8_t *sc_conf_base; vm_offset_t sc_pend_base[MAXCPU]; /* Command handling */ @@ -263,6 +264,8 @@ struct gicv3_its_softc { u_int sc_its_flags; }; +static void *conf_base; + typedef void (its_quirk_func_t)(device_t); static its_quirk_func_t its_quirk_cavium_22375; @@ -542,17 +545,29 @@ gicv3_its_table_init(device_t dev, struct gicv3_its_so static void gicv3_its_conftable_init(struct gicv3_its_softc *sc) { + void *conf_table; - sc->sc_conf_base = (vm_offset_t)contigmalloc(LPI_CONFTAB_SIZE, - M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR, LPI_CONFTAB_ALIGN, - 0); + conf_table = (void *)atomic_load_ptr((uintptr_t *)&conf_base); + if (conf_table == NULL) { + conf_table = contigmalloc(LPI_CONFTAB_SIZE, + M_GICV3_ITS, M_WAITOK, 0, LPI_CONFTAB_MAX_ADDR, + LPI_CONFTAB_ALIGN, 0); + if (atomic_cmpset_ptr((uintptr_t *)&conf_base, + (uintptr_t)NULL, (uintptr_t)conf_table) == 0) { + contigfree(conf_table, LPI_CONFTAB_SIZE, M_GICV3_ITS); + conf_table = + (void *)atomic_load_ptr((uintptr_t *)&conf_base); + } + } + sc->sc_conf_base = conf_table; + /* Set the default configuration */ - memset((void *)sc->sc_conf_base, GIC_PRIORITY_MAX | LPI_CONF_GROUP1, + memset(sc->sc_conf_base, GIC_PRIORITY_MAX | LPI_CONF_GROUP1, LPI_CONFTAB_SIZE); /* Flush the table to memory */ - cpu_dcache_wb_range(sc->sc_conf_base, LPI_CONFTAB_SIZE); + cpu_dcache_wb_range((vm_offset_t)sc->sc_conf_base, LPI_CONFTAB_SIZE); } static void @@ -792,6 +807,7 @@ gicv3_its_attach(device_t dev) name = device_get_nameunit(dev); for (i = 0; i < sc->sc_irq_length; i++) { sc->sc_irqs[i].gi_irq = i; + sc->sc_irqs[i].gi_lpi = i + sc->sc_irq_base - GIC_FIRST_LPI; err = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, 0, "%s,%u", name, i); } @@ -824,13 +840,13 @@ gicv3_its_disable_intr(device_t dev, struct intr_irqsr sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - conf = (uint8_t *)sc->sc_conf_base; + conf = sc->sc_conf_base; - conf[girq->gi_irq] &= ~LPI_CONF_ENABLE; + conf[girq->gi_lpi] &= ~LPI_CONF_ENABLE; if ((sc->sc_its_flags & ITS_FLAGS_LPI_CONF_FLUSH) != 0) { /* Clean D-cache under command. */ - cpu_dcache_wb_range((vm_offset_t)&conf[girq->gi_irq], 1); + cpu_dcache_wb_range((vm_offset_t)&conf[girq->gi_lpi], 1); } else { /* DSB inner shareable, store */ dsb(ishst); @@ -848,13 +864,13 @@ gicv3_its_enable_intr(device_t dev, struct intr_irqsrc sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - conf = (uint8_t *)sc->sc_conf_base; + conf = sc->sc_conf_base; - conf[girq->gi_irq] |= LPI_CONF_ENABLE; + conf[girq->gi_lpi] |= LPI_CONF_ENABLE; if ((sc->sc_its_flags & ITS_FLAGS_LPI_CONF_FLUSH) != 0) { /* Clean D-cache under command. */ - cpu_dcache_wb_range((vm_offset_t)&conf[girq->gi_irq], 1); + cpu_dcache_wb_range((vm_offset_t)&conf[girq->gi_lpi], 1); } else { /* DSB inner shareable, store */ dsb(ishst); From owner-svn-src-all@freebsd.org Fri Jan 31 10:34:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F263923B9CB; Fri, 31 Jan 2020 10:34:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488D9n690mz4QYd; Fri, 31 Jan 2020 10:34:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE915CAAB; Fri, 31 Jan 2020 10:34:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VAYbVR029849; Fri, 31 Jan 2020 10:34:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VAYbWO029846; Fri, 31 Jan 2020 10:34:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001311034.00VAYbWO029846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 31 Jan 2020 10:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357325 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 357325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:34:38 -0000 Author: kp Date: Fri Jan 31 10:34:36 2020 New Revision: 357325 URL: https://svnweb.freebsd.org/changeset/base/357325 Log: MFC r357233: epair: Do not abuse params to register the second interface if_epair used the 'params' argument to pass a pointer to the b interface through if_clone_create(). This pointer can be controlled by userspace, which means it could be abused to trigger a panic. While this requires PRIV_NET_IFCREATE privileges those are assigned to vnet jails, which means that vnet jails could panic the system. Reported by: Ilja Van Sprundel Modified: stable/12/sys/net/if_clone.c stable/12/sys/net/if_clone.h stable/12/sys/net/if_epair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_clone.c ============================================================================== --- stable/12/sys/net/if_clone.c Fri Jan 31 10:30:13 2020 (r357324) +++ stable/12/sys/net/if_clone.c Fri Jan 31 10:34:36 2020 (r357325) @@ -211,6 +211,18 @@ if_clone_create(char *name, size_t len, caddr_t params return (if_clone_createif(ifc, name, len, params)); } +void +if_clone_addif(struct if_clone *ifc, struct ifnet *ifp) +{ + + if ((ifc->ifc_flags & IFC_NOGROUP) == 0) + if_addgroup(ifp, ifc->ifc_name); + + IF_CLONE_LOCK(ifc); + IFC_IFLIST_INSERT(ifc, ifp); + IF_CLONE_UNLOCK(ifc); +} + /* * Create a clone network interface. */ @@ -233,12 +245,7 @@ if_clone_createif(struct if_clone *ifc, char *name, si if (ifp == NULL) panic("%s: lookup failed for %s", __func__, name); - if ((ifc->ifc_flags & IFC_NOGROUP) == 0) - if_addgroup(ifp, ifc->ifc_name); - - IF_CLONE_LOCK(ifc); - IFC_IFLIST_INSERT(ifc, ifp); - IF_CLONE_UNLOCK(ifc); + if_clone_addif(ifc, ifp); } return (err); Modified: stable/12/sys/net/if_clone.h ============================================================================== --- stable/12/sys/net/if_clone.h Fri Jan 31 10:30:13 2020 (r357324) +++ stable/12/sys/net/if_clone.h Fri Jan 31 10:34:36 2020 (r357325) @@ -79,7 +79,8 @@ int if_clone_list(struct if_clonereq *); struct if_clone *if_clone_findifc(struct ifnet *); void if_clone_addgroup(struct ifnet *, struct if_clone *); -/* The below interface used only by epair(4). */ +/* The below interfaces are used only by epair(4). */ +void if_clone_addif(struct if_clone *, struct ifnet *); int if_clone_destroyif(struct if_clone *, struct ifnet *); #endif /* _KERNEL */ Modified: stable/12/sys/net/if_epair.c ============================================================================== --- stable/12/sys/net/if_epair.c Fri Jan 31 10:30:13 2020 (r357324) +++ stable/12/sys/net/if_epair.c Fri Jan 31 10:34:36 2020 (r357325) @@ -711,6 +711,21 @@ epair_clone_match(struct if_clone *ifc, const char *na return (1); } +static void +epair_clone_add(struct if_clone *ifc, struct epair_softc *scb) +{ + struct ifnet *ifp; + uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ + + ifp = scb->ifp; + /* Copy epairNa etheraddr and change the last byte. */ + memcpy(eaddr, scb->oifp->if_hw_addr, ETHER_ADDR_LEN); + eaddr[5] = 0x0b; + ether_ifattach(ifp, eaddr); + + if_clone_addif(ifc, ifp); +} + static int epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { @@ -723,24 +738,6 @@ epair_clone_create(struct if_clone *ifc, char *name, s uint32_t hash; uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ - /* - * We are abusing params to create our second interface. - * Actually we already created it and called if_clone_create() - * for it to do the official insertion procedure the moment we knew - * it cannot fail anymore. So just do attach it here. - */ - if (params) { - scb = (struct epair_softc *)params; - ifp = scb->ifp; - /* Copy epairNa etheraddr and change the last byte. */ - memcpy(eaddr, scb->oifp->if_hw_addr, ETHER_ADDR_LEN); - eaddr[5] = 0x0b; - ether_ifattach(ifp, eaddr); - /* Correctly set the name for the cloner list. */ - strlcpy(name, ifp->if_xname, len); - return (0); - } - /* Try to see if a special unit was requested. */ error = ifc_name2unit(name, &unit); if (error != 0) @@ -891,10 +888,11 @@ epair_clone_create(struct if_clone *ifc, char *name, s if_setsendqready(ifp); /* We need to play some tricks here for the second interface. */ strlcpy(name, epairname, len); - error = if_clone_create(name, len, (caddr_t)scb); - if (error) - panic("%s: if_clone_create() for our 2nd iface failed: %d", - __func__, error); + + /* Correctly set the name for the cloner list. */ + strlcpy(name, scb->ifp->if_xname, len); + epair_clone_add(ifc, scb); + scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; From owner-svn-src-all@freebsd.org Fri Jan 31 10:34:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F312423B9E5; Fri, 31 Jan 2020 10:34:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488D9p6D1wz4QYn; Fri, 31 Jan 2020 10:34:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0C8BCAAC; Fri, 31 Jan 2020 10:34:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VAYcYd029894; Fri, 31 Jan 2020 10:34:38 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VAYc4x029891; Fri, 31 Jan 2020 10:34:38 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001311034.00VAYc4x029891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 31 Jan 2020 10:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357326 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 357326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:34:39 -0000 Author: kp Date: Fri Jan 31 10:34:38 2020 New Revision: 357326 URL: https://svnweb.freebsd.org/changeset/base/357326 Log: MFC r357233: epair: Do not abuse params to register the second interface if_epair used the 'params' argument to pass a pointer to the b interface through if_clone_create(). This pointer can be controlled by userspace, which means it could be abused to trigger a panic. While this requires PRIV_NET_IFCREATE privileges those are assigned to vnet jails, which means that vnet jails could panic the system. Reported by: Ilja Van Sprundel Modified: stable/11/sys/net/if_clone.c stable/11/sys/net/if_clone.h stable/11/sys/net/if_epair.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_clone.c ============================================================================== --- stable/11/sys/net/if_clone.c Fri Jan 31 10:34:36 2020 (r357325) +++ stable/11/sys/net/if_clone.c Fri Jan 31 10:34:38 2020 (r357326) @@ -208,6 +208,17 @@ if_clone_create(char *name, size_t len, caddr_t params return (if_clone_createif(ifc, name, len, params)); } +void +if_clone_addif(struct if_clone *ifc, struct ifnet *ifp) +{ + + if_addgroup(ifp, ifc->ifc_name); + + IF_CLONE_LOCK(ifc); + IFC_IFLIST_INSERT(ifc, ifp); + IF_CLONE_UNLOCK(ifc); +} + /* * Create a clone network interface. */ @@ -230,11 +241,7 @@ if_clone_createif(struct if_clone *ifc, char *name, si if (ifp == NULL) panic("%s: lookup failed for %s", __func__, name); - if_addgroup(ifp, ifc->ifc_name); - - IF_CLONE_LOCK(ifc); - IFC_IFLIST_INSERT(ifc, ifp); - IF_CLONE_UNLOCK(ifc); + if_clone_addif(ifc, ifp); } return (err); Modified: stable/11/sys/net/if_clone.h ============================================================================== --- stable/11/sys/net/if_clone.h Fri Jan 31 10:34:36 2020 (r357325) +++ stable/11/sys/net/if_clone.h Fri Jan 31 10:34:38 2020 (r357326) @@ -72,7 +72,8 @@ int if_clone_list(struct if_clonereq *); struct if_clone *if_clone_findifc(struct ifnet *); void if_clone_addgroup(struct ifnet *, struct if_clone *); -/* The below interface used only by epair(4). */ +/* The below interfaces are used only by epair(4). */ +void if_clone_addif(struct if_clone *, struct ifnet *); int if_clone_destroyif(struct if_clone *, struct ifnet *); #endif /* _KERNEL */ Modified: stable/11/sys/net/if_epair.c ============================================================================== --- stable/11/sys/net/if_epair.c Fri Jan 31 10:34:36 2020 (r357325) +++ stable/11/sys/net/if_epair.c Fri Jan 31 10:34:38 2020 (r357326) @@ -704,6 +704,23 @@ epair_clone_match(struct if_clone *ifc, const char *na return (1); } +static void +epair_clone_add(struct if_clone *ifc, struct epair_softc *scb) +{ + struct ifnet *ifp; + uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ + + ifp = scb->ifp; + /* Assign a hopefully unique, locally administered etheraddr. */ + eaddr[0] = 0x02; + eaddr[3] = (ifp->if_index >> 8) & 0xff; + eaddr[4] = ifp->if_index & 0xff; + eaddr[5] = 0x0b; + ether_ifattach(ifp, eaddr); + + if_clone_addif(ifc, ifp); +} + static int epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { @@ -713,26 +730,6 @@ epair_clone_create(struct if_clone *ifc, char *name, s int error, unit, wildcard; uint8_t eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ - /* - * We are abusing params to create our second interface. - * Actually we already created it and called if_clone_create() - * for it to do the official insertion procedure the moment we knew - * it cannot fail anymore. So just do attach it here. - */ - if (params) { - scb = (struct epair_softc *)params; - ifp = scb->ifp; - /* Assign a hopefully unique, locally administered etheraddr. */ - eaddr[0] = 0x02; - eaddr[3] = (ifp->if_index >> 8) & 0xff; - eaddr[4] = ifp->if_index & 0xff; - eaddr[5] = 0x0b; - ether_ifattach(ifp, eaddr); - /* Correctly set the name for the cloner list. */ - strlcpy(name, scb->ifp->if_xname, len); - return (0); - } - /* Try to see if a special unit was requested. */ error = ifc_name2unit(name, &unit); if (error != 0) @@ -860,10 +857,11 @@ epair_clone_create(struct if_clone *ifc, char *name, s ifp->if_snd.ifq_maxlen = ifqmaxlen; /* We need to play some tricks here for the second interface. */ strlcpy(name, epairname, len); - error = if_clone_create(name, len, (caddr_t)scb); - if (error) - panic("%s: if_clone_create() for our 2nd iface failed: %d", - __func__, error); + + /* Correctly set the name for the cloner list. */ + strlcpy(name, scb->ifp->if_xname, len); + epair_clone_add(ifc, scb); + scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; From owner-svn-src-all@freebsd.org Fri Jan 31 10:41:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFBB723BD54; Fri, 31 Jan 2020 10:41:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488DL366j1z4R0G; Fri, 31 Jan 2020 10:41:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD20ACB27; Fri, 31 Jan 2020 10:41:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VAflRH035618; Fri, 31 Jan 2020 10:41:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VAflik035617; Fri, 31 Jan 2020 10:41:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001311041.00VAflik035617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Jan 2020 10:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357327 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 357327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:41:48 -0000 Author: hselasky Date: Fri Jan 31 10:41:47 2020 New Revision: 357327 URL: https://svnweb.freebsd.org/changeset/base/357327 Log: Widen EPOCH(9) usage in mlx4en(4). Make sure all receive completion callbacks are covered by the network EPOCH(9), because this is required when calling if_input() and ether_input() after r357012. Convert some spaces to tabs while at it. Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Fri Jan 31 10:34:38 2020 (r357326) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Fri Jan 31 10:41:47 2020 (r357327) @@ -866,14 +866,16 @@ out: /* Rx CQ polling - called by NAPI */ static int mlx4_en_poll_rx_cq(struct mlx4_en_cq *cq, int budget) { - struct net_device *dev = cq->dev; - int done; + struct net_device *dev = cq->dev; + struct epoch_tracker et; + int done; - done = mlx4_en_process_rx_cq(dev, cq, budget); - cq->tot_rx += done; + NET_EPOCH_ENTER(et); + done = mlx4_en_process_rx_cq(dev, cq, budget); + NET_EPOCH_EXIT(et); + cq->tot_rx += done; - return done; - + return done; } void mlx4_en_rx_irq(struct mlx4_cq *mcq) { From owner-svn-src-all@freebsd.org Fri Jan 31 10:51:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D290D23BF02; Fri, 31 Jan 2020 10:51:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488DXx5BH4z4RPM; Fri, 31 Jan 2020 10:51:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD54ACCC2; Fri, 31 Jan 2020 10:51:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VApDso038307; Fri, 31 Jan 2020 10:51:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VApDEs038306; Fri, 31 Jan 2020 10:51:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001311051.00VApDEs038306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 31 Jan 2020 10:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357328 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 10:51:13 -0000 Author: hselasky Date: Fri Jan 31 10:51:13 2020 New Revision: 357328 URL: https://svnweb.freebsd.org/changeset/base/357328 Log: Revert r357293. The netisr uses rm_ locks not rms_ locks as noted by jeff@ . Sponsored by: Mellanox Technologies Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Fri Jan 31 10:41:47 2020 (r357327) +++ head/sys/net/netisr.c Fri Jan 31 10:51:13 2020 (r357328) @@ -920,7 +920,6 @@ netisr_process_workstream_proto(struct netisr_workstre static void swi_net(void *arg) { - struct epoch_tracker et; #ifdef NETISR_LOCKING struct rm_priotracker tracker; #endif @@ -932,9 +931,7 @@ swi_net(void *arg) #ifdef DEVICE_POLLING KASSERT(nws_count == 1, ("%s: device_polling but nws_count != 1", __func__)); - NET_EPOCH_ENTER(et); netisr_poll(); - NET_EPOCH_EXIT(et); #endif #ifdef NETISR_LOCKING NETISR_RLOCK(&tracker); @@ -943,7 +940,6 @@ swi_net(void *arg) KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running")); if (nwsp->nws_flags & NWS_DISPATCHING) goto out; - NET_EPOCH_ENTER(et); nwsp->nws_flags |= NWS_RUNNING; nwsp->nws_flags &= ~NWS_SCHEDULED; while ((bits = nwsp->nws_pendingbits) != 0) { @@ -954,7 +950,6 @@ swi_net(void *arg) } } nwsp->nws_flags &= ~NWS_RUNNING; - NET_EPOCH_EXIT(et); out: NWS_UNLOCK(nwsp); #ifdef NETISR_LOCKING From owner-svn-src-all@freebsd.org Fri Jan 31 11:31:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4060A23CC73; Fri, 31 Jan 2020 11:31:15 +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 488FR70xXXz4TK4; Fri, 31 Jan 2020 11:31:15 +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 1B9EED537; Fri, 31 Jan 2020 11:31:15 +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 00VBVEEx061695; Fri, 31 Jan 2020 11:31:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VBVEPn061694; Fri, 31 Jan 2020 11:31:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001311131.00VBVEPn061694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 31 Jan 2020 11:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357329 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 11:31:15 -0000 Author: mjg Date: Fri Jan 31 11:31:14 2020 New Revision: 357329 URL: https://svnweb.freebsd.org/changeset/base/357329 Log: vfs: revert the overzealous assert added in r357285 to vgone The intent was to make it more likely to catch filesystems with custom need_inactive routines which fail to call vn_need_pageq_flush (or do an equivalent). One immediate case which is missed is vgone from called by inactive itself. A better assertion may land later. The routine is not added to vputx because it is of no use to tmpfs et al. Reported by: syzbot+5f697ec11f89b60941db@syzkaller.appspotmail.com Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 31 10:51:13 2020 (r357328) +++ head/sys/kern/vfs_subr.c Fri Jan 31 11:31:14 2020 (r357329) @@ -3862,7 +3862,6 @@ vgonel(struct vnode *vp) vinactivef(vp); VI_UNLOCK(vp); } - VNPASS(!vn_need_pageq_flush(vp), vp); if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); @@ -4994,7 +4993,7 @@ vn_need_pageq_flush(struct vnode *vp) struct vm_object *obj; int need; - VNPASS(VN_IS_DOOMED(vp) || mtx_owned(VI_MTX(vp)), vp); + MPASS(mtx_owned(VI_MTX(vp))); need = 0; if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && vm_object_mightbedirty(obj)) From owner-svn-src-all@freebsd.org Fri Jan 31 11:33:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E96223CD05; Fri, 31 Jan 2020 11:33:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488FTN3j5kz4TXJ; Fri, 31 Jan 2020 11:33:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60253D5B4; Fri, 31 Jan 2020 11:33:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VBXCda065868; Fri, 31 Jan 2020 11:33:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VBXCmb065867; Fri, 31 Jan 2020 11:33:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001311133.00VBXCmb065867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 31 Jan 2020 11:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357330 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 11:33:12 -0000 Author: andrew Date: Fri Jan 31 11:33:11 2020 New Revision: 357330 URL: https://svnweb.freebsd.org/changeset/base/357330 Log: Call the MAPTI command earlier in the ITS driver The GICv3 Software Overview suggests when allocating a new MSI/MSI-X interrupt we need to call MAPD followed by MAPTI. Unfortunately the code would place a MOVI command between these. This is invalid as it needs values set by the MAPTI to be present. Re-order so we allocate a temporary CPU for the interrupt, then use the MAPTI command to assign the MSI to it. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Fri Jan 31 11:31:14 2020 (r357329) +++ head/sys/arm64/arm64/gicv3_its.c Fri Jan 31 11:33:11 2020 (r357330) @@ -928,21 +928,29 @@ gicv3_its_post_filter(device_t dev, struct intr_irqsrc } static int -gicv3_its_bind_intr(device_t dev, struct intr_irqsrc *isrc) +gicv3_its_select_cpu(device_t dev, struct intr_irqsrc *isrc) { - struct gicv3_its_irqsrc *girq; struct gicv3_its_softc *sc; sc = device_get_softc(dev); - girq = (struct gicv3_its_irqsrc *)isrc; if (CPU_EMPTY(&isrc->isrc_cpu)) { sc->gic_irq_cpu = intr_irq_next_cpu(sc->gic_irq_cpu, &sc->sc_cpus); CPU_SETOF(sc->gic_irq_cpu, &isrc->isrc_cpu); } - its_cmd_movi(dev, girq); + return (0); +} +static int +gicv3_its_bind_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gicv3_its_irqsrc *girq; + + gicv3_its_select_cpu(dev, isrc); + + girq = (struct gicv3_its_irqsrc *)isrc; + its_cmd_movi(dev, girq); return (0); } @@ -1129,6 +1137,10 @@ gicv3_its_alloc_msi(device_t dev, device_t child, int girq = &sc->sc_irqs[irq]; girq->gi_its_dev = its_dev; srcs[i] = (struct intr_irqsrc *)girq; + + /* Map the message to the given IRQ */ + gicv3_its_select_cpu(dev, (struct intr_irqsrc *)girq); + its_cmd_mapti(dev, girq); } its_dev->lpis.lpi_busy += count; *pic = dev; @@ -1189,6 +1201,10 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev girq = &sc->sc_irqs[irq]; girq->gi_its_dev = its_dev; + /* Map the message to the given IRQ */ + gicv3_its_select_cpu(dev, (struct intr_irqsrc *)girq); + its_cmd_mapti(dev, girq); + *pic = dev; *isrcp = (struct intr_irqsrc *)girq; @@ -1228,9 +1244,6 @@ gicv3_its_map_msi(device_t dev, device_t child, struct sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - - /* Map the message to the given IRQ */ - its_cmd_mapti(dev, girq); *addr = vtophys(rman_get_virtual(sc->sc_its_res)) + GITS_TRANSLATER; *data = girq->gi_irq - girq->gi_its_dev->lpis.lpi_base; From owner-svn-src-all@freebsd.org Fri Jan 31 12:38:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61DB823F1F1; Fri, 31 Jan 2020 12:38:54 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488GxB1mDpz4YRV; Fri, 31 Jan 2020 12:38:54 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33380E0AC; Fri, 31 Jan 2020 12:38:54 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VCcsRn003267; Fri, 31 Jan 2020 12:38:54 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VCcr1A003265; Fri, 31 Jan 2020 12:38:53 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <202001311238.00VCcr1A003265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Fri, 31 Jan 2020 12:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357331 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 357331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 12:38:54 -0000 Author: nyan Date: Fri Jan 31 12:38:53 2020 New Revision: 357331 URL: https://svnweb.freebsd.org/changeset/base/357331 Log: MFC r357043: Fix kernel-tags target. > - A depend-file is broken up into .depend.*.o files. [1] > - Fix an assembly file support. > > PR: 241746 > Submitted by: leres [1] Modified: stable/12/sys/conf/kern.post.mk stable/12/sys/conf/systags.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/kern.post.mk ============================================================================== --- stable/12/sys/conf/kern.post.mk Fri Jan 31 11:33:11 2020 (r357330) +++ stable/12/sys/conf/kern.post.mk Fri Jan 31 12:38:53 2020 (r357331) @@ -355,7 +355,8 @@ kernel-cleandepend: .PHONY rm -f .depend .depend.* ${_ILINKS} kernel-tags: - @[ -f .depend ] || { echo "you must make depend first"; exit 1; } + @ls .depend.* > /dev/null 2>&1 || \ + { echo "you must make depend first"; exit 1; } sh $S/conf/systags.sh kernel-install: .PHONY Modified: stable/12/sys/conf/systags.sh ============================================================================== --- stable/12/sys/conf/systags.sh Fri Jan 31 11:33:11 2020 (r357330) +++ stable/12/sys/conf/systags.sh Fri Jan 31 12:38:53 2020 (r357331) @@ -39,14 +39,14 @@ rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles sed -e "s, machine/, ../../include/,g" \ - -e 's,[a-z][^/ ]*/\.\./,,g' .depend | awk '{ + -e 's,[a-z][^/ ]*/\.\./,,g' .depend.* | awk '{ for (i = 1; i <= NF; ++i) { t = substr($i, length($i) - 1) if (t == ".c") cfiles[$i] = 1; else if (t == ".h") hfiles[$i] = 1; - else if (t == ".s") + else if (t == ".s" || t == ".S") sfiles[$i] = 1; } }; From owner-svn-src-all@freebsd.org Fri Jan 31 12:39:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85FE323F29A; Fri, 31 Jan 2020 12:39:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488GyJ31qPz4Yb5; Fri, 31 Jan 2020 12:39:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62DE9E0AD; Fri, 31 Jan 2020 12:39:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VCdqot003354; Fri, 31 Jan 2020 12:39:52 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VCdqiA003353; Fri, 31 Jan 2020 12:39:52 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <202001311239.00VCdqiA003353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Fri, 31 Jan 2020 12:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357332 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 357332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 12:39:52 -0000 Author: nyan Date: Fri Jan 31 12:39:51 2020 New Revision: 357332 URL: https://svnweb.freebsd.org/changeset/base/357332 Log: MFC r357043: Fix kernel-tags target. > - A depend-file is broken up into .depend.*.o files. [1] > - Fix an assembly file support. > > PR: 241746 > Submitted by: leres [1] Modified: stable/11/sys/conf/kern.post.mk stable/11/sys/conf/systags.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Fri Jan 31 12:38:53 2020 (r357331) +++ stable/11/sys/conf/kern.post.mk Fri Jan 31 12:39:51 2020 (r357332) @@ -312,7 +312,8 @@ kernel-cleandepend: .PHONY rm -f ${DEPENDFILES} ${_ILINKS} kernel-tags: - @[ -f .depend ] || { echo "you must make depend first"; exit 1; } + @ls .depend.* > /dev/null 2>&1 || \ + { echo "you must make depend first"; exit 1; } sh $S/conf/systags.sh kernel-install: .PHONY Modified: stable/11/sys/conf/systags.sh ============================================================================== --- stable/11/sys/conf/systags.sh Fri Jan 31 12:38:53 2020 (r357331) +++ stable/11/sys/conf/systags.sh Fri Jan 31 12:39:51 2020 (r357332) @@ -37,14 +37,14 @@ rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles sed -e "s, machine/, ../../include/,g" \ - -e 's,[a-z][^/ ]*/\.\./,,g' .depend | awk '{ + -e 's,[a-z][^/ ]*/\.\./,,g' .depend.* | awk '{ for (i = 1; i <= NF; ++i) { t = substr($i, length($i) - 1) if (t == ".c") cfiles[$i] = 1; else if (t == ".h") hfiles[$i] = 1; - else if (t == ".s") + else if (t == ".s" || t == ".S") sfiles[$i] = 1; } }; From owner-svn-src-all@freebsd.org Fri Jan 31 13:18:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54D0423FD2E; Fri, 31 Jan 2020 13:18: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 488Hpq1ZZpz4bJ3; Fri, 31 Jan 2020 13:18: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 2CFE4E89B; Fri, 31 Jan 2020 13:18: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 00VDIRWU026739; Fri, 31 Jan 2020 13:18:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VDIPvk026732; Fri, 31 Jan 2020 13:18:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001311318.00VDIPvk026732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 31 Jan 2020 13:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357333 - in stable/12: etc libexec/rc libexec/rc/rc.d share/man/man5 sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: etc libexec/rc libexec/rc/rc.d share/man/man5 sys/sys X-SVN-Commit-Revision: 357333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 13:18:27 -0000 Author: imp Date: Fri Jan 31 13:18:25 2020 New Revision: 357333 URL: https://svnweb.freebsd.org/changeset/base/357333 Log: MFC r354922 > Author: imp > Date: Wed Nov 20 23:45:31 2019 +0000 > > Create /etc/os-release file. > > Each boot, regenerate /var/run/os-release based on the currently running > system. Create a /etc/os-release symlink pointing to this file (so that this > doesn't create a new reason /etc can not be mounted read-only). > > This is compatible with what other systems do and is what the sysutil/os-release > port attempted to do, but in an incomplete way. Linux, Solaris and DragonFly all > implement this natively as well. The complete standard can be found at > https://www.freedesktop.org/software/systemd/man/os-release.html > > Moving this to the base solves both the non-standard location problem with the > port, as well as the lack of update of this file on system update. > > Bump __FreeBSD_version to 1300060 > > PR: 238953 > Differential Revision: https://reviews.freebsd.org/D22271 Execpt bump __FreeBSD_version to 1201511 Added: stable/12/libexec/rc/rc.d/os-release - copied unchanged from r354922, head/libexec/rc/rc.d/os-release stable/12/share/man/man5/os-release.5 - copied unchanged from r354922, head/share/man/man5/os-release.5 Modified: stable/12/etc/Makefile stable/12/libexec/rc/rc.conf stable/12/libexec/rc/rc.d/Makefile stable/12/share/man/man5/Makefile stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/Makefile ============================================================================== --- stable/12/etc/Makefile Fri Jan 31 12:39:51 2020 (r357332) +++ stable/12/etc/Makefile Fri Jan 31 13:18:25 2020 (r357333) @@ -82,6 +82,8 @@ distribution: ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt + ${INSTALL_SYMLINK} ../var/run/os-release \ + ${DESTDIR}/etc/os-release .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Fri Jan 31 12:39:51 2020 (r357332) +++ stable/12/libexec/rc/rc.conf Fri Jan 31 13:18:25 2020 (r357333) @@ -680,6 +680,9 @@ entropy_save_sz="4096" # Size of the entropy cache fil entropy_save_num="8" # Number of entropy cache files to save. harvest_mask="511" # Entropy device harvests all but the very invasive sources. # (See 'sysctl kern.random.harvest' and random(4)) +osrelease_enable="YES" # Update /var/run/os-release on boot (or NO). +osrelease_file="/var/run/os-release" # File to update for os-release. +osrelease_perms="444" # Default permission for os-release file. dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) Modified: stable/12/libexec/rc/rc.d/Makefile ============================================================================== --- stable/12/libexec/rc/rc.d/Makefile Fri Jan 31 12:39:51 2020 (r357332) +++ stable/12/libexec/rc/rc.d/Makefile Fri Jan 31 13:18:25 2020 (r357333) @@ -80,6 +80,7 @@ CONFS= DAEMON \ nsswitch \ ntpdate \ ${_opensm} \ + os-release \ pf \ pflog \ pfsync \ Copied: stable/12/libexec/rc/rc.d/os-release (from r354922, head/libexec/rc/rc.d/os-release) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/libexec/rc/rc.d/os-release Fri Jan 31 13:18:25 2020 (r357333, copy of r354922, head/libexec/rc/rc.d/os-release) @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: os-release +# REQUIRE: mountcritremote FILESYSTEMS +# BEFORE: LOGIN + +. /etc/rc.subr + +: ${osrelease_file:=/var/run/os-release} +: ${osrelease_perms:=444} +name="osrelease" +desc="Update ${osrelease_file}" +start_cmd="osrelease_start" +stop_cmd=":" + +osrelease_start() +{ + local _version _version_id + + check_startmsgs && echo -n "Updating ${osrelease_file} " + _version=$(freebsd-version -u) + _version_id=${_version%%[^0-9.]*} + t=$(mktemp -t os-release) + cat > "$t" <<-__EOF__ + NAME=FreeBSD + VERSION=$_version + VERSION_ID=$_version_id + ID=freebsd + ANSI_COLOR="0;31" + PRETTY_NAME="FreeBSD $_version" + CPE_NAME=cpe:/o:freebsd:freebsd:$_version_id + HOME_URL=https://FreeBSD.org/ + BUG_REPORT_URL=https://bugs.FreeBSD.org/ +__EOF__ + install -C -o root -g wheel -m ${osrelease_perms} "$t" "${osrelease_file}" + rm -f "$t" + check_startmsgs && echo 'done.' +} + +load_rc_config $name +run_rc_command "$1" Modified: stable/12/share/man/man5/Makefile ============================================================================== --- stable/12/share/man/man5/Makefile Fri Jan 31 12:39:51 2020 (r357332) +++ stable/12/share/man/man5/Makefile Fri Jan 31 13:18:25 2020 (r357333) @@ -48,6 +48,7 @@ MAN= acct.5 \ nsmb.conf.5 \ nsswitch.conf.5 \ nullfs.5 \ + os-release.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ Copied: stable/12/share/man/man5/os-release.5 (from r354922, head/share/man/man5/os-release.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man5/os-release.5 Fri Jan 31 13:18:25 2020 (r357333, copy of r354922, head/share/man/man5/os-release.5) @@ -0,0 +1,130 @@ +.\" Copyright (c) 2019 M. Warner Losh. +.\" +.\" 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 November 9, 2019 +.Dt OS-RELEASE 5 +.Os +.Sh NAME +.Nm os-release +.Nd file describing the current OS and some of its attributes +.Sh DESCRIPTION +The +.Nm +file is a new-line separated list of key value pairs. +The syntax of this file is a reduced +.Xr sh 1 +variable assignment with the +following restrictions: +.Bl -bullet +.It +Strings cannot be concatenated together +.It +No variable expansion is done +.It +All shell special characters must be quoted as documented in +.Xr sh 1 +.It +Variable assignments must be included inside of double quotes +if they contain characters outside of A-Z, a-z and 0-9 +.It +All strings should be UTF-8 format +.It +Non-printable characters should not be used in the strings +.El +.Pp +Lines starting with the character +.Ql # +are ignored as comments. +.Sh VARIABLES +The following variables are defined by the standard. +.Bl -tag -width XXXXXXXXXX -compact +.It Dv NAME +A string describing the preferred OS name. +.It Dv VERSION +Version string for the OS, in its usual and customary format. +.It Dv ID +Lower case version of the name with only a-z, 0-9, +.Ql . , +.Ql - , +and +.Ql _ . +.It Dv VERSION_ID +Lower case version of the version with only a-z, 0-9, +.Ql . , +.Ql - , +and +.Ql _ . +.It Dv PRETTY_NAME +A pretty version of the name presented to the user. +May contain release information. +.It Dv ANSI_COLOR +Suggested color presentation for the OS. +This string should be suitable for inclusion within an ESC [ m ANSI/ECMA-48 +escape sequence to render the OS in its preferred color. +This variable is optional. +.It Dv CPE_NAME +A CPE name for the operating system. +This field shall follow the NIST Common Platform Enumeration specification. +.It Dv HOME_URL +.It Dv SUPPORT_URL +.It Dv BUG_REPORT_URL +.It Dv PRIVACY_POLICY_URL +Links on the internet, in RFC 3986 format for different aspects of this OS. +These variables are optional. +.It Dv BUILD_ID +A string identifying the build. +This variable is optional. +.It Dv VARIANT +A string describing the variant of this operating system. +This variable is optional. +.It Dv VARIANT_ID +Lower case version of the variant with only a-z, 0-9, +.Ql . , +.Ql - , +and +.Ql _ . +This variable is optional. +.El +.Pp +All other variables have no standard-defined meaning. +.Sh FILES +.Bl -tag -width XXXXXXXXXX -compact +.It Pa /etc/os-release +Symbolic link to actual +.Pa os-release +file. +.It Pa /var/run/os-release +Generated os-release file describing the currently running system. +.Sh SEE ALSO +.Bl -tag -width XXXXXXXXXX -compact +.It CPE Specification +.Lk https://csrc.nist.gov/projects/security-content-automation-protocol/scap-specifications/cpe +.It RFC 3986 +.Lk https://tools.ietf.org/html/rfc3986 +.It os-release Specification +.Lk https://www.linux.org/docs/man5/os-release.html +.Sh HISTORY +This file first appeared in +.Fx 13.0 . Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Fri Jan 31 12:39:51 2020 (r357332) +++ stable/12/sys/sys/param.h Fri Jan 31 13:18:25 2020 (r357333) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201510 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201511 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Jan 31 14:01:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB72C240DB0; Fri, 31 Jan 2020 14:01:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 488JmF6C5mz4fRY; Fri, 31 Jan 2020 14:01:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 84C81260152; Fri, 31 Jan 2020 15:01:15 +0100 (CET) Subject: Re: svn commit: r357006 - head/sys/net To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230127.00N1RwXH029856@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <117c4608-78a1-caaf-df77-6f01b279ee07@selasky.org> Date: Fri, 31 Jan 2020 15:00:17 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001230127.00N1RwXH029856@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 488JmF6C5mz4fRY X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.42 / 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]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-3.12)[ip: (-9.34), ipnet: 88.99.0.0/16(-4.71), asn: 24940(-1.55), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 14:01:19 -0000 On 2020-01-23 02:27, Gleb Smirnoff wrote: > @@ -6811,6 +6816,7 @@ iflib_debugnet_transmit(if_t ifp, struct mbuf *m) > static int > iflib_debugnet_poll(if_t ifp, int count) > { > + struct epoch_tracker et; > if_ctx_t ctx; > if_softc_ctx_t scctx; > iflib_txq_t txq; > @@ -6826,8 +6832,10 @@ iflib_debugnet_poll(if_t ifp, int count) > txq = &ctx->ifc_txqs[0]; > (void)iflib_completed_tx_reclaim(txq, RECLAIM_THRESH(ctx)); > > + NET_EPOCH_ENTER(et); > for (i = 0; i < scctx->isc_nrxqsets; i++) > (void)iflib_rxeof(&ctx->ifc_rxqs[i], 16 /* XXX */); > + NET_EPOCH_EXIT(et); > return (0); > } > #endif /* DEBUGNET */ Debugnet is not under EPOCH(9) ??? --HPS From owner-svn-src-all@freebsd.org Fri Jan 31 15:43:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EE5E2433B4; Fri, 31 Jan 2020 15:43:37 +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 488M2K44Gqz3HZk; Fri, 31 Jan 2020 15:43:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86BEA1847F; Fri, 31 Jan 2020 15:43:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VFhbMg016815; Fri, 31 Jan 2020 15:43:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VFhXak016797; Fri, 31 Jan 2020 15:43:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001311543.00VFhXak016797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 Jan 2020 15:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357334 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys sys/x8... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 357334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 15:43:37 -0000 Author: markj Date: Fri Jan 31 15:43:33 2020 New Revision: 357334 URL: https://svnweb.freebsd.org/changeset/base/357334 Log: Reimplement stack capture of running threads on i386 and amd64. After r355784 the td_oncpu field is no longer synchronized by the thread lock, so the stack capture interrupt cannot be delievered precisely. Fix this using a loop which drops the thread lock and restarts if the wrong thread was sampled from the stack capture interrupt handler. Change the implementation to use a regular interrupt instead of an NMI. Now that we drop the thread lock, there is no advantage to the latter. Simplify the KPIs. Remove stack_save_td_running() and add a return value to stack_save_td(). On platforms that do not support stack capture of running threads, stack_save_td() returns EOPNOTSUPP. If the target thread is running in user mode, stack_save_td() returns EBUSY. Reviewed by: kib Reported by: mjg, pho Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23355 Modified: head/share/man/man9/stack.9 head/sys/amd64/amd64/trap.c head/sys/arm/arm/stack_machdep.c head/sys/arm64/arm64/stack_machdep.c head/sys/i386/i386/trap.c head/sys/kern/kern_proc.c head/sys/kern/subr_kdb.c head/sys/kern/subr_sleepqueue.c head/sys/kern/tty_info.c head/sys/mips/mips/stack_machdep.c head/sys/powerpc/powerpc/stack_machdep.c head/sys/riscv/riscv/stack_machdep.c head/sys/sparc64/sparc64/stack_machdep.c head/sys/sys/stack.h head/sys/x86/include/apicvar.h head/sys/x86/include/stack.h head/sys/x86/x86/mp_x86.c head/sys/x86/x86/stack_machdep.c Modified: head/share/man/man9/stack.9 ============================================================================== --- head/share/man/man9/stack.9 Fri Jan 31 13:18:25 2020 (r357333) +++ head/share/man/man9/stack.9 Fri Jan 31 15:43:33 2020 (r357334) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2017 +.Dd January 31, 2020 .Dt STACK 9 .Os .Sh NAME @@ -65,10 +65,8 @@ In the kernel configuration file: .Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st" .Ft void .Fn stack_save "struct stack *st" -.Ft void -.Fn stack_save_td "struct stack *st" "struct thread *td" .Ft int -.Fn stack_save_td_running "struct stack *st" "struct thread *td" +.Fn stack_save_td "struct stack *st" "struct thread *td" .Sh DESCRIPTION The .Nm @@ -93,18 +91,17 @@ argument is passed to Memory associated with a trace is freed by calling .Fn stack_destroy . .Pp -A trace of the current kernel thread's call stack may be captured using +A trace of the current thread's kernel call stack may be captured using .Fn stack_save . .Fn stack_save_td -and -.Fn stack_save_td_running -can also be used to capture the stack of a caller-specified thread. -Callers of these functions must own the thread lock of the specified thread. +can be used to capture the kernel stack of a caller-specified thread. +Callers of these functions must own the thread lock of the specified thread, +and the thread's stack must not be swapped out. .Fn stack_save_td -can capture the stack of a kernel thread that is not running or -swapped out at the time of the call. -.Fn stack_save_td_running -can capture the stack of a running kernel thread. +can capture the kernel stack of a running thread, though note that this is +not implemented on all platforms. +If the thread is running, the caller must also hold the process lock for the +target thread. .Pp .Fn stack_print and @@ -157,11 +154,11 @@ Otherwise the does not contain space to record additional frames, and a non-zero value is returned. .Pp -.Fn stack_save_td_running +.Fn stack_save_td returns 0 when the stack capture was successful and a non-zero error number otherwise. In particular, -.Er EAGAIN +.Er EBUSY is returned if the thread was running in user mode at the time that the capture was attempted, and .Er EOPNOTSUPP Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/amd64/amd64/trap.c Fri Jan 31 15:43:33 2020 (r357334) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_isa.h" #include "opt_kdb.h" -#include "opt_stack.h" #include #include @@ -226,11 +225,6 @@ trap(struct trapframe *frame) */ if (pmc_intr != NULL && (*pmc_intr)(frame) != 0) - return; -#endif - -#ifdef STACK - if (stack_nmi_handler(frame) != 0) return; #endif } Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/arm/arm/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -30,8 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include + #include #include @@ -63,29 +66,23 @@ stack_save(struct stack *st) stack_capture(st, &state); } -void +int stack_save_td(struct stack *st, struct thread *td) { struct unwind_state state; - KASSERT(!TD_IS_SWAPPED(td), ("stack_save_td: swapped")); - KASSERT(!TD_IS_RUNNING(td), ("stack_save_td: running")); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) + return (EOPNOTSUPP); + state.registers[FP] = td->td_pcb->pcb_regs.sf_r11; state.registers[SP] = td->td_pcb->pcb_regs.sf_sp; state.registers[LR] = td->td_pcb->pcb_regs.sf_lr; state.registers[PC] = td->td_pcb->pcb_regs.sf_pc; stack_capture(st, &state); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - if (td == curthread) { - stack_save(st); - return (0); - } - return (EOPNOTSUPP); + return (0); } Modified: head/sys/arm64/arm64/stack_machdep.c ============================================================================== --- head/sys/arm64/arm64/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/arm64/arm64/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -55,28 +57,24 @@ stack_capture(struct stack *st, struct unwind_state *f } } -void +int stack_save_td(struct stack *st, struct thread *td) { struct unwind_state frame; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + return (EOPNOTSUPP); frame.sp = td->td_pcb->pcb_sp; frame.fp = td->td_pcb->pcb_x[29]; frame.pc = td->td_pcb->pcb_x[30]; stack_capture(st, &frame); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/i386/i386/trap.c Fri Jan 31 15:43:33 2020 (r357334) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" #include "opt_isa.h" #include "opt_kdb.h" -#include "opt_stack.h" #include "opt_trap.h" #include @@ -246,11 +245,6 @@ trap(struct trapframe *frame) */ if (pmc_intr != NULL && (*pmc_intr)(frame) != 0) - return; -#endif - -#ifdef STACK - if (stack_nmi_handler(frame) != 0) return; #endif } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/kern/kern_proc.c Fri Jan 31 15:43:33 2020 (r357334) @@ -2669,17 +2669,12 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) sizeof(kkstp->kkst_trace), SBUF_FIXEDLEN); thread_lock(td); kkstp->kkst_tid = td->td_tid; - if (TD_IS_SWAPPED(td)) { + if (TD_IS_SWAPPED(td)) kkstp->kkst_state = KKST_STATE_SWAPPED; - } else if (TD_IS_RUNNING(td)) { - if (stack_save_td_running(st, td) == 0) - kkstp->kkst_state = KKST_STATE_STACKOK; - else - kkstp->kkst_state = KKST_STATE_RUNNING; - } else { + else if (stack_save_td(st, td) == 0) kkstp->kkst_state = KKST_STATE_STACKOK; - stack_save_td(st, td); - } + else + kkstp->kkst_state = KKST_STATE_RUNNING; thread_unlock(td); PROC_UNLOCK(p); stack_sbuf_print(&sb, st); Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/kern/subr_kdb.c Fri Jan 31 15:43:33 2020 (r357334) @@ -432,9 +432,8 @@ kdb_backtrace_thread(struct thread *td) struct stack st; printf("KDB: stack backtrace of thread %d:\n", td->td_tid); - stack_zero(&st); - stack_save_td(&st, td); - stack_print_ddb(&st); + if (stack_save_td(&st, td) == 0) + stack_print_ddb(&st); } #endif } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/kern/subr_sleepqueue.c Fri Jan 31 15:43:33 2020 (r357334) @@ -1245,7 +1245,7 @@ sleepq_sbuf_print_stacks(struct sbuf *sb, const void * goto loop_end; /* Note the td_lock is equal to the sleepq_lock here. */ - stack_save_td(st[stack_idx], td); + (void)stack_save_td(st[stack_idx], td); sbuf_printf(td_infos[stack_idx], "%d: %s %p", td->td_tid, td->td_name, td); Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/kern/tty_info.c Fri Jan 31 15:43:33 2020 (r357334) @@ -340,12 +340,8 @@ tty_info(struct tty *tp) if (tty_info_kstacks) { if (TD_IS_SWAPPED(td)) sterr = ENOENT; - else if (TD_IS_RUNNING(td)) - sterr = stack_save_td_running(&stack, td); - else { - stack_save_td(&stack, td); - sterr = 0; - } + else + sterr = stack_save_td(&stack, td); } #endif thread_unlock(td); Modified: head/sys/mips/mips/stack_machdep.c ============================================================================== --- head/sys/mips/mips/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/mips/mips/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -29,9 +29,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include +#include +#include +#include #include #include @@ -127,26 +128,22 @@ done: return; } -void +int stack_save_td(struct stack *st, struct thread *td) { u_register_t pc, sp; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + return (EOPNOTSUPP); pc = td->td_pcb->pcb_regs.pc; sp = td->td_pcb->pcb_regs.sp; stack_capture(st, pc, sp); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/powerpc/powerpc/stack_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/powerpc/powerpc/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -86,25 +88,21 @@ stack_capture(struct stack *st, vm_offset_t frame) } } -void +int stack_save_td(struct stack *st, struct thread *td) { vm_offset_t frame; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + return (EOPNOTSUPP); frame = td->td_pcb->pcb_sp; stack_capture(st, frame); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/riscv/riscv/stack_machdep.c ============================================================================== --- head/sys/riscv/riscv/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/riscv/riscv/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -60,28 +62,24 @@ stack_capture(struct stack *st, struct unwind_state *f } } -void +int stack_save_td(struct stack *st, struct thread *td) { struct unwind_state frame; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + return (EOPNOTSUPP); frame.sp = td->td_pcb->pcb_sp; frame.fp = td->td_pcb->pcb_s[0]; frame.pc = td->td_pcb->pcb_ra; stack_capture(st, &frame); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/sparc64/sparc64/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include +#include +#include #include #include #include @@ -72,23 +74,19 @@ stack_capture(struct stack *st, struct frame *frame) } } -void +int stack_save_td(struct stack *st, struct thread *td) { - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); + THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); + return (EOPNOTSUPP); stack_capture(st, (struct frame *)(td->td_pcb->pcb_sp + SPOFF)); -} - -int -stack_save_td_running(struct stack *st, struct thread *td) -{ - - return (EOPNOTSUPP); + return (0); } void Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/sys/stack.h Fri Jan 31 15:43:33 2020 (r357334) @@ -67,7 +67,6 @@ void stack_ktr(u_int, const char *, int, const struc /* MD Routines. */ struct thread; void stack_save(struct stack *); -void stack_save_td(struct stack *, struct thread *); -int stack_save_td_running(struct stack *, struct thread *); +int stack_save_td(struct stack *, struct thread *); #endif Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/x86/include/apicvar.h Fri Jan 31 15:43:33 2020 (r357334) @@ -123,20 +123,20 @@ #define IPI_AST 0 /* Generate software trap. */ #define IPI_PREEMPT 1 #define IPI_HARDCLOCK 2 -#define IPI_BITMAP_LAST IPI_HARDCLOCK +#define IPI_TRACE 3 /* Collect stack trace. */ +#define IPI_BITMAP_LAST IPI_TRACE #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 6) /* Stop CPU until restarted. */ #define IPI_SUSPEND (APIC_IPI_INTS + 7) /* Suspend CPU until restarted. */ #define IPI_DYN_FIRST (APIC_IPI_INTS + 8) -#define IPI_DYN_LAST (253) /* IPIs allocated at runtime */ +#define IPI_DYN_LAST (254) /* IPIs allocated at runtime */ /* * IPI_STOP_HARD does not need to occupy a slot in the IPI vector space since * it is delivered using an NMI anyways. */ -#define IPI_NMI_FIRST 254 -#define IPI_TRACE 254 /* Interrupt for tracing. */ +#define IPI_NMI_FIRST 255 #define IPI_STOP_HARD 255 /* Stop CPU with a NMI. */ /* Modified: head/sys/x86/include/stack.h ============================================================================== --- head/sys/x86/include/stack.h Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/x86/include/stack.h Fri Jan 31 15:43:33 2020 (r357334) @@ -55,7 +55,7 @@ struct i386_frame { #endif /* __amd64__ */ #ifdef _KERNEL -int stack_nmi_handler(struct trapframe *); +void stack_capture_intr(void); #endif #endif /* !_X86_STACK_H */ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/x86/x86/mp_x86.c Fri Jan 31 15:43:33 2020 (r357334) @@ -31,10 +31,12 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include "opt_cpu.h" +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_sched.h" #include "opt_smp.h" +#include "opt_stack.h" #include #include @@ -75,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static MALLOC_DEFINE(M_CPUS, "cpus", "CPU items"); @@ -1284,6 +1287,10 @@ ipi_bitmap_handler(struct trapframe frame) td->td_intr_nesting_level++; oldframe = td->td_intr_frame; td->td_intr_frame = &frame; +#if defined(STACK) || defined(DDB) + if (ipi_bitmap & (1 << IPI_TRACE)) + stack_capture_intr(); +#endif if (ipi_bitmap & (1 << IPI_PREEMPT)) { #ifdef COUNT_IPIS (*ipi_preempt_counts[cpu])++; Modified: head/sys/x86/x86/stack_machdep.c ============================================================================== --- head/sys/x86/x86/stack_machdep.c Fri Jan 31 13:18:25 2020 (r357333) +++ head/sys/x86/x86/stack_machdep.c Fri Jan 31 15:43:33 2020 (r357334) @@ -63,15 +63,12 @@ typedef struct i386_frame *x86_frame_t; typedef struct amd64_frame *x86_frame_t; #endif -#ifdef STACK -static struct stack *nmi_stack; -static volatile struct thread *nmi_pending; - #ifdef SMP -static struct mtx nmi_lock; -MTX_SYSINIT(nmi_lock, &nmi_lock, "stack_nmi", MTX_SPIN); +static struct stack *stack_intr_stack; +static struct thread *stack_intr_td; +static struct mtx intr_lock; +MTX_SYSINIT(intr_lock, &intr_lock, "stack intr", MTX_DEF); #endif -#endif static void stack_capture(struct thread *td, struct stack *st, register_t fp) @@ -97,74 +94,74 @@ stack_capture(struct thread *td, struct stack *st, reg } } -int -stack_nmi_handler(struct trapframe *tf) -{ - -#ifdef STACK - /* Don't consume an NMI that wasn't meant for us. */ - if (nmi_stack == NULL || curthread != nmi_pending) - return (0); - - if (!TRAPF_USERMODE(tf) && (TF_FLAGS(tf) & PSL_I) != 0) - stack_capture(curthread, nmi_stack, TF_FP(tf)); - else - /* We were running in usermode or had interrupts disabled. */ - nmi_stack->depth = 0; - - atomic_store_rel_ptr((long *)&nmi_pending, (long)NULL); - return (1); -#else - return (0); -#endif -} - +#ifdef SMP void -stack_save_td(struct stack *st, struct thread *td) +stack_capture_intr(void) { + struct thread *td; - if (TD_IS_SWAPPED(td)) - panic("stack_save_td: swapped"); - if (TD_IS_RUNNING(td)) - panic("stack_save_td: running"); - - stack_capture(td, st, PCB_FP(td->td_pcb)); + td = curthread; + stack_capture(td, stack_intr_stack, TF_FP(td->td_intr_frame)); + atomic_store_rel_ptr((void *)&stack_intr_td, (uintptr_t)td); } +#endif int -stack_save_td_running(struct stack *st, struct thread *td) +stack_save_td(struct stack *st, struct thread *td) { + int cpuid, error; + bool done; -#ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); - MPASS(TD_IS_RUNNING(td)); + KASSERT(!TD_IS_SWAPPED(td), + ("stack_save_td: thread %p is swapped", td)); + if (TD_IS_RUNNING(td) && td != curthread) + PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); if (td == curthread) { stack_save(st); return (0); } + for (done = false, error = 0; !done;) { + if (!TD_IS_RUNNING(td)) { + /* + * The thread will not start running so long as we hold + * its lock. + */ + stack_capture(td, st, PCB_FP(td->td_pcb)); + error = 0; + break; + } + #ifdef SMP - mtx_lock_spin(&nmi_lock); + thread_unlock(td); + cpuid = atomic_load_int(&td->td_oncpu); + if (cpuid == NOCPU) { + cpu_spinwait(); + } else { + mtx_lock(&intr_lock); + stack_intr_td = NULL; + stack_intr_stack = st; + ipi_cpu(cpuid, IPI_TRACE); + while (atomic_load_acq_ptr((void *)&stack_intr_td) == + (uintptr_t)NULL) + cpu_spinwait(); + if (stack_intr_td == td) { + done = true; + error = st->depth > 0 ? 0 : EBUSY; + } + stack_intr_td = NULL; + mtx_unlock(&intr_lock); + } + thread_lock(td); +#else + (void)cpuid; + KASSERT(0, ("%s: multiple running threads", __func__)); +#endif + } - nmi_stack = st; - nmi_pending = td; - ipi_cpu(td->td_oncpu, IPI_TRACE); - while ((void *)atomic_load_acq_ptr((long *)&nmi_pending) != NULL) - cpu_spinwait(); - nmi_stack = NULL; - - mtx_unlock_spin(&nmi_lock); - - if (st->depth == 0) - return (EAGAIN); -#else /* !SMP */ - KASSERT(0, ("curthread isn't running")); -#endif /* SMP */ - return (0); -#else /* !STACK */ - return (EOPNOTSUPP); -#endif /* STACK */ + return (error); } void From owner-svn-src-all@freebsd.org Fri Jan 31 15:56:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7992438AC; Fri, 31 Jan 2020 15:56:09 +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 488MJn3CTkz3JPD; Fri, 31 Jan 2020 15:56:09 +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 6948418675; Fri, 31 Jan 2020 15:56:09 +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 00VFu94W023438; Fri, 31 Jan 2020 15:56:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VFu9D4023437; Fri, 31 Jan 2020 15:56:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001311556.00VFu9D4023437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 31 Jan 2020 15:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357335 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 357335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 15:56:09 -0000 Author: kevans Date: Fri Jan 31 15:56:08 2020 New Revision: 357335 URL: https://svnweb.freebsd.org/changeset/base/357335 Log: RPI3: Add RPi4 firmware files to the FAT partition I've discovered I have this local diff that never got committed -- this should have been a part of r355424. Reproted by: Klaus Küchemann Modified: head/release/arm64/RPI3.conf Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Fri Jan 31 15:43:33 2020 (r357334) +++ head/release/arm64/RPI3.conf Fri Jan 31 15:56:08 2020 (r357335) @@ -25,7 +25,9 @@ arm_install_uboot() { UBOOT_FILES="README u-boot.bin" DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \ fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ - start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" + start_cd.elf start_db.elf start_x.elf start.elf \ + fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \ + start4cd.elf start4db.elf start4x.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} From owner-svn-src-all@freebsd.org Fri Jan 31 17:40:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B944024638C; Fri, 31 Jan 2020 17:40:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488PdQ4Vgvz3x4H; Fri, 31 Jan 2020 17:40:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C67199C9; Fri, 31 Jan 2020 17:40:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VHegpN085317; Fri, 31 Jan 2020 17:40:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VHegIT085315; Fri, 31 Jan 2020 17:40:42 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001311740.00VHegIT085315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 31 Jan 2020 17:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357336 - in head: share/man/man4 sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/x86/cpufreq X-SVN-Commit-Revision: 357336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 17:40:42 -0000 Author: cem Date: Fri Jan 31 17:40:41 2020 New Revision: 357336 URL: https://svnweb.freebsd.org/changeset/base/357336 Log: hwpstate(4): Ignore CurPstateLimit by default Add a sysctl knob to allow users to re-enable it, and document the knob and default in cpufreq.4. (While here, add a few unrelated updates to cpufreq.4.) It seems that the register value in some hardware simply reflects the configured P-state. This results in an inadvertent and unintended outcome where the P-state can only walk down, and then the driver becomes "stuck" in the slowest possible P-state. The Linux driver never consults this register, so that's some evidence that ignoring the contents are relatively harmless. PR: 234733 Reported by: sigsys AT gmail.com, Erich Dollanksy Modified: head/share/man/man4/cpufreq.4 head/sys/x86/cpufreq/hwpstate_amd.c Modified: head/share/man/man4/cpufreq.4 ============================================================================== --- head/share/man/man4/cpufreq.4 Fri Jan 31 15:56:08 2020 (r357335) +++ head/share/man/man4/cpufreq.4 Fri Jan 31 17:40:41 2020 (r357336) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2020 +.Dd January 31, 2020 .Dt CPUFREQ 4 .Os .Sh NAME @@ -73,9 +73,13 @@ has passed (e.g., the system has cooled sufficiently). If a sysctl cannot be set due to an override condition, it will return .Er EPERM . .Pp -The frequency cannot be changed if TSC is in use as the timecounter. +The frequency cannot be changed if TSC is in use as the timecounter and the +hardware does not support invariant TSC. This is because the timecounter system needs to use a source that has a constant rate. +(On invariant TSC hardware, the TSC runs at the P0 rate regardless of the +configured P-state.) +Modern hardware mostly has invariant TSC. The timecounter source can be changed with the .Pa kern.timecounter.hardware sysctl. @@ -105,6 +109,15 @@ some systems. .It Va debug.cpufreq.verbose Print verbose messages. This setting is also accessible via a tunable with the same name. +.It Va debug.hwpstate_pstate_limit +If enabled, the AMD hwpstate driver limits administrative control of P-states +(including by +.Xr powerd 8 ) +to the value in the 0xc0010061 MSR, known as "PStateCurLim[CurPstateLimit]." +It is disabled (0) by default. +On some hardware, the limit register seems to simply follow the configured +P-state, which results in the inability to ever raise the P-state back to P0 +from a reduced frequency state. .El .Sh SUPPORTED DRIVERS The following device drivers offer absolute frequency control via the @@ -112,11 +125,15 @@ The following device drivers offer absolute frequency interface. Usually, only one of these can be active at a time. .Pp -.Bl -tag -compact -width ".Pa acpi_perf" +.Bl -tag -compact -width ".Pa hwpstate_intel" .It Pa acpi_perf ACPI CPU performance states .It Pa est Intel Enhanced SpeedStep +.It Pa hwpstate +AMD Cool'n'Quiet2 used in K10 through Family 17h +.It Pa hwpstate_intel +Intel SpeedShift driver .It Pa ichss Intel SpeedStep for ICH .It Pa powernow Modified: head/sys/x86/cpufreq/hwpstate_amd.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_amd.c Fri Jan 31 15:56:08 2020 (r357335) +++ head/sys/x86/cpufreq/hwpstate_amd.c Fri Jan 31 17:40:41 2020 (r357336) @@ -131,6 +131,12 @@ static int hwpstate_verify; SYSCTL_INT(_debug, OID_AUTO, hwpstate_verify, CTLFLAG_RWTUN, &hwpstate_verify, 0, "Verify P-state after setting"); +static bool hwpstate_pstate_limit; +SYSCTL_BOOL(_debug, OID_AUTO, hwpstate_pstate_limit, CTLFLAG_RWTUN, + &hwpstate_pstate_limit, 0, + "If enabled (1), limit administrative control of P-states to the value in " + "CurPstateLimit"); + static device_method_t hwpstate_methods[] = { /* Device interface */ DEVMETHOD(device_identify, hwpstate_identify), @@ -161,7 +167,8 @@ static driver_t hwpstate_driver = { DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate_devclass, 0, 0); /* - * Go to Px-state on all cpus considering the limit. + * Go to Px-state on all cpus, considering the limit register (if so + * configured). */ static int hwpstate_goto_pstate(device_t dev, int id) @@ -170,14 +177,15 @@ hwpstate_goto_pstate(device_t dev, int id) uint64_t msr; int cpu, i, j, limit; - /* get the current pstate limit */ - msr = rdmsr(MSR_AMD_10H_11H_LIMIT); - limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); - if (limit > id) { - HWPSTATE_DEBUG(dev, - "Restricting requested P%d to P%d due to HW limit\n", id, - limit); - id = limit; + if (hwpstate_pstate_limit) { + /* get the current pstate limit */ + msr = rdmsr(MSR_AMD_10H_11H_LIMIT); + limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); + if (limit > id) { + HWPSTATE_DEBUG(dev, "Restricting requested P%d to P%d " + "due to HW limit\n", id, limit); + id = limit; + } } cpu = curcpu; From owner-svn-src-all@freebsd.org Fri Jan 31 17:49:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3C82246845; Fri, 31 Jan 2020 17:49:15 +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 488PqH5n8fz3y2D; Fri, 31 Jan 2020 17:49:15 +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 C161D19B90; Fri, 31 Jan 2020 17:49:15 +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 00VHnFlL090546; Fri, 31 Jan 2020 17:49:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VHnFb7090545; Fri, 31 Jan 2020 17:49:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001311749.00VHnFb7090545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 31 Jan 2020 17:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357337 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 357337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 17:49:16 -0000 Author: jhb Date: Fri Jan 31 17:49:15 2020 New Revision: 357337 URL: https://svnweb.freebsd.org/changeset/base/357337 Log: Fix 64-bit value of SSTATUS_SD to use an unsigned long. While here, fix MSTATUS_SD to match SSTATUS_SD. Reviewed by: mhorne MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23434 Modified: head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Fri Jan 31 17:40:41 2020 (r357336) +++ head/sys/riscv/include/riscvreg.h Fri Jan 31 17:49:15 2020 (r357337) @@ -73,7 +73,7 @@ #define SSTATUS_XS_MASK (0x3 << SSTATUS_XS_SHIFT) #define SSTATUS_SUM (1 << 18) #if __riscv_xlen == 64 -#define SSTATUS_SD (1 << 63) +#define SSTATUS_SD (1ul << 63) #else #define SSTATUS_SD (1 << 31) #endif @@ -110,8 +110,11 @@ #define MSTATUS_VM_SV48 10 #define MSTATUS_VM_SV57 11 #define MSTATUS_VM_SV64 12 -#define MSTATUS32_SD (1 << 63) -#define MSTATUS64_SD (1 << 31) +#if __riscv_xlen == 64 +#define MSTATUS_SD (1ul << 63) +#else +#define MSTATUS_SD (1 << 31) +#endif #define MSTATUS_PRV_U 0 /* user */ #define MSTATUS_PRV_S 1 /* supervisor */ From owner-svn-src-all@freebsd.org Fri Jan 31 18:04:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F12F2247B08; Fri, 31 Jan 2020 18:04: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 488Q8Q6BW8z41sC; Fri, 31 Jan 2020 18:04: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 CFC3F19F5D; Fri, 31 Jan 2020 18:04: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 00VI46sl002786; Fri, 31 Jan 2020 18:04:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VI44RB002774; Fri, 31 Jan 2020 18:04:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001311804.00VI44RB002774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 31 Jan 2020 18:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357338 - in head: . contrib/bmake/mk gnu/lib lib/csu share/mk targets/pseudo/userland/gnu tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . contrib/bmake/mk gnu/lib lib/csu share/mk targets/pseudo/userland/gnu tools/build/options X-SVN-Commit-Revision: 357338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:04:07 -0000 Author: emaste Date: Fri Jan 31 18:04:04 2020 New Revision: 357338 URL: https://svnweb.freebsd.org/changeset/base/357338 Log: retire BSD_CRTBEGIN option BSD crt is currently used on all architectures (other than sparc64). Remove the option and use BSD crt everywhere as part of the GCC 4.2.1 retirement plan. https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html PR: 239851 Reviewed by: andrew, brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23122 Deleted: head/tools/build/options/WITHOUT_BSD_CRTBEGIN head/tools/build/options/WITH_BSD_CRTBEGIN Modified: head/Makefile.inc1 head/contrib/bmake/mk/meta2deps.sh head/gnu/lib/Makefile head/lib/csu/Makefile.inc head/share/mk/local.dirdeps-options.mk head/share/mk/local.dirdeps.mk head/share/mk/local.gendirdeps.mk head/share/mk/meta2deps.sh head/share/mk/src.opts.mk head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 31 17:49:15 2020 (r357337) +++ head/Makefile.inc1 Fri Jan 31 18:04:04 2020 (r357338) @@ -2783,13 +2783,10 @@ _prereq_libs+= lib/libssp_nonshared # These dependencies are not automatically generated: # -# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before +# gnu/lib/libgcc, lib/csu and lib/libc must be built before # all shared libraries for ELF. # _startup_libs= lib/csu -.if ${MK_BSD_CRTBEGIN} == "no" -_startup_libs+= gnu/lib/csu -.endif _startup_libs+= lib/libc _startup_libs+= lib/libc_nonshared .if ${MK_LIBCPLUSPLUS} != "no" Modified: head/contrib/bmake/mk/meta2deps.sh ============================================================================== --- head/contrib/bmake/mk/meta2deps.sh Fri Jan 31 17:49:15 2020 (r357337) +++ head/contrib/bmake/mk/meta2deps.sh Fri Jan 31 18:04:04 2020 (r357338) @@ -49,7 +49,6 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/bsd/gnu/lib/csu # $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386 Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Fri Jan 31 17:49:15 2020 (r357337) +++ head/gnu/lib/Makefile Fri Jan 31 18:04:04 2020 (r357338) @@ -10,10 +10,6 @@ SUBDIR+= libgomp .endif SUBDIR.${MK_TESTS}+= tests -.if ${MK_BSD_CRTBEGIN} == "no" -SUBDIR+= csu -.endif - .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" SUBDIR+= libregex Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Fri Jan 31 17:49:15 2020 (r357337) +++ head/lib/csu/Makefile.inc Fri Jan 31 18:04:04 2020 (r357338) @@ -8,7 +8,7 @@ NO_WMISSING_VARIABLE_DECLARATIONS= .include -.if ${MK_BSD_CRTBEGIN} != "no" && !defined(BUILDING_TESTS) +.if !defined(BUILDING_TESTS) OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o Modified: head/share/mk/local.dirdeps-options.mk ============================================================================== --- head/share/mk/local.dirdeps-options.mk Fri Jan 31 17:49:15 2020 (r357337) +++ head/share/mk/local.dirdeps-options.mk Fri Jan 31 18:04:04 2020 (r357338) @@ -3,7 +3,6 @@ # avoid duplication DIRDEPS.AUDIT.yes= lib/libbsm DIRDEPS.BLACKLIST_SUPPORT.yes+= lib/libblacklist -DIRDEPS.BSD_CRTBEGIN.no+= gnu/lib/csu DIRDEPS.CASPER.yes+= lib/libcasper/libcasper DIRDEPS.GSSAPI.yes+= lib/libgssapi DIRDEPS.JAIL.yes+= lib/libjail Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Fri Jan 31 17:49:15 2020 (r357337) +++ head/share/mk/local.dirdeps.mk Fri Jan 31 18:04:04 2020 (r357338) @@ -38,7 +38,6 @@ DIRDEPS_FILTER.host = \ Nlib/csu* \ Nlib/libc \ Nlib/[mn]* \ - Ngnu/lib/csu* \ Ngnu/lib/lib[a-r]* \ Nsecure/lib* \ Nusr.bin/xinstall* \ @@ -219,11 +218,6 @@ DIRDEPS+= ${_lib${_lib}reldir} .if ${DEP_RELDIR} != "targets/pseudo/stage" DIRDEPS += targets/pseudo/stage .endif -.endif - -# this one is too pervasive -.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR:N.:Ngnu/lib/csu:Ninclude*:Ntargets/*} != "" -DIRDEPS+= gnu/lib/csu .endif DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}} Modified: head/share/mk/local.gendirdeps.mk ============================================================================== --- head/share/mk/local.gendirdeps.mk Fri Jan 31 17:49:15 2020 (r357337) +++ head/share/mk/local.gendirdeps.mk Fri Jan 31 18:04:04 2020 (r357338) @@ -10,7 +10,6 @@ GENDIRDEPS_FILTER+= \ Nlib/libssp_nonshared \ Ncddl/usr.bin/ctf* \ Nlib/libc_nonshared \ - Ngnu/lib/csu \ Ngnu/lib/libgcc \ Nlib/libgcc_eh \ Nlib/libgcc_s \ Modified: head/share/mk/meta2deps.sh ============================================================================== --- head/share/mk/meta2deps.sh Fri Jan 31 17:49:15 2020 (r357337) +++ head/share/mk/meta2deps.sh Fri Jan 31 18:04:04 2020 (r357338) @@ -49,7 +49,6 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/bsd/gnu/lib/csu # $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386 Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jan 31 17:49:15 2020 (r357337) +++ head/share/mk/src.opts.mk Fri Jan 31 18:04:04 2020 (r357338) @@ -69,7 +69,6 @@ __DEFAULT_YES_OPTIONS = \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ - BSD_CRTBEGIN \ BSDINSTALL \ BSNMP \ BZIP2 \ @@ -394,8 +393,6 @@ BROKEN_OPTIONS+=NVME .endif .if ${__T:Msparc64} -# Sparc64 need extra crt*.o files - PR 239851 -BROKEN_OPTIONS+=BSD_CRTBEGIN # PR 233405 BROKEN_OPTIONS+=LLVM_LIBUNWIND .endif Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Jan 31 17:49:15 2020 (r357337) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Jan 31 18:04:04 2020 (r357338) @@ -7,7 +7,6 @@ # This file is not autogenerated - take care! DIRDEPS = \ - gnu/lib/csu \ gnu/lib/libdialog \ gnu/lib/libgcov \ gnu/lib/libgomp \ From owner-svn-src-all@freebsd.org Fri Jan 31 18:13:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E1181E83C1; Fri, 31 Jan 2020 18:13:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488QLj0vPBz4320; Fri, 31 Jan 2020 18:13:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A2181A132; Fri, 31 Jan 2020 18:13:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VID0uN008953; Fri, 31 Jan 2020 18:13:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VID0OB008952; Fri, 31 Jan 2020 18:13:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311813.00VID0OB008952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 18:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357340 - head/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 357340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:13:01 -0000 Author: dim Date: Fri Jan 31 18:13:00 2020 New Revision: 357340 URL: https://svnweb.freebsd.org/changeset/base/357340 Log: Merge r357339 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. MFC after: 3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: head/ (props changed) Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jan 31 18:09:27 2020 (r357339) +++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jan 31 18:13:00 2020 (r357340) @@ -1655,10 +1655,11 @@ altq_is_enabled(int pfdev) syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); - } else + } else { syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); + } } return (1); } From owner-svn-src-all@freebsd.org Fri Jan 31 18:26:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B05A51E8AB2; Fri, 31 Jan 2020 18:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488Qdx4KMqz43lv; Fri, 31 Jan 2020 18:26:13 +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 8E76F1A30A; Fri, 31 Jan 2020 18:26:13 +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 00VIQDag014916; Fri, 31 Jan 2020 18:26:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VIQD2O014915; Fri, 31 Jan 2020 18:26:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001311826.00VIQD2O014915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 31 Jan 2020 18:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357341 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 357341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:26:13 -0000 Author: emaste Date: Fri Jan 31 18:26:13 2020 New Revision: 357341 URL: https://svnweb.freebsd.org/changeset/base/357341 Log: regen src.conf.5 after r357338 BSD_CRTBEGIN retirement Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jan 31 18:13:00 2020 (r357340) +++ head/share/man/man5/src.conf.5 Fri Jan 31 18:26:13 2020 (r357341) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 19, 2020 +.Dd January 31, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -250,22 +250,6 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . -.It Va WITHOUT_BSD_CRTBEGIN -Disable the BSD licensed -.Pa crtbegin.o -and -.Pa crtend.o . -.Pp -This is a default setting on -sparc64/sparc64. -.It Va WITH_BSD_CRTBEGIN -Enable the BSD licensed -.Pa crtbegin.o -and -.Pa crtend.o . -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP From owner-svn-src-all@freebsd.org Fri Jan 31 18:55:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4346B1E961D; Fri, 31 Jan 2020 18:55:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488RHZ17jrz45Dg; Fri, 31 Jan 2020 18:55:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20AE51A8AB; Fri, 31 Jan 2020 18:55:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VItMdl032822; Fri, 31 Jan 2020 18:55:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VItMZ9032821; Fri, 31 Jan 2020 18:55:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202001311855.00VItMZ9032821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 31 Jan 2020 18:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357343 - head/usr.sbin/services_mkdb X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.sbin/services_mkdb X-SVN-Commit-Revision: 357343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:55:22 -0000 Author: pfg Date: Fri Jan 31 18:55:21 2020 New Revision: 357343 URL: https://svnweb.freebsd.org/changeset/base/357343 Log: services: Add PROFInet and EtherCAT. Both are used in industrial networks. MFC after: 1 week Modified: head/usr.sbin/services_mkdb/services Modified: head/usr.sbin/services_mkdb/services ============================================================================== --- head/usr.sbin/services_mkdb/services Fri Jan 31 18:26:23 2020 (r357342) +++ head/usr.sbin/services_mkdb/services Fri Jan 31 18:55:21 2020 (r357343) @@ -2494,6 +2494,14 @@ wnn6_DS 26208/tcp #Wnn6 (Dserver) sgsap 29118/sctp #SGsAP in 3GPP sbcap 29168/sctp #SBcAP in 3GPP iuhsctpassoc 29169/sctp #HNBAP and RUA Common Association +profinet-rt 34962/tcp #PROFInet RT Unicast +profinet-rt 34962/udp #PROFInet RT Unicast +profinet-rtm 34963/tcp #PROFInet RT Multicast +profinet-rtm 34963/udp #PROFInet RT Multicast +profinet-cm 34964/tcp #PROFInet Context Manager +profinet-cm 34964/udp #PROFInet Context Manager +ethercat 34980/tcp #EtherCAT Port +ethercat 34980/udp #EhterCAT Port s1-control 36412/sctp #S1-Control Plane (3GPP) x2-control 36422/sctp #X2-Control Plane (3GPP) dbbrowse 47557/tcp #Databeam Corporation From owner-svn-src-all@freebsd.org Fri Jan 31 19:00:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D331B1E973E; Fri, 31 Jan 2020 19:00:48 +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 488RPr4zsCz45Pb; Fri, 31 Jan 2020 19:00:48 +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 A655C1A8D2; Fri, 31 Jan 2020 19:00:48 +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 00VJ0mFJ033166; Fri, 31 Jan 2020 19:00:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJ0mZ5033165; Fri, 31 Jan 2020 19:00:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001311900.00VJ0mZ5033165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 31 Jan 2020 19:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357344 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 357344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:00:48 -0000 Author: jhb Date: Fri Jan 31 19:00:48 2020 New Revision: 357344 URL: https://svnweb.freebsd.org/changeset/base/357344 Log: Add stricter checks on user changes to SSTATUS. Rather than trying to blacklist which bits userland can't write to via sigreturn() or setcontext(), only permit changes to whitelisted bits. - Permit arbitrary writes to bits in the user-writable USTATUS register that shadows SSTATUS. - Ignore changes in write-only bits maintained by the CPU. - Ignore the user-supplied value of the FS field used to track floating point state and instead set it to a value matching the actions taken by set_fpcontext(). Discussed with: mhorne MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23338 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Fri Jan 31 18:55:21 2020 (r357343) +++ head/sys/riscv/riscv/machdep.c Fri Jan 31 19:00:48 2020 (r357344) @@ -368,11 +368,16 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf = td->td_frame; /* - * Make sure the processor mode has not been tampered with and - * interrupts have not been disabled. - * Supervisor interrupts in user mode are always enabled. + * Permit changes to the USTATUS bits of SSTATUS. + * + * Ignore writes to read-only bits (SD, XS). + * + * Ignore writes to the FS field as set_fpcontext() will set + * it explicitly. */ - if ((mcp->mc_gpregs.gp_sstatus & SSTATUS_SPP) != 0) + if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) & + ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE | + SSTATUS_UIE)) != 0) return (EINVAL); memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t)); @@ -426,7 +431,12 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) { #ifdef FPE struct pcb *curpcb; +#endif + td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_OFF; + +#ifdef FPE critical_enter(); if ((mcp->mc_flags & _MC_FP_VALID) != 0) { @@ -436,6 +446,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) sizeof(mcp->mc_fpregs)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; } critical_exit(); From owner-svn-src-all@freebsd.org Fri Jan 31 19:06:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6741E99ED; Fri, 31 Jan 2020 19:06:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488RWt3WpZz45sc; Fri, 31 Jan 2020 19:06:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FFD71AA84; Fri, 31 Jan 2020 19:06:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJ62hB038865; Fri, 31 Jan 2020 19:06:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJ62TR038864; Fri, 31 Jan 2020 19:06:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311906.00VJ62TR038864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357346 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 357346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:06:02 -0000 Author: dim Date: Fri Jan 31 19:06:01 2020 New Revision: 357346 URL: https://svnweb.freebsd.org/changeset/base/357346 Log: Merge r357342 from the clang1000-import branch: Work around two -Werror warning issues in googletest, which have been solved upstream in the mean time. The first issue is because one of googletest's generated headers contain classes with a user-declared copy assignment operator, but rely on the generation by the compiler of an implicit copy constructor, which is now deprecated: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-param-util-generated.h:5284:8: error: definition of implicit copy constructor for 'CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] void operator=(const CartesianProductHolder3& other); ^ /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/gtest-param-test.h:1277:10: note: in implicit copy constructor for 'testing::internal::CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' first required here return internal::CartesianProductHolder3( ^ /usr/src/tests/sys/fs/fusefs/io.cc:534:2: note: in instantiation of function template specialization 'testing::Combine, testing::internal::ValueArray3, testing::internal::ValueArray4 >' requested here Combine(Bool(), /* async read */ ^ For now, silence the warning using -Wno-deprecated-copy. The second issue is because one of the googlemock test programs attempts to use "unsigned wchar_t" and "signed wchar_t", which are non-standard and at best, hazily defined: contrib/googletest/googlemock/test/gmock-actions_test.cc:111:37: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0U, BuiltInDefaultValue::Get()); ^ contrib/googletest/googlemock/test/gmock-actions_test.cc:112:36: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0, BuiltInDefaultValue::Get()); ^ For now, silence the warning using -Wno-signed-unsigned-wchar. MFC after: 3 days Modified: head/share/mk/googletest.test.inc.mk Directory Properties: head/ (props changed) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Jan 31 19:02:53 2020 (r357345) +++ head/share/mk/googletest.test.inc.mk Fri Jan 31 19:06:01 2020 (r357346) @@ -5,6 +5,18 @@ GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti +.include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000 +# Required until googletest is upgraded to a more recent version (after +# upstream commit efecb0bfa687cf87836494f5d62868485c00fb66). +GTESTS_CXXFLAGS+= -Wno-deprecated-copy + +# Required until googletest is upgraded to a more recent version (after +# upstream commit d44b137fd104dfffdcdea103f7de11b9eccc45c2). +GTESTS_CXXFLAGS+= -Wno-signed-unsigned-wchar +.endif + # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private From owner-svn-src-all@freebsd.org Fri Jan 31 19:06:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78C3F1E9AC3; Fri, 31 Jan 2020 19:06:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488RXp2cRbz461L; Fri, 31 Jan 2020 19:06:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54DEE1AA86; Fri, 31 Jan 2020 19:06:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJ6ol9038960; Fri, 31 Jan 2020 19:06:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJ6oWg038958; Fri, 31 Jan 2020 19:06:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311906.00VJ6oWg038958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357347 - in head: share/mk usr.bin/lex X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: share/mk usr.bin/lex X-SVN-Commit-Revision: 357347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:06:50 -0000 Author: dim Date: Fri Jan 31 19:06:49 2020 New Revision: 357347 URL: https://svnweb.freebsd.org/changeset/base/357347 Log: Merge r357345 from the clang1000-import branch: Disable new clang 10.0.0 warnings about misleading indentation in flex. As this is contributed code with very messy indentation, which will almost certainly never be upgraded, just disable the warning. MFC after: 3 days Modified: head/share/mk/bsd.sys.mk head/usr.bin/lex/Makefile Directory Properties: head/ (props changed) Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Jan 31 19:06:01 2020 (r357346) +++ head/share/mk/bsd.sys.mk Fri Jan 31 19:06:49 2020 (r357347) @@ -111,6 +111,11 @@ CWARNFLAGS.clang+= -Wno-parentheses .if defined(NO_WARRAY_BOUNDS) CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS +.if defined(NO_WMISLEADING_INDENTATION) && \ + ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +CWARNFLAGS+= -Wno-misleading-indentation +.endif # NO_WMISLEADING_INDENTATION .endif # WARNS .if defined(FORMAT_AUDIT) @@ -154,8 +159,7 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable Modified: head/usr.bin/lex/Makefile ============================================================================== --- head/usr.bin/lex/Makefile Fri Jan 31 19:06:01 2020 (r357346) +++ head/usr.bin/lex/Makefile Fri Jan 31 19:06:49 2020 (r357347) @@ -32,6 +32,8 @@ MLINKS+= lex.1 lex++.1 WARNS?= 3 +NO_WMISLEADING_INDENTATION= + CLEANFILES= scan.c skel.c GENFILES= parse.c parse.h scan.c skel.c From owner-svn-src-all@freebsd.org Fri Jan 31 19:36:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD9B81EA892; Fri, 31 Jan 2020 19:36:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SBl4cblz47pq; Fri, 31 Jan 2020 19:36:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F3C11B008; Fri, 31 Jan 2020 19:36:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJaFBj056810; Fri, 31 Jan 2020 19:36:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJaEDP056807; Fri, 31 Jan 2020 19:36:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311936.00VJaEDP056807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357349 - in head/sys: conf modules/tpm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/sys: conf modules/tpm X-SVN-Commit-Revision: 357349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:36:15 -0000 Author: dim Date: Fri Jan 31 19:36:14 2020 New Revision: 357349 URL: https://svnweb.freebsd.org/changeset/base/357349 Log: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. MFC after: 3 days Modified: head/sys/conf/files.amd64 head/sys/conf/kern.mk head/sys/modules/tpm/Makefile Directory Properties: head/ (props changed) Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Jan 31 19:35:21 2020 (r357348) +++ head/sys/conf/files.amd64 Fri Jan 31 19:36:14 2020 (r357349) @@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm -dev/tpm/tpm_crb.c optional tpm acpi +dev/tpm/tpm_crb.c optional tpm acpi \ + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" dev/tpm/tpm_tis.c optional tpm acpi dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri Jan 31 19:35:21 2020 (r357348) +++ head/sys/conf/kern.mk Fri Jan 31 19:36:14 2020 (r357349) @@ -37,6 +37,9 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif +.if ${COMPILER_VERSION} >= 100000 +NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context +.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: head/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 (r357348) +++ head/sys/modules/tpm/Makefile Fri Jan 31 19:36:14 2020 (r357349) @@ -11,3 +11,5 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include + +CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT} From owner-svn-src-all@freebsd.org Fri Jan 31 20:04:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2E681EB32F; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SqP3wBCz496C; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 817661B598; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VK4XAt074686; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VK4Xsc074685; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312004.00VK4Xsc074685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 20:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357351 - in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Commit-Revision: 357351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 20:04:33 -0000 Author: dim Date: Fri Jan 31 20:04:32 2020 New Revision: 357351 URL: https://svnweb.freebsd.org/changeset/base/357351 Log: MFC r357226: Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ Modified: stable/11/contrib/binutils/bfd/peicode.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/bfd/peicode.h stable/12/contrib/binutils/bfd/peicode.h stable/9/contrib/binutils/bfd/peicode.h Directory Properties: stable/10/ (props changed) stable/12/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/11/contrib/binutils/bfd/peicode.h ============================================================================== --- stable/11/contrib/binutils/bfd/peicode.h Fri Jan 31 19:40:40 2020 (r357350) +++ stable/11/contrib/binutils/bfd/peicode.h Fri Jan 31 20:04:32 2020 (r357351) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-all@freebsd.org Fri Jan 31 20:04:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47D721EB326; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SqP119Yz4969; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3C1A1B596; Fri, 31 Jan 2020 20:04:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VK4W22074674; Fri, 31 Jan 2020 20:04:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VK4WS8074673; Fri, 31 Jan 2020 20:04:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312004.00VK4WS8074673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 20:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r357351 - in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Group: stable-9 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Commit-Revision: 357351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 20:04:33 -0000 Author: dim Date: Fri Jan 31 20:04:32 2020 New Revision: 357351 URL: https://svnweb.freebsd.org/changeset/base/357351 Log: MFC r357226: Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ Modified: stable/9/contrib/binutils/bfd/peicode.h Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/bfd/peicode.h stable/11/contrib/binutils/bfd/peicode.h stable/12/contrib/binutils/bfd/peicode.h Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/12/ (props changed) Modified: stable/9/contrib/binutils/bfd/peicode.h ============================================================================== --- stable/9/contrib/binutils/bfd/peicode.h Fri Jan 31 19:40:40 2020 (r357350) +++ stable/9/contrib/binutils/bfd/peicode.h Fri Jan 31 20:04:32 2020 (r357351) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-all@freebsd.org Fri Jan 31 20:04:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 706221EB32A; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SqP2Gsfz496B; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EF511B597; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VK4XrS074680; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VK4Xas074679; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312004.00VK4Xas074679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 20:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357351 - in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Commit-Revision: 357351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 20:04:33 -0000 Author: dim Date: Fri Jan 31 20:04:32 2020 New Revision: 357351 URL: https://svnweb.freebsd.org/changeset/base/357351 Log: MFC r357226: Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ Modified: stable/12/contrib/binutils/bfd/peicode.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/bfd/peicode.h stable/11/contrib/binutils/bfd/peicode.h stable/9/contrib/binutils/bfd/peicode.h Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/12/contrib/binutils/bfd/peicode.h ============================================================================== --- stable/12/contrib/binutils/bfd/peicode.h Fri Jan 31 19:40:40 2020 (r357350) +++ stable/12/contrib/binutils/bfd/peicode.h Fri Jan 31 20:04:32 2020 (r357351) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-all@freebsd.org Fri Jan 31 20:04:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E5C21EB343; Fri, 31 Jan 2020 20:04:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SqP6Gtdz496H; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE95B1B599; Fri, 31 Jan 2020 20:04:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VK4Xgf074692; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VK4Xb5074691; Fri, 31 Jan 2020 20:04:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312004.00VK4Xb5074691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 20:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r357351 - in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/contrib/binutils/bfd 11/contrib/binutils/bfd 12/contrib/binutils/bfd 9/contrib/binutils/bfd X-SVN-Commit-Revision: 357351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 20:04:34 -0000 Author: dim Date: Fri Jan 31 20:04:32 2020 New Revision: 357351 URL: https://svnweb.freebsd.org/changeset/base/357351 Log: MFC r357226: Merge r357224 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ Modified: stable/10/contrib/binutils/bfd/peicode.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/binutils/bfd/peicode.h stable/12/contrib/binutils/bfd/peicode.h stable/9/contrib/binutils/bfd/peicode.h Directory Properties: stable/11/ (props changed) stable/12/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/10/contrib/binutils/bfd/peicode.h ============================================================================== --- stable/10/contrib/binutils/bfd/peicode.h Fri Jan 31 19:40:40 2020 (r357350) +++ stable/10/contrib/binutils/bfd/peicode.h Fri Jan 31 20:04:32 2020 (r357351) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-all@freebsd.org Fri Jan 31 20:30:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D67CB1EBDB3; Fri, 31 Jan 2020 20:30:50 +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 488TPk5RBRz4BZD; Fri, 31 Jan 2020 20:30:50 +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 B5DA81B95E; Fri, 31 Jan 2020 20:30:50 +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 00VKUoul088321; Fri, 31 Jan 2020 20:30:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VKUoeK088320; Fri, 31 Jan 2020 20:30:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001312030.00VKUoeK088320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 31 Jan 2020 20:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357352 - head/tools/uma/smrstress X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/tools/uma/smrstress X-SVN-Commit-Revision: 357352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 20:30:50 -0000 Author: kib Date: Fri Jan 31 20:30:50 2020 New Revision: 357352 URL: https://svnweb.freebsd.org/changeset/base/357352 Log: smrstress: Add 'publishing' fences to operations on smrs_current. Reported and tested by: andrew Reviewed by: jeff Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23440 Modified: head/tools/uma/smrstress/smrstress.c Modified: head/tools/uma/smrstress/smrstress.c ============================================================================== --- head/tools/uma/smrstress/smrstress.c Fri Jan 31 20:04:32 2020 (r357351) +++ head/tools/uma/smrstress/smrstress.c Fri Jan 31 20:30:50 2020 (r357352) @@ -84,7 +84,7 @@ smrs_read(void) /* Wait for the writer to exit. */ while (smrs_completed == 0) { smr_enter(smrs_smr); - cur = (void *)atomic_load_ptr(&smrs_current); + cur = (void *)atomic_load_acq_ptr(&smrs_current); if (cur->generation == -1) smrs_error(cur, "read early: Use after free!\n"); atomic_add_int(&cur->count, 1); @@ -107,6 +107,7 @@ smrs_write(void) for (i = 0; i < smrs_iterations; i++) { cur = uma_zalloc_smr(smrs_zone, M_WAITOK); + atomic_thread_fence_rel(); cur = (void *)atomic_swap_ptr(&smrs_current, (uintptr_t)cur); uma_zfree_smr(smrs_zone, cur); } From owner-svn-src-all@freebsd.org Fri Jan 31 21:08:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A90A1ECB61; Fri, 31 Jan 2020 21:08:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488VFF6ZM3z4D9s; Fri, 31 Jan 2020 21:08:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D87831C09C; Fri, 31 Jan 2020 21:08:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VL8XIE010597; Fri, 31 Jan 2020 21:08:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VL8XOm010596; Fri, 31 Jan 2020 21:08:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202001312108.00VL8XOm010596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 31 Jan 2020 21:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357353 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:08:34 -0000 Author: bdrewery Date: Fri Jan 31 21:08:33 2020 New Revision: 357353 URL: https://svnweb.freebsd.org/changeset/base/357353 Log: make all is needed to generate .depend.* PR: 241746 X-MFC-With: r357043 MFC after: 1 week Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Jan 31 20:30:50 2020 (r357352) +++ head/sys/conf/kern.post.mk Fri Jan 31 21:08:33 2020 (r357353) @@ -389,7 +389,7 @@ kernel-cleandepend: .PHONY kernel-tags: @ls .depend.* > /dev/null 2>&1 || \ - { echo "you must make depend first"; exit 1; } + { echo "you must make all first"; exit 1; } sh $S/conf/systags.sh kernel-install: .PHONY From owner-svn-src-all@freebsd.org Fri Jan 31 21:13:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FB361ECF6A; Fri, 31 Jan 2020 21:13:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (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 488VMW2qXkz4Dhs; Fri, 31 Jan 2020 21:13:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id 77so7957910oty.6; Fri, 31 Jan 2020 13:13:59 -0800 (PST) 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=snQXM9XjQQbK9DZVwvVFCDDvfiWUNBrI8KLGQU12gxo=; b=E1Ayodcb5aOPlRs1y4PYuY8n16i7pMmWBPwn64WtdOu8zJc/xB4F5nJRTBOlPnP/pJ qpFIX3/ohoBfo2Dn2Vph94Qz29rNFsxLDYLeH3tXYqFdVFddJZkaPkHsz0YsEJKa42Ad iE1rZuvbQAryPqJN/+SRCeuX1+WwLR6ofWOqtqpy/U7eHqZvULDhKcXZBlcDTozmI+OT GNHbUDtNpvoWAkVsi1FfvwQ2OWRR4UH6InI2FB9j4eR5s1ctBk0YEmNV1kVIF1yDRz1t 3/kSIUeKqJ/DbXs6Vinr6sOaZG8yagQfV+C5BKWfL6LCHyhCp3SA5KM/mLXJqFj2Ve1B yiag== X-Gm-Message-State: APjAAAXJ6M+dz7XAwHts6L5mJPSeTwBRRrSPnMdzZeRM1K7ExF1uVejm PmBa6yPGZ4BCgeZMdDGAiMJWQQ8U X-Google-Smtp-Source: APXvYqxebGcfF6HePImilOgl4RB6p5ePr5LEZ5NP6XWs3vTEBpaP/6jUWyVKRknqIXRmmB+oZRGsGQ== X-Received: by 2002:a9d:6e8f:: with SMTP id a15mr8888959otr.178.1580505237896; Fri, 31 Jan 2020 13:13:57 -0800 (PST) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com. [209.85.167.179]) by smtp.gmail.com with ESMTPSA id m15sm3423659otr.65.2020.01.31.13.13.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jan 2020 13:13:57 -0800 (PST) Received: by mail-oi1-f179.google.com with SMTP id c16so8691961oic.3; Fri, 31 Jan 2020 13:13:57 -0800 (PST) X-Received: by 2002:aca:3017:: with SMTP id w23mr7301468oiw.152.1580505236931; Fri, 31 Jan 2020 13:13:56 -0800 (PST) MIME-Version: 1.0 References: <202001311936.00VJaEDP056807@repo.freebsd.org> In-Reply-To: <202001311936.00VJaEDP056807@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 31 Jan 2020 13:13:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm To: Dimitry Andric 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: 488VMW2qXkz4Dhs X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:13:59 -0000 Hi Dimitry, Do you think maybe the intent is to use ~TPM_CRB_CTRL_CANCEL_CMD instead? Plain "0" might also make sense. But I think the compiler is right here and the warning should not be disabled =E2=80=94 !BIT(foo) doesn't really make sense for a register. It happens to affect the right bit only because CANCEL_CMD is BIT(0). Thanks, Conrad On Fri, Jan 31, 2020 at 11:36 AM Dimitry Andric wrote: > > Author: dim > Date: Fri Jan 31 19:36:14 2020 > New Revision: 357349 > URL: https://svnweb.freebsd.org/changeset/base/357349 > > Log: > Merge r357348 from the clang 10.0.0 import branch: > > Disable new clang 10.0.0 warnings about converting the result of shift > operations to a boolean in tpm(4): > > sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a= boolean; did you mean '(1 << (0)) !=3D 0'? [-Werror,-Wint-in-bool-context] > WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); > ^ > sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CA= NCEL_CMD' > #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) > ^ > sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' > #define BIT(x) (1 << (x)) > ^ > > Such warnings can be useful in C++ contexts, but not so much in kernel > drivers, where this type of bit twiddling is commonplace. So disable i= t > for this case. > > MFC after: 3 days > > Modified: > head/sys/conf/files.amd64 > head/sys/conf/kern.mk > head/sys/modules/tpm/Makefile > Directory Properties: > head/ (props changed) > > Modified: head/sys/conf/files.amd64 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.amd64 Fri Jan 31 19:35:21 2020 (r357348) > +++ head/sys/conf/files.amd64 Fri Jan 31 19:36:14 2020 (r357349) > @@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional s= c vga vesa > dev/syscons/scvgarndr.c optional sc vga > dev/tpm/tpm.c optional tpm > dev/tpm/tpm20.c optional tpm > -dev/tpm/tpm_crb.c optional tpm acpi > +dev/tpm/tpm_crb.c optional tpm acpi \ > + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" > dev/tpm/tpm_tis.c optional tpm acpi > dev/tpm/tpm_acpi.c optional tpm acpi > dev/tpm/tpm_isa.c optional tpm isa > > Modified: head/sys/conf/kern.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kern.mk Fri Jan 31 19:35:21 2020 (r357348) > +++ head/sys/conf/kern.mk Fri Jan 31 19:36:14 2020 (r357349) > @@ -37,6 +37,9 @@ CWARNEXTRA+=3D -Wno-error-shift-negative-value > .if ${COMPILER_VERSION} >=3D 40000 > CWARNEXTRA+=3D -Wno-address-of-packed-member > .endif > +.if ${COMPILER_VERSION} >=3D 100000 > +NO_WINT_IN_BOOL_CONTEXT=3D -Wno-int-in-bool-context > +.endif > .endif > > .if ${COMPILER_TYPE} =3D=3D "gcc" > > Modified: head/sys/modules/tpm/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 (= r357348) > +++ head/sys/modules/tpm/Makefile Fri Jan 31 19:36:14 2020 (= r357349) > @@ -11,3 +11,5 @@ SRCS+=3D tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.= h acpi_i > SRCS+=3D tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h > > .include > + > +CWARNFLAGS.tpm_crb.c+=3D ${NO_WINT_IN_BOOL_CONTEXT} From owner-svn-src-all@freebsd.org Fri Jan 31 21:17:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F6721ED041; Fri, 31 Jan 2020 21:17:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.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 488VS26Zhbz4Dr5; Fri, 31 Jan 2020 21:17:54 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f45.google.com with SMTP id p8so7927586oth.10; Fri, 31 Jan 2020 13:17:54 -0800 (PST) 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=YZ/hvx4MZ15Y/tnWPnLRUa4TzxHZxAcsrAtNMuBAEuE=; b=e9cKupNAeTjinmR1M4eoil6dIkpKv/XjaZHcxLDHoG4Kn2mEn3Kbw8tUQ+9w/YsWak xXAqLqVASjV5wdtu3ah/MbPS0ej8XVmlltL/LGdhhlX/eT085YCQeedhfEUP1QNecydT iEG6MBsuVPHneHrZx/jnANte3Wh9c06prgqIT/MStUhnr2vw61qFK3J4nYeXo5yJpXLE Xb40U/nM8OkENVmnGHWrPM4dri0EFLvIDrnjsYMucdGvuq5mwvCRR90mZhTGSkfehppc wAqYgdBRzslYAOvTHAOOCeWNPc+I9WVA8wQHzKCqPqxacrwnEZxeNUtFOb7pi5mB2pKd 2lpQ== X-Gm-Message-State: APjAAAUfx1NdCyNOkwxCVPjEnAjV5x1D0c/Wav2cS1BMt69218KrWApc w1elLQgMmvzuOr7779kfbKQ0jvtG X-Google-Smtp-Source: APXvYqziiCNtCNR1xherQQYj2La14CUzViw6BHZpFLsz1rOCUCBAUaNtFOyW4UH/7H9vr3ZIfnx/lQ== X-Received: by 2002:a9d:146:: with SMTP id 64mr9120790otu.39.1580505473228; Fri, 31 Jan 2020 13:17:53 -0800 (PST) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com. [209.85.167.181]) by smtp.gmail.com with ESMTPSA id z21sm3415361oto.52.2020.01.31.13.17.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jan 2020 13:17:53 -0800 (PST) Received: by mail-oi1-f181.google.com with SMTP id q81so8747258oig.0; Fri, 31 Jan 2020 13:17:52 -0800 (PST) X-Received: by 2002:aca:2b0a:: with SMTP id i10mr7771131oik.137.1580505472666; Fri, 31 Jan 2020 13:17:52 -0800 (PST) MIME-Version: 1.0 References: <202001311749.00VHnFb7090545@repo.freebsd.org> In-Reply-To: <202001311749.00VHnFb7090545@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 31 Jan 2020 13:17:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357337 - head/sys/riscv/include To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 488VS26Zhbz4Dr5 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:17:55 -0000 Hi John, Isn't the 32-bit MSTATUS_SD and SSTATUS_SD also UB without explicit unsigned suffix? Best, Conrad On Fri, Jan 31, 2020 at 9:49 AM John Baldwin wrote: > > Author: jhb > Date: Fri Jan 31 17:49:15 2020 > New Revision: 357337 > URL: https://svnweb.freebsd.org/changeset/base/357337 > > Log: > Fix 64-bit value of SSTATUS_SD to use an unsigned long. > > While here, fix MSTATUS_SD to match SSTATUS_SD. > > Reviewed by: mhorne > MFC after: 2 weeks > Sponsored by: DARPA > Differential Revision: https://reviews.freebsd.org/D23434 > > Modified: > head/sys/riscv/include/riscvreg.h > > Modified: head/sys/riscv/include/riscvreg.h > ============================================================================== > --- head/sys/riscv/include/riscvreg.h Fri Jan 31 17:40:41 2020 (r357336) > +++ head/sys/riscv/include/riscvreg.h Fri Jan 31 17:49:15 2020 (r357337) > @@ -73,7 +73,7 @@ > #define SSTATUS_XS_MASK (0x3 << SSTATUS_XS_SHIFT) > #define SSTATUS_SUM (1 << 18) > #if __riscv_xlen == 64 > -#define SSTATUS_SD (1 << 63) > +#define SSTATUS_SD (1ul << 63) > #else > #define SSTATUS_SD (1 << 31) > #endif > @@ -110,8 +110,11 @@ > #define MSTATUS_VM_SV48 10 > #define MSTATUS_VM_SV57 11 > #define MSTATUS_VM_SV64 12 > -#define MSTATUS32_SD (1 << 63) > -#define MSTATUS64_SD (1 << 31) > +#if __riscv_xlen == 64 > +#define MSTATUS_SD (1ul << 63) > +#else > +#define MSTATUS_SD (1 << 31) > +#endif > > #define MSTATUS_PRV_U 0 /* user */ > #define MSTATUS_PRV_S 1 /* supervisor */ From owner-svn-src-all@freebsd.org Fri Jan 31 21:20:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9983D1ED14F; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488VVt3f2tz4F0t; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 777D01C26B; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VLKMhr016432; Fri, 31 Jan 2020 21:20:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VLKMgH016431; Fri, 31 Jan 2020 21:20:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312120.00VLKMgH016431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 21:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r357354 - in stable: 11/stand/i386/gptboot 12/stand/i386/gptboot X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/stand/i386/gptboot 12/stand/i386/gptboot X-SVN-Commit-Revision: 357354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:20:22 -0000 Author: dim Date: Fri Jan 31 21:20:22 2020 New Revision: 357354 URL: https://svnweb.freebsd.org/changeset/base/357354 Log: MFC r357232: Merge r357231 from the clang1000-import branch: Work around assembler error from clang 10.0.0 in gptboot: stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes. jmp MEM_JMP # Start BTX ^ Use the same construct as in stand/i386/boot2/boot1.S, which ensures the jump distance does not become too large. Modified: stable/12/stand/i386/gptboot/gptldr.S Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/i386/gptboot/gptldr.S Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/i386/gptboot/gptldr.S ============================================================================== --- stable/12/stand/i386/gptboot/gptldr.S Fri Jan 31 21:08:33 2020 (r357353) +++ stable/12/stand/i386/gptboot/gptldr.S Fri Jan 31 21:20:22 2020 (r357354) @@ -138,5 +138,5 @@ seta20.3: sti # Enable interrupts * Save drive number from BIOS so boot2 can see it and start BTX. */ movb %dl,MEM_ARG - jmp MEM_JMP # Start BTX + jmp start+MEM_JMP-MEM_ORG # Start BTX end: From owner-svn-src-all@freebsd.org Fri Jan 31 21:20:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBBA61ED155; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488VVt62K5z4F0w; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA4E91C26C; Fri, 31 Jan 2020 21:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VLKMMW016438; Fri, 31 Jan 2020 21:20:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VLKMRI016437; Fri, 31 Jan 2020 21:20:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001312120.00VLKMRI016437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 21:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r357354 - in stable: 11/stand/i386/gptboot 12/stand/i386/gptboot X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/stand/i386/gptboot 12/stand/i386/gptboot X-SVN-Commit-Revision: 357354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:20:23 -0000 Author: dim Date: Fri Jan 31 21:20:22 2020 New Revision: 357354 URL: https://svnweb.freebsd.org/changeset/base/357354 Log: MFC r357232: Merge r357231 from the clang1000-import branch: Work around assembler error from clang 10.0.0 in gptboot: stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes. jmp MEM_JMP # Start BTX ^ Use the same construct as in stand/i386/boot2/boot1.S, which ensures the jump distance does not become too large. Modified: stable/11/stand/i386/gptboot/gptldr.S Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/stand/i386/gptboot/gptldr.S Directory Properties: stable/12/ (props changed) Modified: stable/11/stand/i386/gptboot/gptldr.S ============================================================================== --- stable/11/stand/i386/gptboot/gptldr.S Fri Jan 31 21:08:33 2020 (r357353) +++ stable/11/stand/i386/gptboot/gptldr.S Fri Jan 31 21:20:22 2020 (r357354) @@ -138,5 +138,5 @@ seta20.3: sti # Enable interrupts * Save drive number from BIOS so boot2 can see it and start BTX. */ movb %dl,MEM_ARG - jmp MEM_JMP # Start BTX + jmp start+MEM_JMP-MEM_ORG # Start BTX end: From owner-svn-src-all@freebsd.org Fri Jan 31 22:21:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA06E1EEAFE; Fri, 31 Jan 2020 22:21:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488Ws85nFnz4JM3; Fri, 31 Jan 2020 22:21:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7D281CDC1; Fri, 31 Jan 2020 22:21:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VMLGke053348; Fri, 31 Jan 2020 22:21:16 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VMLGEn053346; Fri, 31 Jan 2020 22:21:16 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001312221.00VMLGEn053346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 31 Jan 2020 22:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357355 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 22:21:17 -0000 Author: jeff Date: Fri Jan 31 22:21:15 2020 New Revision: 357355 URL: https://svnweb.freebsd.org/changeset/base/357355 Log: Add two missing fences with comments describing them. These were found by inspection and after a lengthy discussion with jhb and kib. They have not produced test failures. Don't pointer chase through cpu0's smr. Use cpu correct smr even when not in a critical section to reduce the likelihood of false sharing. Modified: head/sys/kern/subr_smr.c head/sys/sys/smr.h Modified: head/sys/kern/subr_smr.c ============================================================================== --- head/sys/kern/subr_smr.c Fri Jan 31 21:20:22 2020 (r357354) +++ head/sys/kern/subr_smr.c Fri Jan 31 22:21:15 2020 (r357355) @@ -195,7 +195,7 @@ smr_advance(smr_t smr) * odd and an observed value of 0 in a particular CPU means * it is not currently in a read section. */ - s = smr->c_shared; + s = zpcpu_get(smr)->c_shared; goal = atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_INCR; /* @@ -242,16 +242,21 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) */ success = true; critical_enter(); - s = smr->c_shared; + s = zpcpu_get(smr)->c_shared; /* * Acquire barrier loads s_wr_seq after s_rd_seq so that we can not * observe an updated read sequence that is larger than write. */ s_rd_seq = atomic_load_acq_int(&s->s_rd_seq); - s_wr_seq = smr_current(smr); /* + * wr_seq must be loaded prior to any c_seq value so that a stale + * c_seq can only reference time after this wr_seq. + */ + s_wr_seq = atomic_load_acq_int(&s->s_wr_seq); + + /* * Detect whether the goal is valid and has already been observed. * * The goal must be in the range of s_wr_seq >= goal >= s_rd_seq for @@ -335,6 +340,12 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) out: critical_exit(); + + /* + * Serialize with smr_advance()/smr_exit(). The caller is now free + * to modify memory as expected. + */ + atomic_thread_fence_acq(); return (success); } Modified: head/sys/sys/smr.h ============================================================================== --- head/sys/sys/smr.h Fri Jan 31 21:20:22 2020 (r357354) +++ head/sys/sys/smr.h Fri Jan 31 22:21:15 2020 (r357355) @@ -70,10 +70,17 @@ struct smr { * Return the current write sequence number. */ static inline smr_seq_t +smr_shared_current(smr_shared_t s) +{ + + return (atomic_load_int(&s->s_wr_seq)); +} + +static inline smr_seq_t smr_current(smr_t smr) { - return (atomic_load_int(&smr->c_shared->s_wr_seq)); + return (smr_shared_current(zpcpu_get(smr)->c_shared)); } /* @@ -106,7 +113,7 @@ smr_enter(smr_t smr) * is detected and handled there. */ /* This is an add because we do not have atomic_store_acq_int */ - atomic_add_acq_int(&smr->c_seq, smr_current(smr)); + atomic_add_acq_int(&smr->c_seq, smr_shared_current(smr->c_shared)); } /* From owner-svn-src-all@freebsd.org Fri Jan 31 22:36:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6116E1EF150; Fri, 31 Jan 2020 22:36:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488XBj1sHyz4KHV; Fri, 31 Jan 2020 22:36:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 0F1FDC66; Fri, 31 Jan 2020 22:36:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::48be:cb08:157f:a7ed] (unknown [IPv6:2001:470:7a58:0:48be:cb08:157f:a7ed]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 61AA83321C; Fri, 31 Jan 2020 23:36:27 +0100 (CET) From: Dimitry Andric Message-Id: <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_F13EF4D6-E45E-47C8-B899-5F5825D3AFFC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm Date: Fri, 31 Jan 2020 23:36:16 +0100 In-Reply-To: Cc: src-committers , svn-src-all , svn-src-head To: cem@freebsd.org References: <202001311936.00VJaEDP056807@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 22:36:29 -0000 --Apple-Mail=_F13EF4D6-E45E-47C8-B899-5F5825D3AFFC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hmm yes, you are quite right. Other parts of the code also seem to use = ~TPM_XXX, and the WR4() inline function called takes a uint32_t. I'll = revert my change and apply the tilde version instead! -Dimitry > On 31 Jan 2020, at 22:13, Conrad Meyer wrote: >=20 > Hi Dimitry, >=20 > Do you think maybe the intent is to use ~TPM_CRB_CTRL_CANCEL_CMD > instead? Plain "0" might also make sense. But I think the compiler > is right here and the warning should not be disabled =E2=80=94 = !BIT(foo) > doesn't really make sense for a register. It happens to affect the > right bit only because CANCEL_CMD is BIT(0). >=20 > Thanks, > Conrad >=20 > On Fri, Jan 31, 2020 at 11:36 AM Dimitry Andric = wrote: >>=20 >> Author: dim >> Date: Fri Jan 31 19:36:14 2020 >> New Revision: 357349 >> URL: https://svnweb.freebsd.org/changeset/base/357349 >>=20 >> Log: >> Merge r357348 from the clang 10.0.0 import branch: >>=20 >> Disable new clang 10.0.0 warnings about converting the result of = shift >> operations to a boolean in tpm(4): >>=20 >> sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' = to a boolean; did you mean '(1 << (0)) !=3D 0'? = [-Werror,-Wint-in-bool-context] >> WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); >> ^ >> sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro = 'TPM_CRB_CTRL_CANCEL_CMD' >> #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) >> ^ >> sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' >> #define BIT(x) (1 << (x)) >> ^ >>=20 >> Such warnings can be useful in C++ contexts, but not so much in = kernel >> drivers, where this type of bit twiddling is commonplace. So = disable it >> for this case. >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/conf/files.amd64 >> head/sys/conf/kern.mk >> head/sys/modules/tpm/Makefile >> Directory Properties: >> head/ (props changed) >>=20 >> Modified: head/sys/conf/files.amd64 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/conf/files.amd64 Fri Jan 31 19:35:21 2020 = (r357348) >> +++ head/sys/conf/files.amd64 Fri Jan 31 19:36:14 2020 = (r357349) >> @@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional = sc vga vesa >> dev/syscons/scvgarndr.c optional sc vga >> dev/tpm/tpm.c optional tpm >> dev/tpm/tpm20.c optional tpm >> -dev/tpm/tpm_crb.c optional tpm acpi >> +dev/tpm/tpm_crb.c optional tpm acpi \ >> + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" >> dev/tpm/tpm_tis.c optional tpm acpi >> dev/tpm/tpm_acpi.c optional tpm acpi >> dev/tpm/tpm_isa.c optional tpm isa >>=20 >> Modified: head/sys/conf/kern.mk >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/conf/kern.mk Fri Jan 31 19:35:21 2020 = (r357348) >> +++ head/sys/conf/kern.mk Fri Jan 31 19:36:14 2020 = (r357349) >> @@ -37,6 +37,9 @@ CWARNEXTRA+=3D -Wno-error-shift-negative-value >> .if ${COMPILER_VERSION} >=3D 40000 >> CWARNEXTRA+=3D -Wno-address-of-packed-member >> .endif >> +.if ${COMPILER_VERSION} >=3D 100000 >> +NO_WINT_IN_BOOL_CONTEXT=3D -Wno-int-in-bool-context >> +.endif >> .endif >>=20 >> .if ${COMPILER_TYPE} =3D=3D "gcc" >>=20 >> Modified: head/sys/modules/tpm/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 = (r357348) >> +++ head/sys/modules/tpm/Makefile Fri Jan 31 19:36:14 2020 = (r357349) >> @@ -11,3 +11,5 @@ SRCS+=3D tpm_isa.c tpm_acpi.c isa_if.h = opt_acpi.h acpi_i >> SRCS+=3D tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h >>=20 >> .include >> + >> +CWARNFLAGS.tpm_crb.c+=3D ${NO_WINT_IN_BOOL_CONTEXT} --Apple-Mail=_F13EF4D6-E45E-47C8-B899-5F5825D3AFFC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXjSr4QAKCRCwXqMKLiCW o3XXAJ97t4dhBRO3clHnB9hw+3t3kEwg9gCgv52T1MfE79SYmY8zjMLT7Sv1u38= =EygU -----END PGP SIGNATURE----- --Apple-Mail=_F13EF4D6-E45E-47C8-B899-5F5825D3AFFC-- From owner-svn-src-all@freebsd.org Fri Jan 31 22:54:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D281B1EFCF4; Fri, 31 Jan 2020 22:54:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488Xbm5GSJz4LQl; Fri, 31 Jan 2020 22:54:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF3711D4E1; Fri, 31 Jan 2020 22:54:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VMsia3075347; Fri, 31 Jan 2020 22:54:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VMsi3M075346; Fri, 31 Jan 2020 22:54:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001312254.00VMsi3M075346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 31 Jan 2020 22:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357356 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 22:54:44 -0000 Author: kp Date: Fri Jan 31 22:54:44 2020 New Revision: 357356 URL: https://svnweb.freebsd.org/changeset/base/357356 Log: vlan: Fix panic when vnet jail with a vlan interface is destroyed During vnet cleanup vnet_if_uninit() checks that no more interfaces remain in the vnet. Any interface borrowed from another vnet is returned by vnet_if_return(). Other interfaces (i.e. cloned interfaces) should have been destroyed by their cloner at this point. The if_vlan VNET_SYSUNINIT had priority SI_ORDER_FIRST, which means it had equal priority as vnet_if_uninit(). In other words: it was possible for it to be called *after* vnet_if_uninit(), which would lead to assertion failures. Set the priority to SI_ORDER_ANY, like other cloners to ensure that vlan interfaces are destroyed before we enter vnet_if_uninit(). The sys/net/if_vlan test provoked this. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Jan 31 22:21:15 2020 (r357355) +++ head/sys/net/if_vlan.c Fri Jan 31 22:54:44 2020 (r357356) @@ -921,7 +921,7 @@ vnet_vlan_uninit(const void *unused __unused) if_clone_detach(V_vlan_cloner); } -VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, +VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_vlan_uninit, NULL); #endif From owner-svn-src-all@freebsd.org Sat Feb 1 00:53:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72F381F2437; Sat, 1 Feb 2020 00:53:22 +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 488bDf2Pskz4Qyr; Sat, 1 Feb 2020 00:53:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-7.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 D0F2C1D37; Sat, 1 Feb 2020 00:53:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r357337 - head/sys/riscv/include To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <202001311749.00VHnFb7090545@repo.freebsd.org> From: John Baldwin 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: <13613469-f65f-67a6-7933-eaa267f09d33@FreeBSD.org> Date: Fri, 31 Jan 2020 16:53:17 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 00:53:22 -0000 On 1/31/20 1:17 PM, Conrad Meyer wrote: > Hi John, > > Isn't the 32-bit MSTATUS_SD and SSTATUS_SD also UB without explicit > unsigned suffix? Possibly, but I doubt we will have a 32-bit RISC-V port. I'd probably prefer to just use explicit hex values (0x80000000, etc.) since the compiler will always get those correct. -- John Baldwin From owner-svn-src-all@freebsd.org Sat Feb 1 06:39:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E79923E903; Sat, 1 Feb 2020 06:39:50 +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 488kwQ1RR4z4C0M; Sat, 1 Feb 2020 06:39:50 +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 2CA2C22B80; Sat, 1 Feb 2020 06:39:50 +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 0116dodG051452; Sat, 1 Feb 2020 06:39:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0116dnCn051450; Sat, 1 Feb 2020 06:39:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002010639.0116dnCn051450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 06:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357358 - 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: 357358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 06:39:50 -0000 Author: mjg Date: Sat Feb 1 06:39:49 2020 New Revision: 357358 URL: https://svnweb.freebsd.org/changeset/base/357358 Log: vfs: add vrefactn Differential Revision: https://reviews.freebsd.org/D23427 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 Sat Feb 1 06:39:10 2020 (r357357) +++ head/sys/kern/vfs_subr.c Sat Feb 1 06:39:49 2020 (r357358) @@ -3046,6 +3046,19 @@ vrefact(struct vnode *vp) #endif } +void +vrefactn(struct vnode *vp, u_int n) +{ + + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_usecount, n); + VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old)); +#else + atomic_add_int(&vp->v_usecount, n); +#endif +} + /* * Return reference count of a vnode. * Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Feb 1 06:39:10 2020 (r357357) +++ head/sys/sys/vnode.h Sat Feb 1 06:39:49 2020 (r357358) @@ -900,6 +900,7 @@ void vrele(struct vnode *vp); void vref(struct vnode *vp); void vrefl(struct vnode *vp); void vrefact(struct vnode *vp); +void vrefactn(struct vnode *vp, u_int n); int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); From owner-svn-src-all@freebsd.org Sat Feb 1 06:39:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C2F423E5EC; Sat, 1 Feb 2020 06:39:11 +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 488kvg1L1Yz4BtM; Sat, 1 Feb 2020 06:39:11 +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 28F7422B7F; Sat, 1 Feb 2020 06:39:11 +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 0116dBOj051384; Sat, 1 Feb 2020 06:39:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0116dA4B051382; Sat, 1 Feb 2020 06:39:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002010639.0116dA4B051382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 06:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357357 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 357357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 06:39:11 -0000 Author: mjg Date: Sat Feb 1 06:39:10 2020 New Revision: 357357 URL: https://svnweb.freebsd.org/changeset/base/357357 Log: zfs: ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED -> ZFS_TEARDOWN_INACTIVE_WLOCKED Fix up the argument used in one case as well. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jan 31 22:54:44 2020 (r357356) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Feb 1 06:39:10 2020 (r357357) @@ -106,7 +106,7 @@ struct zfsvfs { #define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) -#define ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jan 31 22:54:44 2020 (r357356) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Feb 1 06:39:10 2020 (r357357) @@ -2437,7 +2437,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds) znode_t *zp; ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); - ASSERT(ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); + ASSERT(ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs)); /* * We already own this, so just update the objset_t, as the one we Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Jan 31 22:54:44 2020 (r357356) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Feb 1 06:39:10 2020 (r357357) @@ -606,7 +606,7 @@ zfs_znode_dmu_fini(znode_t *zp) { ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zp->z_zfsvfs, zp->z_id)) || zp->z_unlinked || - ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); + ZFS_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); sa_handle_destroy(zp->z_sa_hdl); zp->z_sa_hdl = NULL; From owner-svn-src-all@freebsd.org Sat Feb 1 06:40:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38BC423ECDB; Sat, 1 Feb 2020 06:40:36 +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 488kxH64tQz4C5V; Sat, 1 Feb 2020 06:40:35 +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 B215422B90; Sat, 1 Feb 2020 06:40:35 +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 0116eZLQ051567; Sat, 1 Feb 2020 06:40:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0116eZO3051566; Sat, 1 Feb 2020 06:40:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002010640.0116eZO3051566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 06:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357359 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 06:40:36 -0000 Author: mjg Date: Sat Feb 1 06:40:35 2020 New Revision: 357359 URL: https://svnweb.freebsd.org/changeset/base/357359 Log: vfs: save on atomics on the root vnode for absolute lookups There are 2 back-to-back atomics on the vnode, but we can check upfront if one is sufficient. Similarly we can handle relative lookups where current working directory == root directory. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23427 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Feb 1 06:39:49 2020 (r357358) +++ head/sys/kern/vfs_lookup.c Sat Feb 1 06:40:35 2020 (r357359) @@ -254,7 +254,7 @@ namei_cleanup_cnp(struct componentname *cnp) } static int -namei_handle_root(struct nameidata *ndp, struct vnode **dpp) +namei_handle_root(struct nameidata *ndp, struct vnode **dpp, u_int n) { struct componentname *cnp; @@ -276,7 +276,7 @@ namei_handle_root(struct nameidata *ndp, struct vnode ndp->ni_pathlen--; } *dpp = ndp->ni_rootdir; - vrefact(*dpp); + vrefactn(*dpp, n); return (0); } @@ -395,8 +395,11 @@ namei(struct nameidata *ndp) * Get starting point for the translation. */ FILEDESC_SLOCK(fdp); + /* + * The reference on ni_rootdir is acquired in the block below to avoid + * back-to-back atomics for absolute lookups. + */ ndp->ni_rootdir = fdp->fd_rdir; - vrefact(ndp->ni_rootdir); ndp->ni_topdir = fdp->fd_jdir; /* @@ -412,15 +415,29 @@ namei(struct nameidata *ndp) cnp->cn_nameptr = cnp->cn_pnbuf; if (cnp->cn_pnbuf[0] == '/') { ndp->ni_resflags |= NIRES_ABS; - error = namei_handle_root(ndp, &dp); + error = namei_handle_root(ndp, &dp, 2); + if (error != 0) { + /* + * Simplify error handling, we should almost never be + * here. + */ + vrefact(ndp->ni_rootdir); + } } else { if (ndp->ni_startdir != NULL) { + vrefact(ndp->ni_rootdir); dp = ndp->ni_startdir; startdir_used = 1; } else if (ndp->ni_dirfd == AT_FDCWD) { dp = fdp->fd_cdir; - vrefact(dp); + if (dp == ndp->ni_rootdir) { + vrefactn(dp, 2); + } else { + vrefact(ndp->ni_rootdir); + vrefact(dp); + } } else { + vrefact(ndp->ni_rootdir); rights = ndp->ni_rightsneeded; cap_rights_set(&rights, CAP_LOOKUP); @@ -567,7 +584,7 @@ namei(struct nameidata *ndp) cnp->cn_nameptr = cnp->cn_pnbuf; if (*(cnp->cn_nameptr) == '/') { vrele(dp); - error = namei_handle_root(ndp, &dp); + error = namei_handle_root(ndp, &dp, 1); if (error != 0) goto out; } From owner-svn-src-all@freebsd.org Sat Feb 1 06:46:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E37DF240B9C; Sat, 1 Feb 2020 06:46:56 +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 488l4c5hqYz4CXX; Sat, 1 Feb 2020 06:46:56 +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 BEAAA22D52; Sat, 1 Feb 2020 06:46:56 +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 0116kugO057333; Sat, 1 Feb 2020 06:46:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0116ktUk057327; Sat, 1 Feb 2020 06:46:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002010646.0116ktUk057327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 06:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357361 - in head/sys: kern sys ufs/ufs vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys ufs/ufs vm X-SVN-Commit-Revision: 357361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 06:46:57 -0000 Author: mjg Date: Sat Feb 1 06:46:55 2020 New Revision: 357361 URL: https://svnweb.freebsd.org/changeset/base/357361 Log: vfs: replace VOP_MARKATIME with VOP_MMAPPED The routine is only provided by ufs and is only used on mmap and exec. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23422 Modified: head/sys/kern/kern_exec.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_vnops.c head/sys/vm/vm_mmap.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/kern/kern_exec.c Sat Feb 1 06:46:55 2020 (r357361) @@ -870,7 +870,7 @@ interpret: /* Set values passed into the program in registers. */ (*p->p_sysent->sv_setregs)(td, imgp, stack_base); - vfs_mark_atime(imgp->vp, td->td_ucred); + VOP_MMAPPED(imgp->vp); SDT_PROBE1(proc, , , exec__success, args->fname); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/kern/vfs_subr.c Sat Feb 1 06:46:55 2020 (r357361) @@ -5956,23 +5956,6 @@ vfs_read_dirent(struct vop_readdir_args *ap, struct di } /* - * Mark for update the access time of the file if the filesystem - * supports VOP_MARKATIME. This functionality is used by execve and - * mmap, so we want to avoid the I/O implied by directly setting - * va_atime for the sake of efficiency. - */ -void -vfs_mark_atime(struct vnode *vp, struct ucred *cred) -{ - struct mount *mp; - - mp = vp->v_mount; - ASSERT_VOP_LOCKED(vp, "vfs_mark_atime"); - if (mp != NULL && (mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) - (void)VOP_MARKATIME(vp); -} - -/* * The purpose of this routine is to remove granularity from accmode_t, * reducing it into standard unix access bits - VEXEC, VREAD, VWRITE, * VADMIN and VAPPEND. Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/kern/vnode_if.src Sat Feb 1 06:46:55 2020 (r357361) @@ -181,9 +181,9 @@ vop_setattr { }; -%% markatime vp L L L +%% mmapped vp L L L -vop_markatime { +vop_mmapped { IN struct vnode *vp; }; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/sys/vnode.h Sat Feb 1 06:46:55 2020 (r357361) @@ -937,7 +937,6 @@ void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); int vfs_kqfilter(struct vop_kqfilter_args *); -void vfs_mark_atime(struct vnode *vp, struct ucred *cred); struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_emptydir(struct vnode *vp); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:46:55 2020 (r357361) @@ -108,7 +108,7 @@ static vop_getattr_t ufs_getattr; static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *, const char *); -static vop_markatime_t ufs_markatime; +static vop_mmapped_t ufs_mmapped; static vop_mkdir_t ufs_mkdir; static vop_mknod_t ufs_mknod; static vop_open_t ufs_open; @@ -676,19 +676,22 @@ out: } #endif /* UFS_ACL */ -/* - * Mark this file's access time for update for vfs_mark_atime(). This - * is called from execve() and mmap(). - */ static int -ufs_markatime(ap) - struct vop_markatime_args /* { +ufs_mmapped(ap) + struct vop_mmapped_args /* { struct vnode *a_vp; } */ *ap; { - struct inode *ip = VTOI(ap->a_vp); + struct vnode *vp; + struct inode *ip; + struct mount *mp; - UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS); + vp = ap->a_vp; + ip = VTOI(vp); + mp = vp->v_mount; + + if ((mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) + UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS); /* * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. */ @@ -2741,7 +2744,7 @@ struct vop_vector ufs_vnodeops = { .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, - .vop_markatime = ufs_markatime, + .vop_mmapped = ufs_mmapped, .vop_mkdir = ufs_mkdir, .vop_mknod = ufs_mknod, .vop_need_inactive = ufs_need_inactive, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Feb 1 06:41:44 2020 (r357360) +++ head/sys/vm/vm_mmap.c Sat Feb 1 06:46:55 2020 (r357361) @@ -1354,7 +1354,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, *objp = obj; *flagsp = flags; - vfs_mark_atime(vp, cred); + VOP_MMAPPED(vp); done: if (error != 0 && *writecounted) { From owner-svn-src-all@freebsd.org Sat Feb 1 06:41:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CEC223F252; Sat, 1 Feb 2020 06:41:45 +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 488kyd3HB1z4CN0; Sat, 1 Feb 2020 06:41:45 +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 6BFC322D0D; Sat, 1 Feb 2020 06:41: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 0116fjni053086; Sat, 1 Feb 2020 06:41:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0116fj3c053085; Sat, 1 Feb 2020 06:41:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002010641.0116fj3c053085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 06:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357360 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 357360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 06:41:45 -0000 Author: mjg Date: Sat Feb 1 06:41:44 2020 New Revision: 357360 URL: https://svnweb.freebsd.org/changeset/base/357360 Log: ufs: drop ufs_markatime from ufs_fifoops The routine is only called on mmap and exec, both of which are invalid for this type. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23421 Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:40:35 2020 (r357359) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 06:41:44 2020 (r357360) @@ -2783,7 +2783,6 @@ struct vop_vector ufs_fifoops = { .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, - .vop_markatime = ufs_markatime, .vop_pathconf = ufs_pathconf, .vop_print = ufs_print, .vop_read = VOP_PANIC, From owner-svn-src-all@freebsd.org Sat Feb 1 09:13:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DDF3249175; Sat, 1 Feb 2020 09:13:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488pKN2Hjpz4KYj; Sat, 1 Feb 2020 09:13:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C51248F3; Sat, 1 Feb 2020 09:13:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0119DCxn046058; Sat, 1 Feb 2020 09:13:12 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0119DCuq046057; Sat, 1 Feb 2020 09:13:12 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202002010913.0119DCuq046057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sat, 1 Feb 2020 09:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357362 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 357362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 09:13:12 -0000 Author: pjd Date: Sat Feb 1 09:13:11 2020 New Revision: 357362 URL: https://svnweb.freebsd.org/changeset/base/357362 Log: Restore previous usage presentation (without "pwait: " prefix). Pointed out by: jilles Modified: head/bin/pwait/pwait.c Modified: head/bin/pwait/pwait.c ============================================================================== --- head/bin/pwait/pwait.c Sat Feb 1 06:46:55 2020 (r357361) +++ head/bin/pwait/pwait.c Sat Feb 1 09:13:11 2020 (r357362) @@ -53,7 +53,8 @@ static void usage(void) { - errx(EX_USAGE, "usage: pwait [-t timeout] [-ov] pid ..."); + fprintf(stderr, "usage: pwait [-t timeout] [-ov] pid ...\n"); + exit(EX_USAGE); } /* From owner-svn-src-all@freebsd.org Sat Feb 1 09:14:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BE152491FB; Sat, 1 Feb 2020 09:14:03 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 488pLL2JQXz4Kht; Sat, 1 Feb 2020 09:14:01 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from pjdmacbook.local (c-67-169-9-63.hsd1.ca.comcast.net [67.169.9.63]) by mail.dawidek.net (Postfix) with ESMTPSA id EAFA547; Sat, 1 Feb 2020 10:13:53 +0100 (CET) Subject: Re: svn commit: r357138 - head/bin/pwait To: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001261049.00QAnORw063681@repo.freebsd.org> <6cb2e1c2-f81d-7e06-80a3-a0d7fee00c6a@stack.nl> From: Pawel Jakub Dawidek Autocrypt: addr=pawel@dawidek.net; prefer-encrypt=mutual; keydata= xsFNBFUw6dIBEADZyMuLdzuT7M37zD+2zrTKVZrgLf3jHKd4VOdU+KVj4TvirBXsAGk0Kyld 5dMbjZDxAVKSgviQ6pLvDIwQw/LjwTc/Frbrj0F9DvGCuu1LZKDf5lvL8Kfs/uX8hrsQLmjA dY2Rr6/isDzUBUWH5v2uSxTD9l1h7nvVx+B4gpfe2pYvVOTvEG3UqbjjUT3d0R2L1X8M2f4y T2FqFp2gbuwJT6N6jr+wFheqhltOW5a1e7aO6Ds4Jow1AJ/8vfZ3PHWt7/GE0BIy1oDQLWjK 1UQxpklZLKhCWaJlypYLZDkNbiit/cki1bbkrbdvgtwFzezqndgmpkUU+9QeXaBit2synjka z3f4OwwlilAYwu6NUDdJVavuIyHzbmLfdTIUYzl4Uc/82aChEFWhHvV+mOluURL9870Fz6K9 DoDraymrsyoOeLZ7464ofoRo6iL4DfSEIZt02Tu8glQ7HzB77awzU0hPcR/HPAh7j1jXYH8k IPXDHbKjkm9KHughO1BafKKl8VvWlPOO3dM+BUGaaqCt/ccYie6onvkEJn44Ho8XnlLmWlzy XsVW0NB4uuNLkINkC8dQEel3U4ZEIuseqDiitH0RceIbVypCJjdc+p0pmadNxyhLW/g2IDsM zc8VLpyQz8sXG+2ZeaGkvVpDAuqUj0hxS6lFpCLRgYhF3R2PIQARAQABzSZQYXdlxYIgSmFr dWIgRGF3aWRlayA8cGpkQEZyZWVCU0Qub3JnPsLBfQQTAQoAJwUCVTDqMQIbAwUJCWYBgAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRCVS4UrsShbdRTeEACcpbKYbLX4Nh+DWMmoSZ0r C+fD8GB0OKKp5zMyN9PFvEW9AVOQOFA+SWP8Eo0qCMPNVkcRp+7zFvOrDLEjgCs/id7pTZr4 d2el3El04bJH2p62VLemTVBiNf19TRYr9nrZjqOoIB+x7+hwuVQ84HtWCJRBlVpBLY7JnXfO 50jF4E20T9XBElwLfivsG1mEQFNQD/AGiFSEP3HZs06bMjGnLd30C5oTW+NFl2K6urNFAss+ pBO/5ZH4zLhgItjZRMYHU8y4rWeBgUq72pcZEQ8begVC/GUyE7/mGwtJBpOcBIGG3fZkhIqi 3NxRSRrGjQtROA6zubqx/oRWHjl2Wsk6rlFZDUhxBwfoY3tqfPnuIe+vyouZK+/IjXENoeeH VgGScJAaffNUw2qYOJILmjFfp904HG+lNEEU2xYDgRhBWLxx1QKzTleVZSgbsKUF+ib+IofD hbeO4jo3bgRH2zl02Vu0gdxbVf/rZ8ln1M7nIA0eYFNKiv0FXpFNw00O6/9lsB1uRDpvs3Jb 5Zo6e0EzVZBusDB8MJPh7RwuSXbe2KLWPTq/GTu5lhfyFrNtI3tnqEXwqYdbM+8CF2gvlN3F MI75peFXB63j0liVQmt8R/OikyuteVGBSRxsR06NtS/48xBg6Icq3cPeXcv9V0F9KS7spbR8 bfsLFg4p+yO0Hs7BTQRVMOnSARAAsu1DI8OZkVj7TmQ+wy8KD0iWjaiO1eepbqS+sIdOrlXI ++0UfQIi886zU68CrNA/yI6Miu80T3pOaCD6JA0JDGnh/skozlr/fwgdeQf02byVKY4Twx/2 JJBuGxjdEd53apu+FuGPZpD6kJkexq7Q415vUHmRh0vCO0Dr8ChFPgTOm6kzig8NqZwTj6Wj Rm3gbp23TQnkOtWtGp0G9p9VJw6z1j3NPXFmygijbOAX2BdEpnSD6ppLjwRYi9ZafUTZUCiq Dj/dwIOMF3FNOVfcbydPpfxDZEQIBNUTljojve78eLN4np4d7vKR6/DBY4PqsIB05uIMmAGc ebil9tVqcRqc/FU4xH8raZlhtqhGiiOYMFTKzo1gTBLlua0C99XRQo50JFZEIjdJvrlLcfyb caXs4JnKghjrNQT6MwROlsXMFourDuOtJ+6Yv9Zh+1WdIKFfYuQkjNXZYKjcFdyiys6lFpqS kVsuR3y9nS2wj9sYniFToOdXwmaecTjc0v0UYdcYQSyLhSASw7Hqc70bxMVx8YJPZ3q0Gak8 ltpxxVBLsugV4FlEOZHjqzlFS31nFhXgQGEPdh/2QlUd4LEsh5o2wMo22uNad/0MsqKealap Pe0wv0DxV1SPIZc8GEOzah5egjIrZBZs7wxS0c9v2N7aiOVYQYt3ehMCi351Az8AEQEAAcLB ZQQYAQoADwUCVTDp0gIbDAUJCWYBgAAKCRCVS4UrsShbdWhPD/96+OIFTu+Y1j4VTGERHESm C3w8ZN1P4PmfFyNO3JICeXwHkw2sfcHsnsKCstni0q//a3Z1nTZbnCGb02/6wN//FGXlcaA6 gJSWj/Di30hlyO3CDIj/3HxCfsAl6o1fiPL20wxaRRoYPFFbv+bfQQVeoc92NGsu2nE1tQ60 aTuuM+3ZNTWW6PreCW3WdA9QgKA247Sp0jTXbZiIpjXH4byC3EHBHPjGFYQrDedfm88EddWD hCJk16SmrD9B40h0PS1NPTk745fwZp2yfzx6tEcQoHa7SX5EmvZ18HkdzWVUmGPsYK+CJ6ZJ DO4YI4hFZ+1zUPsFYYA6mSHgNnFUa8d/HrFLjU+bFrcOIUhFyw+twISmq97QABbh+045/mqL Mop692EBUc5JrwcqeizGs32Pmjb3glUkkF9M7ssQd33oqwmJYReILIvo9SR4zf8jlNgpM5C0 lCwyAIwUZ7fD1lpS8GmjR9bsLOIEvvO9m+ty1jwkpUv0sNjgLD4XYEM3xJDaevfI7LZTG0yj mkdlMJvk5Oh2kGs89W9xdPehFQnIao52Rp43cDgNx8h86QoKOLdgddn8d6X18tG7oR79Mufj W9+JOHz44OU6H/qCq81zdxmPRdla7+eoyjNatXHlHvTx6HUkbjo1/MBoHQDeCiR3z7yyXq1Q jN7Z51AB9/Ip1Q== Message-ID: <4583631f-13ed-b251-b595-d76eb0e3739d@dawidek.net> Date: Sat, 1 Feb 2020 01:13:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <6cb2e1c2-f81d-7e06-80a3-a0d7fee00c6a@stack.nl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 488pLL2JQXz4Kht X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pawel@dawidek.net has no SPF policy when checking 91.121.88.72) smtp.mailfrom=pawel@dawidek.net X-Spamd-Result: default: False [1.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[63.9.169.67.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dawidek.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.87)[0.870,0]; NEURAL_HAM_MEDIUM(-0.43)[-0.433,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16276, ipnet:91.121.0.0/16, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.12)[ipnet: 91.121.0.0/16(-1.48), asn: 16276(2.07), country: FR(0.00)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 09:14:03 -0000 On 1/30/20 14:47, Jilles Tjoelker wrote: > On 26-01-2020 11:49, Pawel Jakub Dawidek wrote: >> Author: pjd >> Date: Sun Jan 26 10:49:24 2020 >> New Revision: 357138 >> URL: https://svnweb.freebsd.org/changeset/base/357138 >> >> Log: >>    - Be consistent with using sysexits(3) codes. >>    - Turn fprintf()+exit() into errx(). >>       Sponsored by:    Fudo Security >> >> Modified: >>    head/bin/pwait/pwait.c >> >> Modified: head/bin/pwait/pwait.c >> ============================================================================== >> >> --- head/bin/pwait/pwait.c    Sun Jan 26 07:24:49 2020    (r357137) >> +++ head/bin/pwait/pwait.c    Sun Jan 26 10:49:24 2020    (r357138) >> @@ -53,8 +53,7 @@ static void >>   usage(void) >>   { >>   -    fprintf(stderr, "usage: pwait [-t timeout] [-v] pid ...\n"); >> -    exit(EX_USAGE); >> +    errx(EX_USAGE, "usage: pwait [-t timeout] [-v] pid ..."); > > This adds a "pwait: " before the line, which most other programs do not do. > Reverted in r357362. Thanks. -- Pawel Jakub Dawidek From owner-svn-src-all@freebsd.org Sat Feb 1 10:15:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4470F24A77A; Sat, 1 Feb 2020 10:15:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488qj815t4z4NPZ; Sat, 1 Feb 2020 10:15:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2054E253FE; Sat, 1 Feb 2020 10:15:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011AFNRZ081628; Sat, 1 Feb 2020 10:15:23 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011AFNPl081627; Sat, 1 Feb 2020 10:15:23 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202002011015.011AFNPl081627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sat, 1 Feb 2020 10:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357363 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 357363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 10:15:24 -0000 Author: pjd Date: Sat Feb 1 10:15:23 2020 New Revision: 357363 URL: https://svnweb.freebsd.org/changeset/base/357363 Log: The error variable is not really needed. Remove it. Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Feb 1 09:13:11 2020 (r357362) +++ head/sys/geom/geom_disk.c Sat Feb 1 10:15:23 2020 (r357363) @@ -268,7 +268,6 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * { struct disk *dp; struct g_disk_softc *sc; - int error; sc = pp->private; dp = sc->dp; @@ -277,8 +276,7 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * if (dp->d_ioctl == NULL) return (ENOIOCTL); - error = dp->d_ioctl(dp, cmd, data, fflag, td); - return (error); + return (dp->d_ioctl(dp, cmd, data, fflag, td)); } static off_t From owner-svn-src-all@freebsd.org Sat Feb 1 10:25:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C95824A9E7; Sat, 1 Feb 2020 10:25:14 +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 488qwV1prNz4NqZ; Sat, 1 Feb 2020 10:25:14 +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 3969B255DD; Sat, 1 Feb 2020 10:25:14 +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 011APEQb087632; Sat, 1 Feb 2020 10:25:14 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011APE74087631; Sat, 1 Feb 2020 10:25:14 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202002011025.011APE74087631@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: Sat, 1 Feb 2020 10:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357364 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 357364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 10:25:14 -0000 Author: 0mp (doc,ports committer) Date: Sat Feb 1 10:25:13 2020 New Revision: 357364 URL: https://svnweb.freebsd.org/changeset/base/357364 Log: bridge.4: Remove notes about FreeBSD 6.2-7.2 Reported by: Mateusz Kwiatkowski Reviewed by: brueffer Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D23393 Modified: head/share/man/man4/bridge.4 Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Sat Feb 1 10:15:23 2020 (r357363) +++ head/share/man/man4/bridge.4 Sat Feb 1 10:25:13 2020 (r357364) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2017 +.Dd February 01, 2020 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -480,13 +480,6 @@ ifconfig gif0 tunnel 1.2.3.4 5.6.7.8 up ifconfig bridge0 create ifconfig bridge0 addm fxp0 addm gif0 up .Ed -.Pp -Note that -.Fx -6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 have a bug in the EtherIP protocol. -For more details and workaround, see the -.Xr gif 4 -manual page. .Sh SEE ALSO .Xr gif 4 , .Xr ipf 4 , From owner-svn-src-all@freebsd.org Sat Feb 1 11:31:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2848124BE60; Sat, 1 Feb 2020 11:31:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488sPG09vTz4RMx; Sat, 1 Feb 2020 11:31:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F24262BD; Sat, 1 Feb 2020 11:31:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011BVjgC026632; Sat, 1 Feb 2020 11:31:45 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011BVj5V026631; Sat, 1 Feb 2020 11:31:45 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202002011131.011BVj5V026631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Feb 2020 11:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357365 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 357365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 11:31:46 -0000 Author: kp Date: Sat Feb 1 11:31:45 2020 New Revision: 357365 URL: https://svnweb.freebsd.org/changeset/base/357365 Log: tests: epair: Don't fail if the if_epair module is already loaded kldload() returns an error (EEXIST) if the module is already loaded. That's not a problem for us, so ignore that error. While here also clean up include statements. MFC after: 3 days X-MFC-With: r357234 Modified: head/tests/sys/net/if_epair.c Modified: head/tests/sys/net/if_epair.c ============================================================================== --- head/tests/sys/net/if_epair.c Sat Feb 1 10:25:13 2020 (r357364) +++ head/tests/sys/net/if_epair.c Sat Feb 1 11:31:45 2020 (r357365) @@ -25,17 +25,19 @@ * $FreeBSD$ */ +#include #include #include #include -#include #include #include #include +#include #include #include +#include #include @@ -51,7 +53,7 @@ ATF_TC_BODY(params, tc) int s; s = kldload("if_epair"); - if (s != 0) + if (s != 0 && errno != EEXIST) atf_tc_fail("Failed to load if_epair"); s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-all@freebsd.org Sat Feb 1 16:57:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F6741FBE58; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890cd0yRNz3GbV; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 020121EF2; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011Gv4mP020123; Sat, 1 Feb 2020 16:57:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011Gv4Bp020121; Sat, 1 Feb 2020 16:57:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002011657.011Gv4Bp020121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 16:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357366 - in head/sys: conf modules/tpm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/sys: conf modules/tpm X-SVN-Commit-Revision: 357366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 16:57:05 -0000 Author: dim Date: Sat Feb 1 16:57:04 2020 New Revision: 357366 URL: https://svnweb.freebsd.org/changeset/base/357366 Log: Revert r357349, since the clang 10.0.0 warning was actually correct, and the ! operator should have been a ~ instead: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. Noticed by: cem MFC after: 3 days Modified: head/sys/conf/files.amd64 head/sys/conf/kern.mk head/sys/modules/tpm/Makefile Directory Properties: head/ (props changed) Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/conf/files.amd64 Sat Feb 1 16:57:04 2020 (r357366) @@ -323,8 +323,7 @@ dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm -dev/tpm/tpm_crb.c optional tpm acpi \ - compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" +dev/tpm/tpm_crb.c optional tpm acpi dev/tpm/tpm_tis.c optional tpm acpi dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/conf/kern.mk Sat Feb 1 16:57:04 2020 (r357366) @@ -37,9 +37,6 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif -.if ${COMPILER_VERSION} >= 100000 -NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context -.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: head/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/modules/tpm/Makefile Sat Feb 1 16:57:04 2020 (r357366) @@ -11,5 +11,3 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include - -CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT} From owner-svn-src-all@freebsd.org Sat Feb 1 17:02:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38DDC1FC7E7; Sat, 1 Feb 2020 17:02:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890kp6v8Rz3HMB; Sat, 1 Feb 2020 17:02:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4BF320D6; Sat, 1 Feb 2020 17:02:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011H2QAR026530; Sat, 1 Feb 2020 17:02:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011H2Qho026529; Sat, 1 Feb 2020 17:02:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002011702.011H2Qho026529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 17:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357367 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 357367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:02:27 -0000 Author: dim Date: Sat Feb 1 17:02:26 2020 New Revision: 357367 URL: https://svnweb.freebsd.org/changeset/base/357367 Log: Fix new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ In this case, the intent was to clear the zeroth bit, and leave the rest unaffected. Therefore, the ~ operator should be used instead. Noticed by: cem MFC after: 3 days Modified: head/sys/dev/tpm/tpm_crb.c Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Sat Feb 1 16:57:04 2020 (r357366) +++ head/sys/dev/tpm/tpm_crb.c Sat Feb 1 17:02:26 2020 (r357367) @@ -298,7 +298,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); return (true); } @@ -330,7 +330,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { From owner-svn-src-all@freebsd.org Sat Feb 1 17:09:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6F8D1FCA0E; Sat, 1 Feb 2020 17:09:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890vS5nymz3HdN; Sat, 1 Feb 2020 17:09:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDA3920E6; Sat, 1 Feb 2020 17:09:56 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011H9usM026991; Sat, 1 Feb 2020 17:09:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011H9ukr026990; Sat, 1 Feb 2020 17:09:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202002011709.011H9ukr026990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 1 Feb 2020 17:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357369 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 357369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:09:57 -0000 Author: mhorne Date: Sat Feb 1 17:09:56 2020 New Revision: 357369 URL: https://svnweb.freebsd.org/changeset/base/357369 Log: prci: register the DDR and GEMGX PLLs The PRCI module exports three PLLs. Currently only the coreclk/corepll is registered, so add the logic to register the DDR (memory) and GEMGX (ethernet) clocks as well. These clocks are unused at the moment. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23404 Modified: head/sys/riscv/sifive/fu540_prci.c Modified: head/sys/riscv/sifive/fu540_prci.c ============================================================================== --- head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:03:31 2020 (r357368) +++ head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:09:56 2020 (r357369) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END @@ -68,6 +70,7 @@ struct prci_softc { struct prci_clk_pll_sc { struct prci_softc *parent_sc; + uint32_t reg; }; #define PRCI_LOCK(sc) mtx_lock(&(sc)->mtx) @@ -75,17 +78,40 @@ struct prci_clk_pll_sc { #define PRCI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); #define PRCI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); -#define PRCI_COREPLL 0x4 -#define PRCI_COREPLL_DIVR_MASK 0x3f -#define PRCI_COREPLL_DIVR_SHIFT 0 -#define PRCI_COREPLL_DIVF_MASK 0x7fc0 -#define PRCI_COREPLL_DIVF_SHIFT 6 -#define PRCI_COREPLL_DIVQ_MASK 0x38000 -#define PRCI_COREPLL_DIVQ_SHIFT 15 +#define PRCI_COREPLL_CFG0 0x4 +#define PRCI_DDRPLL_CFG0 0xC +#define PRCI_GEMGXLPLL_CFG0 0x1C +#define PRCI_PLL_DIVR_MASK 0x3f +#define PRCI_PLL_DIVR_SHIFT 0 +#define PRCI_PLL_DIVF_MASK 0x7fc0 +#define PRCI_PLL_DIVF_SHIFT 6 +#define PRCI_PLL_DIVQ_MASK 0x38000 +#define PRCI_PLL_DIVQ_SHIFT 15 + #define PRCI_READ(_sc, _reg) \ bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) +struct prci_pll_def { + uint32_t id; + const char *name; + uint32_t reg; +}; + +#define PLL(_id, _name, _base) \ +{ \ + .id = (_id), \ + .name = (_name), \ + .reg = (_base), \ +} + +/* PLL Clocks */ +struct prci_pll_def pll_clks[] = { + PLL(PRCI_CLK_COREPLL, "coreclk", PRCI_COREPLL_CFG0), + PLL(PRCI_CLK_DDRPLL, "ddrclk", PRCI_DDRPLL_CFG0), + PLL(PRCI_CLK_GEMGXLPLL, "gemgxclk", PRCI_GEMGXLPLL_CFG0), +}; + static int prci_clk_pll_init(struct clknode *clk, device_t dev) { @@ -121,11 +147,11 @@ prci_clk_pll_recalc(struct clknode *clk, uint64_t *fre } /* Calculate the PLL output */ - val = PRCI_READ(sc->parent_sc, PRCI_COREPLL); + val = PRCI_READ(sc->parent_sc, sc->reg); - divf = (val & PRCI_COREPLL_DIVF_MASK) >> PRCI_COREPLL_DIVF_SHIFT; - divq = (val & PRCI_COREPLL_DIVQ_MASK) >> PRCI_COREPLL_DIVQ_SHIFT; - divr = (val & PRCI_COREPLL_DIVR_MASK) >> PRCI_COREPLL_DIVR_SHIFT; + divf = (val & PRCI_PLL_DIVF_MASK) >> PRCI_PLL_DIVF_SHIFT; + divq = (val & PRCI_PLL_DIVQ_MASK) >> PRCI_PLL_DIVQ_SHIFT; + divr = (val & PRCI_PLL_DIVR_MASK) >> PRCI_PLL_DIVR_SHIFT; *freq = refclk / (divr + 1) * (2 * (divf + 1)) / (1 << divq); @@ -160,7 +186,8 @@ prci_probe(device_t dev) } static void -prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef) +prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef, + uint32_t reg) { struct clknode *clk; struct prci_clk_pll_sc *sc; @@ -172,6 +199,7 @@ prci_pll_register(struct prci_softc *parent_sc, struct sc = clknode_get_softc(clk); sc->parent_sc = parent_sc; + sc->reg = reg; clknode_register(parent_sc->clkdom, clk); } @@ -207,8 +235,6 @@ prci_attach(device_t dev) } bzero(&clkdef, sizeof(clkdef)); - clkdef.id = 0; - clkdef.name = "coreclk"; clkdef.parent_names = mallocarray(ncells, sizeof(char *), M_OFWPROP, M_WAITOK); for (i = 0; i < ncells; i++) { @@ -232,7 +258,11 @@ prci_attach(device_t dev) } /* We can't free a clkdom, so from now on we cannot fail. */ - prci_pll_register(sc, &clkdef); + for (i = 0; i < nitems(pll_clks); i++) { + clkdef.id = pll_clks[i].id; + clkdef.name = pll_clks[i].name; + prci_pll_register(sc, &clkdef, pll_clks[i].reg); + } error = clkdom_finit(sc->clkdom); if (error) From owner-svn-src-all@freebsd.org Sat Feb 1 17:12:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29CE81FCCFD; Sat, 1 Feb 2020 17:12:16 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890y73bvMz3Hvc; Sat, 1 Feb 2020 17:12:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 766FA229C; Sat, 1 Feb 2020 17:12:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011HCFKZ031642; Sat, 1 Feb 2020 17:12:15 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011HCFhG031641; Sat, 1 Feb 2020 17:12:15 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202002011712.011HCFhG031641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 1 Feb 2020 17:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357370 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 357370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:12:16 -0000 Author: mhorne Date: Sat Feb 1 17:12:15 2020 New Revision: 357370 URL: https://svnweb.freebsd.org/changeset/base/357370 Log: prci: fix up compat Add two additional compat strings that can be used to identify the PRCI. With newer device trees the PRCI has two parents, hfclk and rtcclk, so allow the driver to attach when more than one parent is found. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23405 Modified: head/sys/riscv/sifive/fu540_prci.c Modified: head/sys/riscv/sifive/fu540_prci.c ============================================================================== --- head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:09:56 2020 (r357369) +++ head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:12:15 2020 (r357370) @@ -52,6 +52,13 @@ __FBSDID("$FreeBSD$"); #include +static struct ofw_compat_data compat_data[] = { + { "sifive,aloeprci0", 1 }, + { "sifive,ux00prci0", 1 }, + { "sifive,fu540-c000-prci", 1 }, + { NULL, 0 }, +}; + static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END @@ -177,7 +184,7 @@ prci_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "sifive,aloeprci0")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "SiFive FU540 Power Reset Clocking Interrupt"); @@ -229,7 +236,7 @@ prci_attach(device_t dev) node = ofw_bus_get_node(dev); error = ofw_bus_parse_xref_list_get_length(node, "clocks", "#clock-cells", &ncells); - if (error != 0 || ncells != 1) { + if (error != 0 || ncells < 1) { device_printf(dev, "couldn't find parent clock\n"); goto fail; } From owner-svn-src-all@freebsd.org Sat Feb 1 17:13:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DBA11FCDE8; Sat, 1 Feb 2020 17:13:53 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4891010Vhwz3JLx; Sat, 1 Feb 2020 17:13:53 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C4DF22C0; Sat, 1 Feb 2020 17:13:53 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011HDqqc032463; Sat, 1 Feb 2020 17:13:52 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011HDq4I032462; Sat, 1 Feb 2020 17:13:52 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202002011713.011HDq4I032462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 1 Feb 2020 17:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357371 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 357371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:13:53 -0000 Author: mhorne Date: Sat Feb 1 17:13:52 2020 New Revision: 357371 URL: https://svnweb.freebsd.org/changeset/base/357371 Log: prci: register tlclk as a fixed clock The PRCI exports tlclk as a constant fixed divisor clock, defined as 1/2 of the coreclk frequency. In older FU540 device trees (such as the one provided by SiFive), tlclk is represented as its own entity, and is automatically registered as a fixed-divisor-clock. Unfortunately the upstream FU540 device tree (that we have in our tree) represents tlclk as an output of the PRCI block, and we must register it manually. At worst, users of the old device tree will end up with an unreferenced duplicate of tlclk. This fixes device attachment for the SiFive UART on newer device trees, since it references tlclk via the PRCI. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23406 Modified: head/sys/riscv/sifive/fu540_prci.c Modified: head/sys/riscv/sifive/fu540_prci.c ============================================================================== --- head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:12:15 2020 (r357370) +++ head/sys/riscv/sifive/fu540_prci.c Sat Feb 1 17:13:52 2020 (r357371) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -119,6 +120,17 @@ struct prci_pll_def pll_clks[] = { PLL(PRCI_CLK_GEMGXLPLL, "gemgxclk", PRCI_GEMGXLPLL_CFG0), }; +/* Fixed divisor clock TLCLK. */ +struct clk_fixed_def tlclk_def = { + .clkdef.id = PRCI_CLK_TLCLK, + .clkdef.name = "prci_tlclk", + .clkdef.parent_names = (const char *[]){"coreclk"}, + .clkdef.parent_cnt = 1, + .clkdef.flags = CLK_NODE_STATIC_STRINGS, + .mult = 1, + .div = 2, +}; + static int prci_clk_pll_init(struct clknode *clk, device_t dev) { @@ -270,6 +282,16 @@ prci_attach(device_t dev) clkdef.name = pll_clks[i].name; prci_pll_register(sc, &clkdef, pll_clks[i].reg); } + + /* + * Register the fixed clock "tlclk". + * + * If an older device tree is being used, tlclk may appear as its own + * entity in the device tree, under soc/tlclk. If this is the case it + * will be registered automatically by the fixed_clk driver, and the + * version we register here will be an unreferenced duplicate. + */ + clknode_fixed_register(sc->clkdom, &tlclk_def); error = clkdom_finit(sc->clkdom); if (error) From owner-svn-src-all@freebsd.org Sat Feb 1 17:30:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81FEA1FD665; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4891MV2tcKz3KHQ; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E39725CB; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011HUkHq039449; Sat, 1 Feb 2020 17:30:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011HUki6039448; Sat, 1 Feb 2020 17:30:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011730.011HUki6039448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 17:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357372 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:30:46 -0000 Author: cem Date: Sat Feb 1 17:30:45 2020 New Revision: 357372 URL: https://svnweb.freebsd.org/changeset/base/357372 Log: intel_hwpstate(4): Don't leak bound thread in error conditions I don't know why a Skylake CPU with the HWP feature bit present would trap on MSR reads of the HWP registers, but if this occurs, do not leave the attach thread bound. This could conceivably cause reported hangs, although I have no evidence that this is the cause. Reported by: ae@, Andreas Nilsson X-MFC-With: r357002 Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:13:52 2020 (r357371) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:30:45 2020 (r357372) @@ -343,12 +343,20 @@ set_autonomous_hwp(struct hwp_softc *sc) } ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &sc->req); - if (ret) - return (ret); + if (ret) { + device_printf(dev, + "Failed to read HWP request MSR for cpu%d (%d)\n", + pc->pc_cpuid, ret); + goto out; + } ret = rdmsr_safe(MSR_IA32_HWP_CAPABILITIES, &caps); - if (ret) - return (ret); + if (ret) { + device_printf(dev, + "Failed to read HWP capabilities MSR for cpu%d (%d)\n", + pc->pc_cpuid, ret); + goto out; + } sc->high = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); sc->guaranteed = IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(caps); @@ -372,7 +380,7 @@ set_autonomous_hwp(struct hwp_softc *sc) ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); if (ret) { device_printf(dev, - "Failed to setup autonomous HWP for cpu%d (file a bug)\n", + "Failed to setup autonomous HWP for cpu%d\n", pc->pc_cpuid); } From owner-svn-src-all@freebsd.org Sat Feb 1 17:48:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D1091FDC29 for ; Sat, 1 Feb 2020 17:48:27 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 4891lt5bqNz3L20 for ; Sat, 1 Feb 2020 17:48:26 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1580579305; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Yhn2WkVJ7eWTUpqoLKIMdfSu7IpUbn3f/r9dNV8RlTeKPg67DgEQDYvGTNMCNgN5xNMBOmearAU19 ma8ISSZL2W+5pDKx3l07zdq5uaXYy10wFLpHx0n+TtvLHbNo0rseUNLPQViYG7sB6gcfMouWaTNqbm fdu/Ow8S2KjjN8sd/oOQqJ0j1S5OVVUMvK7/iB5tONw7asAD54A5a+jybEQCCxEi9lZMuci9Fu2DnA 1L84xDsMIHdxFOw2TIrA3uk749DcWYf0ywyIwjdGVj0Xrek8gnXq6GUTss0Re/0YX9qbqWJc2pc0c0 N9zsN6vrdvmwIC3AEv0qmZCyul7kuoA== 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=SL4Mj5v9XpV85pI6m8BA5k5SAXZn2LctXtg4yoxNnRk=; b=ORsdQZuNQ0R5V79PDmbEnCUXdTe9+EtigwftsY+3glBYUZe01EFI2XveD1c4oSypFvUWzoGU0xw0O VIO+snm28jZHiezNOq5f+7ajGM781fShS449hnGaeO2g4rZQqlcRpW2/w1rolBgV85b3LK6F5GXno4 fh/4JxN18jVIUzJyyf/CMuieSYFLdD3EnRQVlsua/zllXSGhTsOFGHToob5g3xuVKFit+hrdMsCgB/ wWc7qx3UVX/eUNstTHFnBia+ESTt6/peuFqeRX9+K7n0ZRWqQnbjEV74S+wPft6eoF9bUFnyVqedt0 xSMXYpkIYlfrOxCFegrOkiS8SB8SiYw== ARC-Authentication-Results: i=1; outbound3.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=SL4Mj5v9XpV85pI6m8BA5k5SAXZn2LctXtg4yoxNnRk=; b=oSg/hXB3hDBOrP+7r1v9y3xi5DwHfu/uymfbm/xr4WcWtZw7i2bsUo76mLOXkmuLOgnrdgUVuj43o J3/RYq2MS9rY/PA5OhFPTu/DoIXm3duQLsuttmFZEqG18+nub8hmLIFPq1vC+184Je/sYXlaWbc7zo JHZ4PN+pkyK9nISsac0Q2Ql0tRzlVF3g4OGXeZCCekJfXJe3ZQN8EMAc6DokfXymWh6cJ2br1J7TR3 SzYjui3fWVkY+hGH3fj6hQwXs/smovzZV9BtaxOSAtnQ3e0uMZ9wC03FtL7tRcZdw/nIpli418cuek jR5T1PP6n9ylfCsPq4M3tFWvET2lqnw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 082d6bbb-451b-11ea-b80d-052b4a66b6b2 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 outbound3.ore.mailhop.org (Halon) with ESMTPSA id 082d6bbb-451b-11ea-b80d-052b4a66b6b2; Sat, 01 Feb 2020 17:48:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 011HmIXI029918; Sat, 1 Feb 2020 10:48:18 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm From: Ian Lepore To: Dimitry Andric , cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head Date: Sat, 01 Feb 2020 10:48:18 -0700 In-Reply-To: <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> References: <202001311936.00VJaEDP056807@repo.freebsd.org> <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4891lt5bqNz3L20 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.972,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-0.98)[-0.980,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:48:27 -0000 On Fri, 2020-01-31 at 23:36 +0100, Dimitry Andric wrote: > Hmm yes, you are quite right. Other parts of the code also seem to > use ~TPM_XXX, and the WR4() inline function called takes a > uint32_t. I'll revert my change and apply the tilde version instead! > > -Dimitry > So you're going to switch from writing 0 to writing 0xfffffffe, and just assume that will work the same? Like, without looking at the datasheet or TRM for the device? Surely those other 31 bits you're turning on in a control register can't do anything important, can they? I haven't looked at the code, but I'll bet the other places that are using ~SYMBOLNAME are doing so in the context of read-modify-write in a way that preserves existing bits, which is completely different than just turning on 31 bits as a side effect of turning one bit off. -- Ian > > On 31 Jan 2020, at 22:13, Conrad Meyer wrote: > > > > Hi Dimitry, > > > > Do you think maybe the intent is to use ~TPM_CRB_CTRL_CANCEL_CMD > > instead? Plain "0" might also make sense. But I think the > > compiler > > is right here and the warning should not be disabled !BIT(foo) > > doesn't really make sense for a register. It happens to affect the > > right bit only because CANCEL_CMD is BIT(0). > > > > Thanks, > > Conrad > > > > On Fri, Jan 31, 2020 at 11:36 AM Dimitry Andric > > wrote: > > > > > > Author: dim > > > Date: Fri Jan 31 19:36:14 2020 > > > New Revision: 357349 > > > URL: https://svnweb.freebsd.org/changeset/base/357349 > > > > > > Log: > > > Merge r357348 from the clang 10.0.0 import branch: > > > > > > Disable new clang 10.0.0 warnings about converting the result of > > > shift > > > operations to a boolean in tpm(4): > > > > > > sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of > > > '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,- > > > Wint-in-bool-context] > > > WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); > > > ^ > > > sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro > > > 'TPM_CRB_CTRL_CANCEL_CMD' > > > #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) > > > ^ > > > sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' > > > #define BIT(x) (1 << (x)) > > > ^ > > > > > > Such warnings can be useful in C++ contexts, but not so much in > > > kernel > > > drivers, where this type of bit twiddling is commonplace. So > > > disable it > > > for this case. > > > > > > MFC after: 3 days > > > > > > Modified: > > > head/sys/conf/files.amd64 > > > head/sys/conf/kern.mk > > > head/sys/modules/tpm/Makefile > > > Directory Properties: > > > head/ (props changed) > > > > > > Modified: head/sys/conf/files.amd64 > > > ================================================================= > > > ============= > > > --- head/sys/conf/files.amd64 Fri Jan 31 19:35:21 > > > 2020 (r357348) > > > +++ head/sys/conf/files.amd64 Fri Jan 31 19:36:14 > > > 2020 (r357349) > > > @@ -323,7 +323,8 @@ > > > dev/syscons/scvesactl.c optional sc vga vesa > > > dev/syscons/scvgarndr.c optional sc vga > > > dev/tpm/tpm.c optional tpm > > > dev/tpm/tpm20.c optional tpm > > > -dev/tpm/tpm_crb.c optional tpm acpi > > > +dev/tpm/tpm_crb.c optional tpm acpi \ > > > + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" > > > dev/tpm/tpm_tis.c optional tpm acpi > > > dev/tpm/tpm_acpi.c optional tpm acpi > > > dev/tpm/tpm_isa.c optional tpm isa > > > > > > Modified: head/sys/conf/kern.mk > > > ================================================================= > > > ============= > > > --- head/sys/conf/kern.mk Fri Jan 31 19:35:21 > > > 2020 (r357348) > > > +++ head/sys/conf/kern.mk Fri Jan 31 19:36:14 > > > 2020 (r357349) > > > @@ -37,6 +37,9 @@ CWARNEXTRA+= -Wno-error-shift-negative-value > > > .if ${COMPILER_VERSION} >= 40000 > > > CWARNEXTRA+= -Wno-address-of-packed-member > > > .endif > > > +.if ${COMPILER_VERSION} >= 100000 > > > +NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context > > > +.endif > > > .endif > > > > > > .if ${COMPILER_TYPE} == "gcc" > > > > > > Modified: head/sys/modules/tpm/Makefile > > > ================================================================= > > > ============= > > > --- head/sys/modules/tpm/Makefile Fri Jan 31 19:35:21 > > > 2020 (r357348) > > > +++ head/sys/modules/tpm/Makefile Fri Jan 31 19:36:14 > > > 2020 (r357349) > > > @@ -11,3 +11,5 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h > > > opt_acpi.h acpi_i > > > SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h > > > > > > .include > > > + > > > +CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT} > > From owner-svn-src-all@freebsd.org Sat Feb 1 17:54:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 649971FE041; Sat, 1 Feb 2020 17:54:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4891vC1kPlz3LXj; Sat, 1 Feb 2020 17:54:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36A8C2A44; Sat, 1 Feb 2020 17:54:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011Hslon056366; Sat, 1 Feb 2020 17:54:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011HslUK056365; Sat, 1 Feb 2020 17:54:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011754.011HslUK056365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 17:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357373 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:54:47 -0000 Author: cem Date: Sat Feb 1 17:54:46 2020 New Revision: 357373 URL: https://svnweb.freebsd.org/changeset/base/357373 Log: intel_hwpstate(4): Use identcpu-cached cpuid 6 leaf No functional change. Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:30:45 2020 (r357372) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:54:46 2020 (r357373) @@ -266,8 +266,6 @@ out: void intel_hwpstate_identify(driver_t *driver, device_t parent) { - uint32_t regs[4]; - if (device_find_child(parent, "hwpstate_intel", -1) != NULL) return; @@ -279,25 +277,12 @@ intel_hwpstate_identify(driver_t *driver, device_t par /* * Intel SDM 14.4.1 (HWP Programming Interfaces): - * The CPUID instruction allows software to discover the presence of - * HWP support in an Intel processor. Specifically, execute CPUID - * instruction with EAX=06H as input will return 5 bit flags covering - * the following aspects in bits 7 through 11 of CPUID.06H:EAX. - */ - - if (cpu_high < 6) - return; - - /* - * Intel SDM 14.4.1 (HWP Programming Interfaces): * Availability of HWP baseline resource and capability, * CPUID.06H:EAX[bit 7]: If this bit is set, HWP provides several new * architectural MSRs: IA32_PM_ENABLE, IA32_HWP_CAPABILITIES, * IA32_HWP_REQUEST, IA32_HWP_STATUS. */ - - do_cpuid(6, regs); - if ((regs[0] & CPUTPM1_HWP) == 0) + if ((cpu_power_eax & CPUTPM1_HWP) == 0) return; if (BUS_ADD_CHILD(parent, 10, "hwpstate_intel", -1) == NULL) @@ -396,20 +381,18 @@ static int intel_hwpstate_attach(device_t dev) { struct hwp_softc *sc; - uint32_t regs[4]; int ret; sc = device_get_softc(dev); sc->dev = dev; - do_cpuid(6, regs); - if (regs[0] & CPUTPM1_HWP_NOTIFICATION) + if (cpu_power_eax & CPUTPM1_HWP_NOTIFICATION) sc->hwp_notifications = true; - if (regs[0] & CPUTPM1_HWP_ACTIVITY_WINDOW) + if (cpu_power_eax & CPUTPM1_HWP_ACTIVITY_WINDOW) sc->hwp_activity_window = true; - if (regs[0] & CPUTPM1_HWP_PERF_PREF) + if (cpu_power_eax & CPUTPM1_HWP_PERF_PREF) sc->hwp_pref_ctrl = true; - if (regs[0] & CPUTPM1_HWP_PKG) + if (cpu_power_eax & CPUTPM1_HWP_PKG) sc->hwp_pkg_ctrl = true; ret = set_autonomous_hwp(sc); From owner-svn-src-all@freebsd.org Sat Feb 1 17:55:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C95E21FE0C8 for ; Sat, 1 Feb 2020 17:55:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 4891vw4Q1rz3LgY for ; Sat, 1 Feb 2020 17:55:24 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1580579723; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=vAuMdNHgG3UEoB2ED7fsmYwD+x2y2el6XGvTGu+F58Sd6wlx8jT69RkI+hxFsIyTm7NXo+ibsOBXF OC1nGgUEchsB0XK6xtQZnk/41d+R3n409fXYsKFA1QhVu947w8AiK1DE5/x4nLTZc2V64DCQAr1k8D Vtf2rf14JdI7O66MRpgSvC3lfaq3/cCW+EsY6aEADqyE6MhgcprTgrsxShf5eQsfdVuYiYUa7jyjlU MN61HFxVv/RtM7rTHTmqjO+k3ypRfpfzVNtOHT2XbS/MWbUeLcLoGfiBqEvYVVpF8mRSkFpI2drCpC tEqnn48qndQvGWGFoo74zdv38tvBsnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=ZapvYz5ZX8Yc1oggwsiu2knH3v9HUBqqhI7YG2cx08s=; b=fTz3E0vitPacqpim6mKJtdGw+zuHGvBWPXim7S5ee+n40KtjIWK83Qd8Ie/s5iTqa1QjqKpRFhTYJ xK5gF9xMnWtGeCnoXlglj+qEW+5BpOrIDpkG694GdSQdMOM1i6P++bVrBmQkrtv319wpy2Z0V679Ut XLJcfFGWgemTeZB2txNC4R5rpPRBEar3fKhWSVEKZ/M72qJhbJBfqjbozpl8V3JcZFm8S2yjHoKy87 9yTblGo4Gp933V1C0NeCVTv6dh1S+GvqmYHRFXT5JHi5qXFVJtIe+xzvkNvdqoqNZrCdjD5DK49gdT vU36ne4TNUCROBlt+EN9HW13dInZXYw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=ZapvYz5ZX8Yc1oggwsiu2knH3v9HUBqqhI7YG2cx08s=; b=Gs8jlaaYZUZfePSiM2F4AOooioQS15OrxXKU+ukhEJIReXq+KrpvmAkWADke0a34l7EpWBQNcZu4s ukD8Tsgr3OdNZDgACk/hLPLDZjMqImXuul3YDJ/bCtMQGFQZoYNOENcjUZBq/hMDOOVUggCMMhHrjf AzmUGu3kgelV5Tjl1e+vPTbPL2ZVRYIJk2SGvC193+Q9RTlGxzMt9dZ2chCIBJYas7EvUZt+tZSGGt tlRiAkWFp6Jyv2oR7j2RQ9QNxQs148N+ae9r+5nlpbBEtAFnkhdTtJZJxYx+S2OQ6qpsh30YWrdbEB te9GD8l4XnsRcwHYr1wdjklCXleGRJw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 01e02ec1-451c-11ea-b80d-052b4a66b6b2 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 outbound3.ore.mailhop.org (Halon) with ESMTPSA id 01e02ec1-451c-11ea-b80d-052b4a66b6b2; Sat, 01 Feb 2020 17:55:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 011HtHZu029965; Sat, 1 Feb 2020 10:55:17 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm From: Ian Lepore To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 01 Feb 2020 10:55:17 -0700 In-Reply-To: <202001311936.00VJaEDP056807@repo.freebsd.org> References: <202001311936.00VJaEDP056807@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4891vw4Q1rz3LgY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-0.98)[-0.982,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:55:24 -0000 On Fri, 2020-01-31 at 19:36 +0000, Dimitry Andric wrote: > Author: dim > Date: Fri Jan 31 19:36:14 2020 > New Revision: 357349 > URL: https://svnweb.freebsd.org/changeset/base/357349 > > Log: > Merge r357348 from the clang 10.0.0 import branch: > > Disable new clang 10.0.0 warnings about converting the result of shift > operations to a boolean in tpm(4): > > sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] > WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); > ^ > sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' > #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) > ^ > sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' > #define BIT(x) (1 << (x)) > ^ > > Such warnings can be useful in C++ contexts, but not so much in kernel > drivers, where this type of bit twiddling is commonplace. So disable it > for this case. > I think the point of the compiler warning about shift in a boolean context is the same as warning about assignment in a boolean context. I.e, if (a << 3) might be a typo for if (a < 3) in the same way as "a = 3" might have been intended to be "a == 3". When this type of bit twiddling is used in drivers, it's almost always combined with an & or | operator, which I assume the compiler then won't complain about (or you would have seen thousands of warnings while compiling in dev/*). -- Ian From owner-svn-src-all@freebsd.org Sat Feb 1 18:10:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD1E31FE5B1; Sat, 1 Feb 2020 18:10:05 +0000 (UTC) (envelope-from dim@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 4892Ds51zmz3M8t; Sat, 1 Feb 2020 18:10:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 8C2889968; Sat, 1 Feb 2020 18:10:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::48be:cb08:157f:a7ed] (unknown [IPv6:2001:470:7a58:0:48be:cb08:157f:a7ed]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6AC6B3B4FE; Sat, 1 Feb 2020 19:10:03 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_3B7BCF2F-AE68-4E1C-B3D3-5C6CAAF476E5"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm Date: Sat, 1 Feb 2020 19:09:57 +0100 In-Reply-To: <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head To: Ian Lepore References: <202001311936.00VJaEDP056807@repo.freebsd.org> <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 18:10:05 -0000 --Apple-Mail=_3B7BCF2F-AE68-4E1C-B3D3-5C6CAAF476E5 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 1 Feb 2020, at 18:48, Ian Lepore wrote: > > On Fri, 2020-01-31 at 23:36 +0100, Dimitry Andric wrote: >> Hmm yes, you are quite right. Other parts of the code also seem to >> use ~TPM_XXX, and the WR4() inline function called takes a >> uint32_t. I'll revert my change and apply the tilde version instead! >> >> -Dimitry >> > > So you're going to switch from writing 0 to writing 0xfffffffe, and > just assume that will work the same? Like, without looking at the > datasheet or TRM for the device? Surely those other 31 bits you're > turning on in a control register can't do anything important, can they? Hmm, the data sheet says: Writes (0000 0001h): Cancel a command Writes (0000 0000h): Clears field when command has been cancelled It seems the other bits in the register are not used for anything. So indeed it is probably better to explicitly define these values as 0x0 and 0x1, and not use ~ or ! operators at all. > I haven't looked at the code, but I'll bet the other places that are > using ~SYMBOLNAME are doing so in the context of read-modify-write in a > way that preserves existing bits, which is completely different than > just turning on 31 bits as a side effect of turning one bit off. There aren't many places, but they tend to use the AND4() and OR4() inline functions, which do are more usual pattern of read-modify-write. I'll fix up the code again... -Dimitry --Apple-Mail=_3B7BCF2F-AE68-4E1C-B3D3-5C6CAAF476E5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXjW+9QAKCRCwXqMKLiCW o8vlAKChYDR3Dv3pXGQLV0y1fzQB46+sewCguyLETIVjFjfRdpwcrXU2NeyTAMg= =Zhhq -----END PGP SIGNATURE----- --Apple-Mail=_3B7BCF2F-AE68-4E1C-B3D3-5C6CAAF476E5-- From owner-svn-src-all@freebsd.org Sat Feb 1 18:17:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15AB91FECA5; Sat, 1 Feb 2020 18:17:09 +0000 (UTC) (envelope-from dim@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 4892P06tTTz3Mqq; Sat, 1 Feb 2020 18:17:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id CBB8E9A8F; Sat, 1 Feb 2020 18:17:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::48be:cb08:157f:a7ed] (unknown [IPv6:2001:470:7a58:0:48be:cb08:157f:a7ed]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A69B63B4FF; Sat, 1 Feb 2020 19:17:07 +0100 (CET) From: Dimitry Andric Message-Id: <5146F5D0-6E0A-415D-8C14-AE8C5CD05CAA@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_3CBCF93B-B87C-4C73-A1B5-FE1A183EB6B4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm Date: Sat, 1 Feb 2020 19:17:07 +0100 In-Reply-To: Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <202001311936.00VJaEDP056807@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 18:17:09 -0000 --Apple-Mail=_3CBCF93B-B87C-4C73-A1B5-FE1A183EB6B4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 Feb 2020, at 18:55, Ian Lepore wrote: >=20 > On Fri, 2020-01-31 at 19:36 +0000, Dimitry Andric wrote: >> Author: dim >> Date: Fri Jan 31 19:36:14 2020 >> New Revision: 357349 >> URL: https://svnweb.freebsd.org/changeset/base/357349 >>=20 >> Log: >> Merge r357348 from the clang 10.0.0 import branch: >>=20 >> Disable new clang 10.0.0 warnings about converting the result of = shift >> operations to a boolean in tpm(4): >>=20 >> sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' = to a boolean; did you mean '(1 << (0)) !=3D 0'? = [-Werror,-Wint-in-bool-context] >> WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); >> ^ >> sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro = 'TPM_CRB_CTRL_CANCEL_CMD' >> #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) >> ^ >> sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' >> #define BIT(x) (1 << (x)) >> ^ >>=20 >> Such warnings can be useful in C++ contexts, but not so much in = kernel >> drivers, where this type of bit twiddling is commonplace. So = disable it >> for this case. >>=20 >=20 > I think the point of the compiler warning about shift in a boolean > context is the same as warning about assignment in a boolean > context. I.e, >=20 > if (a << 3) >=20 > might be a typo for >=20 > if (a < 3) >=20 > in the same way as "a =3D 3" might have been intended to be "a =3D=3D = 3". Yes, clang inherited this warning from gcc, where it says in: = https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-in-bool= -context -Wint-in-bool-context Warn for suspicious use of integer values where boolean values are expected, such as conditional expressions (?:) using non-boolean integer constants in boolean context, like if (a <=3D b ? 2 : 3). Or left shifting of signed integers in boolean context, like for (a =3D = 0; 1 << a; a++);. Likewise for all kinds of multiplications regardless of the data type. This warning is enabled by -Wall. -Dimitry --Apple-Mail=_3CBCF93B-B87C-4C73-A1B5-FE1A183EB6B4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXjXAowAKCRCwXqMKLiCW o7GMAKDVh6PO3SpDC9sf6fOWLj7s9Gcd5ACg0EkRgDA8CXvK9NijozxV82TFMO4= =WC// -----END PGP SIGNATURE----- --Apple-Mail=_3CBCF93B-B87C-4C73-A1B5-FE1A183EB6B4-- From owner-svn-src-all@freebsd.org Sat Feb 1 18:23:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB28D1FF087; Sat, 1 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4892Xl54XHz3NGb; Sat, 1 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A974D2FCC; Sat, 1 Feb 2020 18:23:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011INpcj074270; Sat, 1 Feb 2020 18:23:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011INpJo074268; Sat, 1 Feb 2020 18:23:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002011823.011INpJo074268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 1 Feb 2020 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357374 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 18:23:51 -0000 Author: markj Date: Sat Feb 1 18:23:51 2020 New Revision: 357374 URL: https://svnweb.freebsd.org/changeset/base/357374 Log: Remove a couple of lingering usages of the page lock. Update vm_page_scan_contig() and vm_page_reclaim_run() to stop using vm_page_change_lock(). It has no use after r356157. Remove vm_page_change_lock() now that it has no users. Remove an unncessary check for wirings in vm_page_scan_contig(), which was previously checking twice. The check is racy until vm_page_reclaim_run() ensures that the page is unmapped, so one check is sufficient. Reviewed by: jeff, kib (previous versions) Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D23279 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Feb 1 17:54:46 2020 (r357373) +++ head/sys/vm/vm_page.c Sat Feb 1 18:23:51 2020 (r357374) @@ -1156,23 +1156,6 @@ vm_page_xunbusy_hard_unchecked(vm_page_t m) } /* - * Avoid releasing and reacquiring the same page lock. - */ -void -vm_page_change_lock(vm_page_t m, struct mtx **mtx) -{ - struct mtx *mtx1; - - mtx1 = vm_page_lockptr(m); - if (*mtx == mtx1) - return; - if (*mtx != NULL) - mtx_unlock(*mtx); - *mtx = mtx1; - mtx_lock(mtx1); -} - -/* * vm_page_unhold_pages: * * Unhold each of the pages that is referenced by the given array. @@ -2444,7 +2427,6 @@ vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options) { - struct mtx *m_mtx; vm_object_t object; vm_paddr_t pa; vm_page_t m, m_run; @@ -2458,7 +2440,6 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, KASSERT(powerof2(boundary), ("boundary is not a power of 2")); m_run = NULL; run_len = 0; - m_mtx = NULL; for (m = m_start; m < m_end && run_len < npages; m += m_inc) { KASSERT((m->flags & PG_MARKER) == 0, ("page %p is PG_MARKER", m)); @@ -2489,9 +2470,8 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, } else KASSERT(m_run != NULL, ("m_run == NULL")); - vm_page_change_lock(m, &m_mtx); - m_inc = 1; retry: + m_inc = 1; if (vm_page_wired(m)) run_ext = 0; #if VM_NRESERVLEVEL > 0 @@ -2504,23 +2484,17 @@ retry: pa); } #endif - else if ((object = m->object) != NULL) { + else if ((object = + (vm_object_t)atomic_load_ptr(&m->object)) != NULL) { /* * The page is considered eligible for relocation if * and only if it could be laundered or reclaimed by * the page daemon. */ - if (!VM_OBJECT_TRYRLOCK(object)) { - mtx_unlock(m_mtx); - VM_OBJECT_RLOCK(object); - mtx_lock(m_mtx); - if (m->object != object) { - /* - * The page may have been freed. - */ - VM_OBJECT_RUNLOCK(object); - goto retry; - } + VM_OBJECT_RLOCK(object); + if (object != m->object) { + VM_OBJECT_RUNLOCK(object); + goto retry; } /* Don't care: PG_NODUMP, PG_ZERO. */ if (object->type != OBJT_DEFAULT && @@ -2537,8 +2511,7 @@ retry: vm_reserv_size(level)) - pa); #endif } else if (object->memattr == VM_MEMATTR_DEFAULT && - vm_page_queue(m) != PQ_NONE && !vm_page_busied(m) && - !vm_page_wired(m)) { + vm_page_queue(m) != PQ_NONE && !vm_page_busied(m)) { /* * The page is allocated but eligible for * relocation. Extend the current run by one @@ -2605,8 +2578,6 @@ retry: } } } - if (m_mtx != NULL) - mtx_unlock(m_mtx); if (run_len >= npages) return (m_run); return (NULL); @@ -2634,7 +2605,6 @@ vm_page_reclaim_run(int req_class, int domain, u_long vm_paddr_t high) { struct vm_domain *vmd; - struct mtx *m_mtx; struct spglist free; vm_object_t object; vm_paddr_t pa; @@ -2647,42 +2617,28 @@ vm_page_reclaim_run(int req_class, int domain, u_long error = 0; m = m_run; m_end = m_run + npages; - m_mtx = NULL; for (; error == 0 && m < m_end; m++) { KASSERT((m->flags & (PG_FICTITIOUS | PG_MARKER)) == 0, ("page %p is PG_FICTITIOUS or PG_MARKER", m)); /* - * Avoid releasing and reacquiring the same page lock. + * Racily check for wirings. Races are handled once the object + * lock is held and the page is unmapped. */ - vm_page_change_lock(m, &m_mtx); -retry: - /* - * Racily check for wirings. Races are handled below. - */ if (vm_page_wired(m)) error = EBUSY; - else if ((object = m->object) != NULL) { + else if ((object = + (vm_object_t)atomic_load_ptr(&m->object)) != NULL) { /* * The page is relocated if and only if it could be * laundered or reclaimed by the page daemon. */ - if (!VM_OBJECT_TRYWLOCK(object)) { - mtx_unlock(m_mtx); - VM_OBJECT_WLOCK(object); - mtx_lock(m_mtx); - if (m->object != object) { - /* - * The page may have been freed. - */ - VM_OBJECT_WUNLOCK(object); - goto retry; - } - } + VM_OBJECT_WLOCK(object); /* Don't care: PG_NODUMP, PG_ZERO. */ - if (object->type != OBJT_DEFAULT && + if (m->object != object || + (object->type != OBJT_DEFAULT && object->type != OBJT_SWAP && - object->type != OBJT_VNODE) + object->type != OBJT_VNODE)) error = EINVAL; else if (object->memattr != VM_MEMATTR_DEFAULT) error = EINVAL; @@ -2781,7 +2737,6 @@ retry: * The new page must be deactivated * before the object is unlocked. */ - vm_page_change_lock(m_new, &m_mtx); vm_page_deactivate(m_new); } else { m->flags &= ~PG_ZERO; @@ -2821,8 +2776,6 @@ unlock: error = EINVAL; } } - if (m_mtx != NULL) - mtx_unlock(m_mtx); if ((m = SLIST_FIRST(&free)) != NULL) { int cnt; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Feb 1 17:54:46 2020 (r357373) +++ head/sys/vm/vm_page.h Sat Feb 1 18:23:51 2020 (r357374) @@ -609,7 +609,6 @@ vm_page_t vm_page_alloc_freelist(int, int); vm_page_t vm_page_alloc_freelist_domain(int, int, int); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); -void vm_page_change_lock(vm_page_t m, struct mtx **mtx); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count); From owner-svn-src-all@freebsd.org Sat Feb 1 19:21:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DF312288BC; Sat, 1 Feb 2020 19:21:07 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f65.google.com (mail-yw1-f65.google.com [209.85.161.65]) (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 4893pp0W5Pz3Qvk; Sat, 1 Feb 2020 19:21:05 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f65.google.com with SMTP id n184so8773342ywc.3; Sat, 01 Feb 2020 11:21:05 -0800 (PST) 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=R0C+x+YGIUekWTQTKAjJuCjfbokknIkDbzZ5nTsqRF0=; b=JOoEB1EtWC9/H/XLxqXpfq5ye3FjCqetHdZCWDOobOXzfXhMfHuT4+UazPNOaPIXsT 55XpXW/7UwHH7P6aNURtcgxYoCL0XaQHS6FoZXERXZgnDOld9dJJiUFt3MjsNMf0EXaN Ysz7okzNBfOZasYR/j7EpqUE2J+slSdvlZhcntH4fQXGjbh+RqNKhyFVHMPgW03twTit IGukg1uyjnGTFAey9eZvLaeW7CXAb5JXchkVAJeEBlUhvF/0ZHw8/6YLuTzZrWLkSSse 0NON1SkKVrJ33KAkIZ7CR4qduB6f+FplH/I/cy2YWXF5SmZcR+/9PzlPt94JLwOqLbov wPBQ== X-Gm-Message-State: APjAAAWLEK/QJ8vfR+36FKsmemqDFAR52czS9c1EmsDorsdQG6jOaBic GnKQRXIGbdzpy/Y/Ytd56+3wIwPTefTsfUhoYL46Ze+R X-Google-Smtp-Source: APXvYqymqYUpVR3A7XbxndYYfEumTJcBOtw8l42P01lU/y7fS9IXxrDUC9YE2dotUZaMorF7ZWkgQAeZvTtr1xdf1pE= X-Received: by 2002:a0d:c3c2:: with SMTP id f185mr12108354ywd.21.1580584864637; Sat, 01 Feb 2020 11:21:04 -0800 (PST) MIME-Version: 1.0 References: <202001310049.00V0np1a077223@repo.freebsd.org> In-Reply-To: <202001310049.00V0np1a077223@repo.freebsd.org> From: Li-Wen Hsu Date: Sun, 2 Feb 2020 03:20:53 +0800 Message-ID: Subject: Re: svn commit: r357314 - in head/sys: conf kern sys vm To: Jeff Roberson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4893pp0W5Pz3Qvk X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.161.65 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.06 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@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]; RWL_MAILSPIKE_GOOD(0.00)[65.161.85.209.rep.mailspike.net : 127.0.0.18]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-1.06)[ip: (-0.44), ipnet: 209.85.128.0/17(-3.04), asn: 15169(-1.76), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[65.161.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@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)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:21:07 -0000 On Fri, Jan 31, 2020 at 8:50 AM Jeff Roberson wrote: > > Author: jeff > Date: Fri Jan 31 00:49:51 2020 > New Revision: 357314 > URL: https://svnweb.freebsd.org/changeset/base/357314 > > Log: > Implement a safe memory reclamation feature that is tightly coupled with UMA. > > This is in the same family of algorithms as Epoch/QSBR/RCU/PARSEC but is > a unique algorithm. This has 3x the performance of epoch in a write heavy > workload with less than half of the read side cost. The memory overhead > is significantly lessened by limiting the free-to-use latency. A synthetic > test uses 1/20th of the memory vs Epoch. There is significant further > discussion in the comments and code review. > > This code should be considered experimental. I will write a man page after > it has settled. After further validation the VM will begin using this > feature to permit lockless page lookups. > > Both markj and cperciva tested on arm64 at large core counts to verify > fences on weaker ordering architectures. I will commit a stress testing > tool in a follow-up. > > Reviewed by: mmacy, markj, rlibby, hselasky > Discussed with: sbahara > Differential Revision: https://reviews.freebsd.org/D22586 I found it might cause i386 boot fail: Kernel page fault with the following non-sleepable locks held: exclusive sleep mutex kernel arena (kernel arena) r = 0 (0x1d99d80) locked @ /usr/src/sys/kern/subr_vmem.c:1344 Full backtrace is available at https://ci.freebsd.org/job/FreeBSD-head-i386-test/8275/console Please help checking this. Thanks, Li-Wen From owner-svn-src-all@freebsd.org Sat Feb 1 19:27:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A7882290B0; Sat, 1 Feb 2020 19:27:06 +0000 (UTC) (envelope-from kp@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 4893xk33lVz3wqH; Sat, 1 Feb 2020 19:27:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 35F0CA2D7; Sat, 1 Feb 2020 19:27:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.183.1] (unknown [38.98.37.137]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id D2B199168; Sat, 1 Feb 2020 20:26:58 +0100 (CET) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: "Ilja Van Sprundel" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357233 - head/sys/net Date: Sat, 01 Feb 2020 19:26:48 +0000 X-Mailer: MailMate (1.13.1r5671) Message-ID: <3F7A5204-4437-4845-8E40-0BC5D1CD0A5B@FreeBSD.org> In-Reply-To: <20200130163455.GH1268@FreeBSD.org> References: <202001282244.00SMiPrb077446@repo.freebsd.org> <20200130163455.GH1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:27:06 -0000 On 30 Jan 2020, at 16:34, Gleb Smirnoff wrote: > On Tue, Jan 28, 2020 at 10:44:25PM +0000, Kristof Provost wrote: > K> Author: kp > K> Date: Tue Jan 28 22:44:24 2020 > K> New Revision: 357233 > K> URL: https://svnweb.freebsd.org/changeset/base/357233 > K> > K> Log: > K> epair: Do not abuse params to register the second interface > K> > K> if_epair used the 'params' argument to pass a pointer to the b > interface > K> through if_clone_create(). > K> This pointer can be controlled by userspace, which means it could > be abused to > K> trigger a panic. While this requires PRIV_NET_IFCREATE > K> privileges those are assigned to vnet jails, which means that > vnet jails > K> could panic the system. > K> > K> Reported by: Ilja Van Sprundel > ... > K> Modified: head/sys/net/if_clone.h > K> > ============================================================================== > K> --- head/sys/net/if_clone.h Tue Jan 28 21:46:59 2020 (r357232) > K> +++ head/sys/net/if_clone.h Tue Jan 28 22:44:24 2020 (r357233) > K> @@ -79,7 +79,8 @@ int if_clone_list(struct if_clonereq *); > K> struct if_clone *if_clone_findifc(struct ifnet *); > K> void if_clone_addgroup(struct ifnet *, struct if_clone *); > K> > K> -/* The below interface used only by epair(4). */ > K> +/* The below interfaces are used only by epair(4). */ > K> +void if_clone_addif(struct if_clone *, struct ifnet *); > K> int if_clone_destroyif(struct if_clone *, struct ifnet *); > > IMHO, makes sense to move all these declaration into if_epair.c > itself. > Yeah, that does make sense. One minor issue is that it turns out that if_clone_destroyif() isn’t just used by if_epair, but also by the wifi code. How does this look? diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index acc392ead16..452605b0464 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -106,6 +106,9 @@ static int ifc_simple_match(struct if_clone *, const char *); static int ifc_simple_create(struct if_clone *, char *, size_t, caddr_t); static int ifc_simple_destroy(struct if_clone *, struct ifnet *); +/* The below interface is used only by epair(4). */ +void if_clone_addif(struct if_clone *, struct ifnet *); + static struct mtx if_cloners_mtx; MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF); VNET_DEFINE_STATIC(int, if_cloners_count); diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index ed7d6f4d02d..c1ddf89c72d 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -79,8 +79,7 @@ int if_clone_list(struct if_clonereq *); struct if_clone *if_clone_findifc(struct ifnet *); void if_clone_addgroup(struct ifnet *, struct if_clone *); -/* The below interfaces are used only by epair(4). */ -void if_clone_addif(struct if_clone *, struct ifnet *); +/* The below interface is used only by epair(4) and ieee80211. */ int if_clone_destroyif(struct if_clone *, struct ifnet *); #endif /* _KERNEL */ diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 376bdbe9117..7eff03b840f 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -94,6 +94,9 @@ SYSCTL_INT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, #define DPRINTF(fmt, arg...) #endif +/* if_clone private function, just for us. */ +extern void if_clone_addif(struct if_clone *, struct ifnet *); + static void epair_nh_sintr(struct mbuf *); static struct mbuf *epair_nh_m2cpuid(struct mbuf *, uintptr_t, u_int *); static void epair_nh_drainedcpu(u_int); Best regards, Kristof From owner-svn-src-all@freebsd.org Sat Feb 1 19:40:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8F6D229577; Sat, 1 Feb 2020 19:40:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894Dr3sl2z3xQl; Sat, 1 Feb 2020 19:40:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8001C3F1A; Sat, 1 Feb 2020 19:40:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011JeCZr015959; Sat, 1 Feb 2020 19:40:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011JeCm1015958; Sat, 1 Feb 2020 19:40:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202002011940.011JeCm1015958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Feb 2020 19:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357375 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 357375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:40:12 -0000 Author: kp Date: Sat Feb 1 19:40:11 2020 New Revision: 357375 URL: https://svnweb.freebsd.org/changeset/base/357375 Log: tests: epair: Don't fail if we load if_epair kldload() returns a positive integer when it loads a ko, so check that the return value is -1 to detect error cases, not that it's different from zero. MFC after: 3 days X-MFC-With: r357234 Modified: head/tests/sys/net/if_epair.c Modified: head/tests/sys/net/if_epair.c ============================================================================== --- head/tests/sys/net/if_epair.c Sat Feb 1 18:23:51 2020 (r357374) +++ head/tests/sys/net/if_epair.c Sat Feb 1 19:40:11 2020 (r357375) @@ -53,7 +53,7 @@ ATF_TC_BODY(params, tc) int s; s = kldload("if_epair"); - if (s != 0 && errno != EEXIST) + if (s == -1 && errno != EEXIST) atf_tc_fail("Failed to load if_epair"); s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-all@freebsd.org Sat Feb 1 19:45:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6268F2298FD; Sat, 1 Feb 2020 19:45:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894Lw1zz2z3xvS; Sat, 1 Feb 2020 19:45:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F95E4113; Sat, 1 Feb 2020 19:45:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011JjSAh021399; Sat, 1 Feb 2020 19:45:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011JjSBY021398; Sat, 1 Feb 2020 19:45:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011945.011JjSBY021398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 19:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357376 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:45:28 -0000 Author: cem Date: Sat Feb 1 19:45:27 2020 New Revision: 357376 URL: https://svnweb.freebsd.org/changeset/base/357376 Log: hwpstate_intel(4): Error check epp sysctl & bail if HW does not support feature Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:40:11 2020 (r357375) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:45:27 2020 (r357376) @@ -218,6 +218,7 @@ raw_to_percent(int x) static int sysctl_epp_select(SYSCTL_HANDLER_ARGS) { + struct hwp_softc *sc; device_t dev; struct pcpu *pc; uint64_t requested; @@ -225,6 +226,10 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) int ret; dev = oidp->oid_arg1; + sc = device_get_softc(dev); + if (!sc->hwp_pref_ctrl) + return (ENODEV); + pc = cpu_get_pcpu(dev); if (pc == NULL) return (ENXIO); @@ -233,7 +238,9 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) sched_bind(curthread, pc->pc_cpuid); thread_unlock(curthread); - rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); + ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); + if (ret) + goto out; val = (requested & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; val = raw_to_percent(val); @@ -253,7 +260,7 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) requested &= ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE; requested |= val << 24; - wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); out: thread_lock(curthread); From owner-svn-src-all@freebsd.org Sat Feb 1 19:46:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFDF922997E; Sat, 1 Feb 2020 19:46:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894Mb4C8Cz3y3r; Sat, 1 Feb 2020 19:46:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 722354117; Sat, 1 Feb 2020 19:46:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011Jk36g021468; Sat, 1 Feb 2020 19:46:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011Jk2lB021466; Sat, 1 Feb 2020 19:46:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011946.011Jk2lB021466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 19:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357377 - in head/sys/x86: cpufreq include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: cpufreq include x86 X-SVN-Commit-Revision: 357377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:46:03 -0000 Author: cem Date: Sat Feb 1 19:46:02 2020 New Revision: 357377 URL: https://svnweb.freebsd.org/changeset/base/357377 Log: x86: Add/amend some power-management comments/macros No functional change. Modified: head/sys/x86/cpufreq/hwpstate_intel.c head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:45:27 2020 (r357376) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:46:02 2020 (r357377) @@ -329,6 +329,14 @@ set_autonomous_hwp(struct hwp_softc *sc) /* XXX: Many MSRs aren't readable until feature is enabled */ ret = wrmsr_safe(MSR_IA32_PM_ENABLE, 1); if (ret) { + /* + * This is actually a package-level MSR, and only the first + * write is not ignored. So it is harmless to enable it across + * all devices, and this allows us not to care especially in + * which order cores (and packages) are probed. This error + * condition should not happen given we gate on the HWP CPUID + * feature flag, if the Intel SDM is correct. + */ device_printf(dev, "Failed to enable HWP for cpu%d (%d)\n", pc->pc_cpuid, ret); goto out; @@ -350,6 +358,10 @@ set_autonomous_hwp(struct hwp_softc *sc) goto out; } + /* + * High and low are static; "guaranteed" is dynamic; and efficient is + * also dynamic. + */ sc->high = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); sc->guaranteed = IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(caps); sc->efficient = IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(caps); Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Feb 1 19:45:27 2020 (r357376) +++ head/sys/x86/include/specialreg.h Sat Feb 1 19:46:02 2020 (r357377) @@ -566,6 +566,7 @@ #define MSR_IA32_TEMPERATURE_TARGET 0x1a2 #define MSR_TURBO_RATIO_LIMIT 0x1ad #define MSR_TURBO_RATIO_LIMIT1 0x1ae +#define MSR_IA32_ENERGY_PERF_BIAS 0x1b0 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Feb 1 19:45:27 2020 (r357376) +++ head/sys/x86/x86/identcpu.c Sat Feb 1 19:46:02 2020 (r357377) @@ -119,9 +119,9 @@ u_int cpu_mon_min_size; /* MONITOR minimum range size, u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cpu_maxphyaddr; /* Max phys addr width in bits */ u_int cpu_power_eax; /* 06H: Power management leaf, %eax */ -u_int cpu_power_ebx; /* 06H: Power management leaf, %eax */ -u_int cpu_power_ecx; /* 06H: Power management leaf, %eax */ -u_int cpu_power_edx; /* 06H: Power management leaf, %eax */ +u_int cpu_power_ebx; /* 06H: Power management leaf, %ebx */ +u_int cpu_power_ecx; /* 06H: Power management leaf, %ecx */ +u_int cpu_power_edx; /* 06H: Power management leaf, %edx */ char machine[] = MACHINE; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, From owner-svn-src-all@freebsd.org Sat Feb 1 19:49:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E40D0229A58; Sat, 1 Feb 2020 19:49:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894RF5dBjz3yDG; Sat, 1 Feb 2020 19:49:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EEA411C; Sat, 1 Feb 2020 19:49:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011JnDII021648; Sat, 1 Feb 2020 19:49:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011JnDGE021647; Sat, 1 Feb 2020 19:49:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011949.011JnDGE021647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 19:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357378 - in head/sys/x86: cpufreq include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: cpufreq include X-SVN-Commit-Revision: 357378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:49:14 -0000 Author: cem Date: Sat Feb 1 19:49:13 2020 New Revision: 357378 URL: https://svnweb.freebsd.org/changeset/base/357378 Log: hwpstate_intel(4): Add fallback EPP using PERF_BIAS MSR Per Intel SDM (Vol 3b Part 2), if HWP indicates EPP (energy-performance preference) is not supported, the hardware instead uses the ENERGY_PERF_BIAS MSR. In the epp sysctl handler, fall back to that MSR if HWP does not support EPP and CPUID indicates the ENERGY_PERF_BIAS MSR is supported. Modified: head/sys/x86/cpufreq/hwpstate_intel.c head/sys/x86/include/specialreg.h Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:46:02 2020 (r357377) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:49:13 2020 (r357378) @@ -88,6 +88,7 @@ struct hwp_softc { bool hwp_activity_window; bool hwp_pref_ctrl; bool hwp_pkg_ctrl; + bool hwp_perf_bias; uint64_t req; /* Cached copy of last request */ @@ -215,6 +216,26 @@ raw_to_percent(int x) return (round10(x * 1000 / 0xff)); } +/* Range of MSR_IA32_ENERGY_PERF_BIAS is more limited: 0-0xf. */ +static inline int +percent_to_raw_perf_bias(int x) +{ + /* + * Round up so that raw values present as nice round human numbers and + * also round-trip to the same raw value. + */ + MPASS(x <= 100 && x >= 0); + return (((0xf * x) + 50) / 100); +} + +static inline int +raw_to_percent_perf_bias(int x) +{ + /* Rounding to nice human numbers despite a step interval of 6.67%. */ + MPASS(x <= 0xf && x >= 0); + return (((x * 20) / 0xf) * 5); +} + static int sysctl_epp_select(SYSCTL_HANDLER_ARGS) { @@ -227,7 +248,7 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) dev = oidp->oid_arg1; sc = device_get_softc(dev); - if (!sc->hwp_pref_ctrl) + if (!sc->hwp_pref_ctrl && !sc->hwp_perf_bias) return (ENODEV); pc = cpu_get_pcpu(dev); @@ -238,11 +259,24 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) sched_bind(curthread, pc->pc_cpuid); thread_unlock(curthread); - ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); - if (ret) - goto out; - val = (requested & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; - val = raw_to_percent(val); + if (sc->hwp_pref_ctrl) { + ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); + if (ret) + goto out; + val = (requested & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; + val = raw_to_percent(val); + } else { + /* + * If cpuid indicates EPP is not supported, the HWP controller + * uses MSR_IA32_ENERGY_PERF_BIAS instead (Intel SDM §14.4.4). + * This register is per-core (but not HT). + */ + ret = rdmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, &requested); + if (ret) + goto out; + val = requested & IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK; + val = raw_to_percent_perf_bias(val); + } MPASS(val >= 0 && val <= 100); @@ -255,12 +289,18 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) goto out; } - val = percent_to_raw(val); + if (sc->hwp_pref_ctrl) { + val = percent_to_raw(val); - requested &= ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE; - requested |= val << 24; + requested &= ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE; + requested |= val << 24; - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); + } else { + requested = percent_to_raw_perf_bias(val); + MPASS((requested & ~IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK) == 0); + ret = wrmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, requested); + } out: thread_lock(curthread); @@ -405,6 +445,7 @@ intel_hwpstate_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + /* eax */ if (cpu_power_eax & CPUTPM1_HWP_NOTIFICATION) sc->hwp_notifications = true; if (cpu_power_eax & CPUTPM1_HWP_ACTIVITY_WINDOW) @@ -413,6 +454,10 @@ intel_hwpstate_attach(device_t dev) sc->hwp_pref_ctrl = true; if (cpu_power_eax & CPUTPM1_HWP_PKG) sc->hwp_pkg_ctrl = true; + + /* ecx */ + if (cpu_power_ecx & CPUID_PERF_BIAS) + sc->hwp_perf_bias = true; ret = set_autonomous_hwp(sc); if (ret) Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Feb 1 19:46:02 2020 (r357377) +++ head/sys/x86/include/specialreg.h Sat Feb 1 19:49:13 2020 (r357378) @@ -812,6 +812,9 @@ #define IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE (0xffULL << 8) #define IA32_HWP_MINIMUM_PERFORMANCE (0xffULL << 0) +/* MSR IA32_ENERGY_PERF_BIAS */ +#define IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK (0xfULL << 0) + /* * PAT modes. */ From owner-svn-src-all@freebsd.org Sat Feb 1 19:50:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E705D229B2D; Sat, 1 Feb 2020 19:50:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894SL5k3xz3yP8; Sat, 1 Feb 2020 19:50:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A61E34136; Sat, 1 Feb 2020 19:50:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011JoAiM021770; Sat, 1 Feb 2020 19:50:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011JoAui021769; Sat, 1 Feb 2020 19:50:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011950.011JoAui021769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 19:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357379 - in head: share/man/man4 sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/x86/cpufreq X-SVN-Commit-Revision: 357379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 19:50:11 -0000 Author: cem Date: Sat Feb 1 19:50:10 2020 New Revision: 357379 URL: https://svnweb.freebsd.org/changeset/base/357379 Log: hwpstate_intel(4): Detect and support PKG variant If package-level control is present, we default to using it. Per-core software control may be enabled by setting the machdep.hwpstate_pkg_ctrl tunable to "0" in loader.conf(5). Modified: head/share/man/man4/hwpstate_intel.4 head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/share/man/man4/hwpstate_intel.4 ============================================================================== --- head/share/man/man4/hwpstate_intel.4 Sat Feb 1 19:49:13 2020 (r357378) +++ head/share/man/man4/hwpstate_intel.4 Sat Feb 1 19:50:10 2020 (r357379) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2020 +.Dd February 1, 2020 .Dt HWPSTATE_INTEL 4 .Os .Sh NAME @@ -49,7 +49,15 @@ Can be used to disable .Nm , allowing other compatible drivers to manage performance states, like .Xr est 4 . -.Pq default 0 +Defaults to +.Dv Qq 0 +(enabled). +.It Va machdep.hwpstate_pkg_ctrl +Selects between package-level control (the default) and per-core control. +.Dv Qq 1 +selects package-level control and +.Dv Qq 0 +selects core-level control. .El .Sh SYSCTL VARIABLES The following Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:49:13 2020 (r357378) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:50:10 2020 (r357379) @@ -88,6 +88,7 @@ struct hwp_softc { bool hwp_activity_window; bool hwp_pref_ctrl; bool hwp_pkg_ctrl; + bool hwp_pkg_ctrl_en; bool hwp_perf_bias; uint64_t req; /* Cached copy of last request */ @@ -109,6 +110,11 @@ DRIVER_MODULE(hwpstate_intel, cpu, hwpstate_intel_driv hwpstate_intel_devclass, NULL, NULL); MODULE_VERSION(hwpstate_intel, 1); +static bool hwpstate_pkg_ctrl_enable = true; +SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_pkg_ctrl, CTLFLAG_RDTUN, + &hwpstate_pkg_ctrl_enable, 0, + "Set 1 (default) to enable package-level control, 0 to disable"); + static int intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) { @@ -260,7 +266,10 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) thread_unlock(curthread); if (sc->hwp_pref_ctrl) { - ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); + if (sc->hwp_pkg_ctrl_en) + ret = rdmsr_safe(MSR_IA32_HWP_REQUEST_PKG, &requested); + else + ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); if (ret) goto out; val = (requested & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; @@ -293,9 +302,12 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) val = percent_to_raw(val); requested &= ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE; - requested |= val << 24; + requested |= val << 24u; - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); + if (sc->hwp_pkg_ctrl_en) + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, requested); + else + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); } else { requested = percent_to_raw_perf_bias(val); MPASS((requested & ~IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK) == 0); @@ -347,7 +359,6 @@ intel_hwpstate_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } -/* FIXME: Need to support PKG variant */ static int set_autonomous_hwp(struct hwp_softc *sc) { @@ -421,13 +432,32 @@ set_autonomous_hwp(struct hwp_softc *sc) sc->req &= ~IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE; sc->req |= sc->high << 8; - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); + /* If supported, request package-level control for this CPU. */ + if (sc->hwp_pkg_ctrl_en) + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req | + IA32_HWP_REQUEST_PACKAGE_CONTROL); + else + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); if (ret) { device_printf(dev, - "Failed to setup autonomous HWP for cpu%d\n", - pc->pc_cpuid); + "Failed to setup%s autonomous HWP for cpu%d\n", + sc->hwp_pkg_ctrl_en ? " PKG" : "", pc->pc_cpuid); + goto out; } + /* If supported, write the PKG-wide control MSR. */ + if (sc->hwp_pkg_ctrl_en) { + /* + * "The structure of the IA32_HWP_REQUEST_PKG MSR + * (package-level) is identical to the IA32_HWP_REQUEST MSR + * with the exception of the Package Control field, which does + * not exist." (Intel SDM §14.4.4) + */ + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); + device_printf(dev, + "Failed to set autonomous HWP for package\n"); + } + out: thread_lock(curthread); sched_unbind(curthread); @@ -455,6 +485,9 @@ intel_hwpstate_attach(device_t dev) if (cpu_power_eax & CPUTPM1_HWP_PKG) sc->hwp_pkg_ctrl = true; + /* Allow administrators to disable pkg-level control. */ + sc->hwp_pkg_ctrl_en = (sc->hwp_pkg_ctrl && hwpstate_pkg_ctrl_enable); + /* ecx */ if (cpu_power_ecx & CPUID_PERF_BIAS) sc->hwp_perf_bias = true; @@ -558,11 +591,21 @@ intel_hwpstate_resume(device_t dev) goto out; } - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); + if (sc->hwp_pkg_ctrl_en) + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req | + IA32_HWP_REQUEST_PACKAGE_CONTROL); + else + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); if (ret) { device_printf(dev, - "Failed to setup autonomous HWP for cpu%d after suspend\n", - pc->pc_cpuid); + "Failed to set%s autonomous HWP for cpu%d after suspend\n", + sc->hwp_pkg_ctrl_en ? " PKG" : "", pc->pc_cpuid); + goto out; + } + if (sc->hwp_pkg_ctrl_en) { + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); + device_printf(dev, + "Failed to set autonomous HWP for package after suspend\n"); } out: From owner-svn-src-all@freebsd.org Sat Feb 1 20:11:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9285522A74F; Sat, 1 Feb 2020 20:11:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894ws3PHPz40x8; Sat, 1 Feb 2020 20:11:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FDC74557; Sat, 1 Feb 2020 20:11:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011KBPhZ034053; Sat, 1 Feb 2020 20:11:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KBPjJ034052; Sat, 1 Feb 2020 20:11:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002012011.011KBPjJ034052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 20:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357380 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:11:25 -0000 Author: cem Date: Sat Feb 1 20:11:25 2020 New Revision: 357380 URL: https://svnweb.freebsd.org/changeset/base/357380 Log: hwpstate_intel(4): Print failure message only on failure X-MFC-With: r357379 Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 19:50:10 2020 (r357379) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 20:11:25 2020 (r357380) @@ -604,8 +604,10 @@ intel_hwpstate_resume(device_t dev) } if (sc->hwp_pkg_ctrl_en) { ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); - device_printf(dev, - "Failed to set autonomous HWP for package after suspend\n"); + if (ret) + device_printf(dev, + "Failed to set autonomous HWP for package after " + "suspend\n"); } out: From owner-svn-src-all@freebsd.org Sat Feb 1 20:12:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80CC522A954; Sat, 1 Feb 2020 20:12:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4894xb2vQ3z416y; Sat, 1 Feb 2020 20:12:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EB18469A; Sat, 1 Feb 2020 20:12:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011KC3or037246; Sat, 1 Feb 2020 20:12:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KC3QF037245; Sat, 1 Feb 2020 20:12:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002012012.011KC3QF037245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 20:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357381 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:12:03 -0000 Author: cem Date: Sat Feb 1 20:12:02 2020 New Revision: 357381 URL: https://svnweb.freebsd.org/changeset/base/357381 Log: hwpstate_intel(4): Save admin-set EPP/EPB and restore after suspend Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 20:11:25 2020 (r357380) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 20:12:02 2020 (r357381) @@ -90,8 +90,10 @@ struct hwp_softc { bool hwp_pkg_ctrl; bool hwp_pkg_ctrl_en; bool hwp_perf_bias; + bool hwp_perf_bias_cached; - uint64_t req; /* Cached copy of last request */ + uint64_t req; /* Cached copy of HWP_REQUEST */ + uint64_t hwp_energy_perf_bias; /* Cache PERF_BIAS */ uint8_t high; uint8_t guaranteed; @@ -248,7 +250,7 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) struct hwp_softc *sc; device_t dev; struct pcpu *pc; - uint64_t requested; + uint64_t epb; uint32_t val; int ret; @@ -266,13 +268,7 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) thread_unlock(curthread); if (sc->hwp_pref_ctrl) { - if (sc->hwp_pkg_ctrl_en) - ret = rdmsr_safe(MSR_IA32_HWP_REQUEST_PKG, &requested); - else - ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &requested); - if (ret) - goto out; - val = (requested & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; + val = (sc->req & IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) >> 24; val = raw_to_percent(val); } else { /* @@ -280,10 +276,15 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) * uses MSR_IA32_ENERGY_PERF_BIAS instead (Intel SDM §14.4.4). * This register is per-core (but not HT). */ - ret = rdmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, &requested); - if (ret) - goto out; - val = requested & IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK; + if (!sc->hwp_perf_bias_cached) { + ret = rdmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, &epb); + if (ret) + goto out; + sc->hwp_energy_perf_bias = epb; + sc->hwp_perf_bias_cached = true; + } + val = sc->hwp_energy_perf_bias & + IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK; val = raw_to_percent_perf_bias(val); } @@ -301,17 +302,23 @@ sysctl_epp_select(SYSCTL_HANDLER_ARGS) if (sc->hwp_pref_ctrl) { val = percent_to_raw(val); - requested &= ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE; - requested |= val << 24u; + sc->req = + ((sc->req & ~IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE) + | (val << 24u)); if (sc->hwp_pkg_ctrl_en) - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, requested); + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); else - ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, requested); + ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); } else { - requested = percent_to_raw_perf_bias(val); - MPASS((requested & ~IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK) == 0); - ret = wrmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, requested); + val = percent_to_raw_perf_bias(val); + MPASS((val & ~IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK) == 0); + + sc->hwp_energy_perf_bias = + ((sc->hwp_energy_perf_bias & + ~IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK) | val); + ret = wrmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, + sc->hwp_energy_perf_bias); } out: @@ -604,10 +611,21 @@ intel_hwpstate_resume(device_t dev) } if (sc->hwp_pkg_ctrl_en) { ret = wrmsr_safe(MSR_IA32_HWP_REQUEST_PKG, sc->req); - if (ret) + if (ret) { device_printf(dev, "Failed to set autonomous HWP for package after " "suspend\n"); + goto out; + } + } + if (!sc->hwp_pref_ctrl && sc->hwp_perf_bias_cached) { + ret = wrmsr_safe(MSR_IA32_ENERGY_PERF_BIAS, + sc->hwp_energy_perf_bias); + if (ret) { + device_printf(dev, + "Failed to set energy perf bias for cpu%d after " + "suspend\n", pc->pc_cpuid); + } } out: From owner-svn-src-all@freebsd.org Sat Feb 1 20:30:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D141E22AEFF; Sat, 1 Feb 2020 20:30:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (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 4895LK53wdz41nR; Sat, 1 Feb 2020 20:30:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id r16so10014226otd.2; Sat, 01 Feb 2020 12:30:01 -0800 (PST) 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=HWKpdWp/uW4F7uaBYiv31Ix/BbBxikz5uoamO/EBE+Q=; b=mpciBbGccmD7iAbw61aELIA+sHOh60VwgWZO65MAMQtXmhIZ3Dj99Psxh6drYP7GRi EIdbGTRN0yCYrui0qn4ZHvFWsR1UdwavYop4sRRMmIo2/5wYpMOPx9qo8Z8EwzpArg5x kk/gV9Gamt+X4gN6tkJs4f6iaGV36mRdI9keXTQzubrx5MQGKMnU8p4/oIGJ3RmmzICW iRTVXUhydX4nSTaGi8ZiPsD/BYslcu2jpm19scfHKOzswJSS2Pc4W5qZfd+JrkSzq1FI isCm359nZgj/aRnEg0INNh7c4Gc58/XnHLVG5WsdQ5kJ/3pMCI3yM6elYnZjQdXEXhum gThA== X-Gm-Message-State: APjAAAV9tqXp5Htxjvv6vYwH1dR+0GWI6CL7m7aGoXYfz8b1XeVHZv1Q AXWyT96YxJvG939+MDppHHPZ3l9P X-Google-Smtp-Source: APXvYqxf7/eIF7eM7T4WNirGqaA0/5vC3+lprVOX8QnlZVa9sdNcCuTPxn0go/KQnRW6uk9+WRbjRQ== X-Received: by 2002:a9d:53c2:: with SMTP id i2mr11616175oth.43.1580589000277; Sat, 01 Feb 2020 12:30:00 -0800 (PST) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com. [209.85.210.54]) by smtp.gmail.com with ESMTPSA id m2sm3928539oim.13.2020.02.01.12.29.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Feb 2020 12:29:59 -0800 (PST) Received: by mail-ot1-f54.google.com with SMTP id i6so9976931otr.7; Sat, 01 Feb 2020 12:29:59 -0800 (PST) X-Received: by 2002:a9d:7593:: with SMTP id s19mr11684565otk.219.1580588999537; Sat, 01 Feb 2020 12:29:59 -0800 (PST) MIME-Version: 1.0 References: <202001311936.00VJaEDP056807@repo.freebsd.org> <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 1 Feb 2020 12:29:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm To: Dimitry Andric Cc: Ian Lepore , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4895LK53wdz41nR X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:30:01 -0000 On Sat, Feb 1, 2020 at 10:10 AM Dimitry Andric wrote: > > On 1 Feb 2020, at 18:48, Ian Lepore wrote: > > > > So you're going to switch from writing 0 to writing 0xfffffffe, and > > just assume that will work the same? > > ... [Caustic sarcasm elided] > > Hmm, the data sheet says: > > Writes (0000 0001h): Cancel a command > Writes (0000 0000h): Clears field when command has been cancelled > > It seems the other bits in the register are not used for anything. This seems pretty typical for TPM registers (in my limited experience). > So indeed it is probably better to explicitly define these values as 0x0 > and 0x1, and not use ~ or ! operators at all. I would suggest using just a plain 0 for the clear-cancel register write, unless the other bits are actually documented to have meaning, and that meaning is not W1C. My recollection is that many TPM registers only have a single real valid bit, and of those that have more than one, many are W1C. (AND4/OR4 RMW are inappropriate for W1C.) We have at least one AND4/OR4 related bugfix pending in phabricator related to this that I should go ahead and commit: https://reviews.freebsd.org/D23081 . I don't think the ~0x1 (0xff...fe) will actually do anything harmful if the other bits are ignore. But 0 is closer to the data sheet. Please un-disable the Makefile warnings removed in r357349 earlier, too. Thanks, Conrad From owner-svn-src-all@freebsd.org Sat Feb 1 20:33:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80C1D22BF7B; Sat, 1 Feb 2020 20:33:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4895QF2nsrz42wr; Sat, 1 Feb 2020 20:33:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AF3A4A73; Sat, 1 Feb 2020 20:33:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011KXPfL051521; Sat, 1 Feb 2020 20:33:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KXOiC051514; Sat, 1 Feb 2020 20:33:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002012033.011KXOiC051514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 20:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357382 - in head: include lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: include lib/libc/stdlib X-SVN-Commit-Revision: 357382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:33:25 -0000 Author: cem Date: Sat Feb 1 20:33:23 2020 New Revision: 357382 URL: https://svnweb.freebsd.org/changeset/base/357382 Log: rand(3): Replace implementation with one backed by random(3) algorithm rand(3)'s standard C API is extremely limiting, but we can do better than the historical 32-bit state Park-Miller LCG we've shipped since 2001: r73156. The justification provided at the time for not using random(3) was that rand_r(3) could not be made to use the same algorithm. That is still true. However, the irrelevance of rand_r(3) is increasingly obvious. Since that time, POSIX has marked the interface obsolescent. rand_r(3) never became part of the standard C library. If not for API compatibility reasons, I would just remove rand_r(3) entirely. So, I do not believe it is a problem for rand_r(3) and rand(3) to diverge. The 12 ABI is maintained with compatibility definitions, but this revision does subtly change the API of rand(3). The sequences of pseudorandom numbers produced in programs built against new versions of libc will differ from programs built against prior versions of libc. Reviewed by: kevans, markm MFC after: no Relnotes: yes Differential Revision: https://reviews.freebsd.org/D23290 Modified: head/include/stdlib.h head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/rand.c head/lib/libc/stdlib/random.3 head/lib/libc/stdlib/random.c head/lib/libc/stdlib/random.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Feb 1 20:12:02 2020 (r357381) +++ head/include/stdlib.h Sat Feb 1 20:33:23 2020 (r357382) @@ -73,7 +73,11 @@ typedef struct { #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -#define RAND_MAX 0x7ffffffd +/* + * I.e., INT_MAX; rand(3) returns a signed integer but must produce output in + * the range [0, RAND_MAX], so half of the possible output range is unused. + */ +#define RAND_MAX 0x7fffffff __BEGIN_DECLS #ifdef _XLOCALE_H_ Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/Symbol.map Sat Feb 1 20:33:23 2020 (r357382) @@ -54,8 +54,6 @@ FBSD_1.0 { radixsort; sradixsort; rand_r; - rand; - srand; srandom; srandomdev; initstate; @@ -125,6 +123,8 @@ FBSD_1.5 { FBSD_1.6 { qsort_s; + rand; + srand; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/rand.3 Sat Feb 1 20:33:23 2020 (r357382) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 14, 2019 +.Dd February 1, 2020 .Dt RAND 3 .Os .Sh NAME @@ -59,49 +59,52 @@ Applications which require unpredictable random number instead. .Ef .Pp -These interfaces are obsoleted by -.Xr random 3 . -.Pp The .Fn rand function computes a sequence of pseudo-random integers in the range of 0 to -.Dv RAND_MAX -(as defined by the header file -.In stdlib.h ) . +.Dv RAND_MAX , +inclusive. .Pp The .Fn srand -function sets its argument +function seeds the algorithm with the .Fa seed -as the seed for a new sequence of -pseudo-random numbers to be returned by -.Fn rand . -These sequences are repeatable by calling +parameter. +Repeatable sequences of +.Fn rand +output may be obtained by calling .Fn srand -with the same seed value. +with the same +.Fa seed . +.Fn rand +is implicitly initialized as if +.Fn srand "1" +had been invoked explicitly. .Pp -If no -.Fa seed -value is provided, the functions are automatically -seeded with a value of 1. -.Pp -The +In +.Fx 13 , +.Fn rand +is implemented using the same 128-byte state LFSR generator algorithm as +.Xr random 3 . +However, the legacy .Fn rand_r -function -provides the same functionality as -.Fn rand . -A pointer to the context value -.Fa ctx -must be supplied by the caller. -.Pp -For better generator quality, use -.Xr random 3 -or -.Xr lrand48 3 . +function is not (and can not be, because of its limited +.Fa *ctx +size). +.Fn rand_r +implements the historical, poor-quality Park-Miller 32-bit LCG and should not +be used in new designs. +.Sh IMPLEMENTATION NOTES +Since +.Fx 13 , +.Fn rand +is implemented with the same generator as +.Xr random 3 , +so the low-order bits should no longer be significantly worse than the +high-order bits. .Sh SEE ALSO .Xr arc4random 3 , -.Xr lrand48 3 , .Xr random 3 , .Xr random 4 .Sh STANDARDS @@ -115,5 +118,32 @@ conform to .Pp The .Fn rand_r -function is marked as obsolescent in POSIX and may be removed in a future -revision of the standard. +function is not part of +.St -isoC +and is marked obsolescent in +.St -p1003.1-2008 . +It may be removed in a future revision of POSIX. +.Sh CAVEATS +Prior to +.Fx 13 , +.Fn rand +used the historical Park-Miller generator with 32 bits of state and produced +poor quality output, especially in the lower bits. +.Fn rand +in earlier versions of +.Fx , +as well as other standards-conforming implementations, may continue to produce +poor quality output. +.Pp +.Em These functions should not be used in portable applications that want a +.Em high quality or high performance pseudorandom number generator . +One possible replacement, +.Xr random 3 , +is portable to Linux — but it is not especially fast, nor standardized. +.Pp +If broader portability or better performance is desired, any of the widely +available and permissively licensed SFC64/32, JSF64/32, PCG64/32, or SplitMix64 +algorithm implementations may be embedded in your application. +These algorithms have the benefit of requiring less space than +.Xr random 3 +and being quite fast (in header inline implementations). Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/rand.c Sat Feb 1 20:33:23 2020 (r357382) @@ -40,11 +40,60 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include #include "un-namespace.h" +#include "random.h" + +/* + * Implement rand(3), the standard C PRNG API, using the non-standard but + * higher quality random(3) implementation and the same size 128-byte state + * LFSR as the random(3) default. + * + * It turns out there are portable applications that want a PRNG but are too + * lazy to use better-but-nonstandard interfaces like random(3), when + * available, and too lazy to import higher-quality and faster PRNGs into their + * codebase (such as any of SFC, JSF, 128-bit LCGs, PCG, or Splitmix64). + * + * Since we're stuck with rand(3) due to the C standard, we can at least have + * it produce a relatively good PRNG sequence using our existing random(3) + * LFSR. The random(3) design is not particularly fast nor compact, but it has + * the advantage of being the one already in the tree. + */ +static struct __random_state *rand3_state; + +static void +initialize_rand3(void) +{ + int error; + + rand3_state = allocatestate(TYPE_3); + error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); + assert(error == 0); +} + +int +rand(void) +{ + if (rand3_state == NULL) + initialize_rand3(); + return ((int)random_r(rand3_state)); +} + +void +srand(unsigned seed) +{ + if (rand3_state == NULL) + initialize_rand3(); + srandom_r(rand3_state, seed); +} + +/* + * FreeBSD 12 and prior compatibility implementation of rand(3). + */ static int do_rand(unsigned long *ctx) { @@ -71,7 +120,9 @@ do_rand(unsigned long *ctx) return (x); } - +/* + * Can't fix this garbage; too little state. + */ int rand_r(unsigned *ctx) { @@ -84,21 +135,23 @@ rand_r(unsigned *ctx) return (r); } - static u_long next = 1; +int __rand_fbsd12(void); int -rand(void) +__rand_fbsd12(void) { return (do_rand(&next)); } +__sym_compat(rand, __rand_fbsd12, FBSD_1.0); +void __srand_fbsd12(unsigned seed); void -srand(unsigned seed) +__srand_fbsd12(unsigned seed) { next = seed; } - +__sym_compat(srand, __srand_fbsd12, FBSD_1.0); void __sranddev_fbsd12(void); void Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/random.3 Sat Feb 1 20:33:23 2020 (r357382) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 20, 2020 +.Dd February 1, 2020 .Dt RANDOM 3 .Os .Sh NAME @@ -74,8 +74,7 @@ The period of this random number generator is very lar .Pp If initialized with less than 32 bytes of state, .Fn random -uses the same poor-quality Park-Miller LCG as -.Xr rand 3 . +uses the poor-quality 32-bit Park-Miller LCG. .Pp The .Fn random @@ -85,9 +84,6 @@ functions are analagous to .Xr rand 3 and .Xr srand 3 . -The difference is that -.Xr rand 3 -is a worse pseudo-random number generator. .Pp Like .Xr rand 3 , Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/random.c Sat Feb 1 20:33:23 2020 (r357382) @@ -104,48 +104,13 @@ __FBSDID("$FreeBSD$"); * byte buffer it is about 5 percent faster. */ -/* - * For each of the currently supported random number generators, we have a - * break value on the amount of state information (you need at least this - * many bytes of state info to support this random number generator), a degree - * for the polynomial (actually a trinomial) that the R.N.G. is based on, and - * the separation between the two lower order coefficients of the trinomial. - */ -#define TYPE_0 0 /* linear congruential */ -#define BREAK_0 8 -#define DEG_0 0 -#define SEP_0 0 - -#define TYPE_1 1 /* x**7 + x**3 + 1 */ -#define BREAK_1 32 -#define DEG_1 7 -#define SEP_1 3 - -#define TYPE_2 2 /* x**15 + x + 1 */ -#define BREAK_2 64 -#define DEG_2 15 -#define SEP_2 1 - -#define TYPE_3 3 /* x**31 + x**3 + 1 */ -#define BREAK_3 128 -#define DEG_3 31 -#define SEP_3 3 - -#define TYPE_4 4 /* x**63 + x + 1 */ -#define BREAK_4 256 -#define DEG_4 63 -#define SEP_4 1 - -/* - * Array versions of the above information to make code run faster -- - * relies on fact that TYPE_i == i. - */ -#define MAX_TYPES 5 /* max number of types above */ - #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; -static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; +static const int seps[MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; +static const int breaks[MAX_TYPES] = { + BREAK_0, BREAK_1, BREAK_2, BREAK_3, BREAK_4 +}; /* * Initially, everything is set up as if from: @@ -523,4 +488,20 @@ long random(void) { return (random_r(&implicit)); +} + +struct __random_state * +allocatestate(unsigned type) +{ + size_t asize; + + /* No point using this interface to get the Park-Miller LCG. */ + if (type < TYPE_1) + abort(); + /* Clamp to widest supported variant. */ + if (type > (MAX_TYPES - 1)) + type = (MAX_TYPES - 1); + + asize = sizeof(struct __random_state) + (size_t)breaks[type]; + return (malloc(asize)); } Modified: head/lib/libc/stdlib/random.h ============================================================================== --- head/lib/libc/stdlib/random.h Sat Feb 1 20:12:02 2020 (r357381) +++ head/lib/libc/stdlib/random.h Sat Feb 1 20:33:23 2020 (r357382) @@ -27,6 +27,44 @@ #pragma once +/* + * For each of the currently supported random number generators, we have a + * break value on the amount of state information (you need at least this + * many bytes of state info to support this random number generator), a degree + * for the polynomial (actually a trinomial) that the R.N.G. is based on, and + * the separation between the two lower order coefficients of the trinomial. + */ +#define TYPE_0 0 /* linear congruential */ +#define BREAK_0 8 +#define DEG_0 0 +#define SEP_0 0 + +#define TYPE_1 1 /* x**7 + x**3 + 1 */ +#define BREAK_1 32 +#define DEG_1 7 +#define SEP_1 3 + +#define TYPE_2 2 /* x**15 + x + 1 */ +#define BREAK_2 64 +#define DEG_2 15 +#define SEP_2 1 + +#define TYPE_3 3 /* x**31 + x**3 + 1 */ +#define BREAK_3 128 +#define DEG_3 31 +#define SEP_3 3 + +#define TYPE_4 4 /* x**63 + x + 1 */ +#define BREAK_4 256 +#define DEG_4 63 +#define SEP_4 1 + +/* + * Array versions of the above information to make code run faster -- + * relies on fact that TYPE_i == i. + */ +#define MAX_TYPES 5 /* max number of types above */ + /* A full instance of the random(3) generator. */ struct __random_state { uint32_t *rst_fptr; @@ -40,6 +78,7 @@ struct __random_state { uint32_t rst_randtbl[]; }; +struct __random_state *allocatestate(unsigned type); int initstate_r(struct __random_state *, unsigned, uint32_t *, size_t); long random_r(struct __random_state *); void srandom_r(struct __random_state *, unsigned); From owner-svn-src-all@freebsd.org Sat Feb 1 20:34:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F74222C06B; Sat, 1 Feb 2020 20:34:45 +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 4895Rm6cvbz435l; Sat, 1 Feb 2020 20:34: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 DE7F34A8C; Sat, 1 Feb 2020 20:34: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 011KYi3n051630; Sat, 1 Feb 2020 20:34:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KYhEq051624; Sat, 1 Feb 2020 20:34:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002012034.011KYhEq051624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 20:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357383 - in head/sys: fs/devfs fs/pseudofs fs/tmpfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/devfs fs/pseudofs fs/tmpfs kern sys X-SVN-Commit-Revision: 357383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:34:45 -0000 Author: mjg Date: Sat Feb 1 20:34:43 2020 New Revision: 357383 URL: https://svnweb.freebsd.org/changeset/base/357383 Log: vfs: consistently use size_t for buflen around VOP_VPTOCNP Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/fs/devfs/devfs_vnops.c Sat Feb 1 20:34:43 2020 (r357383) @@ -274,7 +274,7 @@ devfs_vptocnp(struct vop_vptocnp_args *ap) struct vnode **dvp = ap->a_vpp; struct devfs_mount *dmp; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; struct devfs_dirent *dd, *de; int i, error; Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sat Feb 1 20:34:43 2020 (r357383) @@ -377,7 +377,7 @@ pfs_vptocnp(struct vop_vptocnp_args *ap) struct pfs_node *pn; struct mount *mp; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; char pidbuf[PFS_NAMELEN]; pid_t pid = pvd->pvd_pid; int len, i, error, locked; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 1 20:34:43 2020 (r357383) @@ -1491,7 +1491,7 @@ tmpfs_vptocnp_dir(struct tmpfs_node *tn, struct tmpfs_ static int tmpfs_vptocnp_fill(struct vnode *vp, struct tmpfs_node *tn, - struct tmpfs_node *tnp, char *buf, int *buflen, struct vnode **dvp) + struct tmpfs_node *tnp, char *buf, size_t *buflen, struct vnode **dvp) { struct tmpfs_dirent *de; int error, i; @@ -1531,7 +1531,7 @@ tmpfs_vptocnp(struct vop_vptocnp_args *ap) struct tmpfs_dirent *de; struct tmpfs_mount *tm; char *buf; - int *buflen; + size_t *buflen; int error; vp = ap->a_vp; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/kern/vfs_cache.c Sat Feb 1 20:34:43 2020 (r357383) @@ -388,7 +388,7 @@ STATNODE_COUNTER(shrinking_skipped, static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, u_int buflen); + char *buf, char **retbuf, size_t buflen); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); @@ -2293,7 +2293,7 @@ vn_fullpath_global(struct thread *td, struct vnode *vn } int -vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, u_int *buflen) +vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen) { struct vnode *dvp; struct namecache *ncp; @@ -2359,7 +2359,7 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char */ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, u_int buflen) + char *buf, char **retbuf, size_t buflen) { int error, slash_prefixed; #ifdef KDTRACE_HOOKS Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/kern/vfs_default.c Sat Feb 1 20:34:43 2020 (r357383) @@ -804,7 +804,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) struct vnode **dvp = ap->a_vpp; struct ucred *cred = ap->a_cred; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; char *dirbuf, *cpos; int i, error, eofflag, dirbuflen, flags, locked, len, covered; off_t off; Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/kern/vnode_if.src Sat Feb 1 20:34:43 2020 (r357383) @@ -640,7 +640,7 @@ vop_vptocnp { OUT struct vnode **vpp; IN struct ucred *cred; INOUT char *buf; - INOUT int *buflen; + INOUT size_t *buflen; }; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Feb 1 20:33:23 2020 (r357382) +++ head/sys/sys/vnode.h Sat Feb 1 20:34:43 2020 (r357383) @@ -631,7 +631,7 @@ int insmntque(struct vnode *vp, struct mount *mp); u_quad_t init_va_filerev(void); int speedup_syncer(void); int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, - u_int *buflen); + size_t *buflen); int vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); int vn_fullpath_global(struct thread *td, struct vnode *vn, From owner-svn-src-all@freebsd.org Sat Feb 1 20:36:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D94922C147; Sat, 1 Feb 2020 20:36:36 +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 4895Tw3fBzz43KQ; Sat, 1 Feb 2020 20:36:36 +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 5E6AB4A92; Sat, 1 Feb 2020 20:36:36 +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 011Kaa96051874; Sat, 1 Feb 2020 20:36:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KaajV051873; Sat, 1 Feb 2020 20:36:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002012036.011KaajV051873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 20:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357384 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:36:36 -0000 Author: mjg Date: Sat Feb 1 20:36:35 2020 New Revision: 357384 URL: https://svnweb.freebsd.org/changeset/base/357384 Log: cache: remove vnode -> path lookup disablement It seems to be of little to no use even when debugging. Interested parties can resurrect it and gate compilation with a macro. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Feb 1 20:34:43 2020 (r357383) +++ head/sys/kern/vfs_cache.c Sat Feb 1 20:36:35 2020 (r357384) @@ -2167,13 +2167,6 @@ vfs_cache_lookup(struct vop_lookup_args *ap) return (error); } -/* - * XXX All of these sysctls would probably be more productive dead. - */ -static int __read_mostly disablecwd; -SYSCTL_INT(_debug, OID_AUTO, disablecwd, CTLFLAG_RW, &disablecwd, 0, - "Disable the getcwd syscall"); - /* Implementation of the getcwd syscall. */ int sys___getcwd(struct thread *td, struct __getcwd_args *uap) @@ -2192,8 +2185,6 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s struct vnode *cdir, *rdir; int error; - if (__predict_false(disablecwd)) - return (ENODEV); if (__predict_false(buflen < 2)) return (EINVAL); if (buflen > path_max) @@ -2226,14 +2217,6 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s } /* - * Thus begins the fullpath magic. - */ - -static int __read_mostly disablefullpath; -SYSCTL_INT(_debug, OID_AUTO, disablefullpath, CTLFLAG_RW, &disablefullpath, 0, - "Disable the vn_fullpath function"); - -/* * Retrieve the full filesystem path that correspond to a vnode from the name * cache (if available) */ @@ -2245,8 +2228,6 @@ vn_fullpath(struct thread *td, struct vnode *vn, char struct vnode *rdir; int error; - if (__predict_false(disablefullpath)) - return (ENODEV); if (__predict_false(vn == NULL)) return (EINVAL); @@ -2279,8 +2260,6 @@ vn_fullpath_global(struct thread *td, struct vnode *vn char *buf; int error; - if (__predict_false(disablefullpath)) - return (ENODEV); if (__predict_false(vn == NULL)) return (EINVAL); buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); @@ -2515,9 +2494,6 @@ vn_commname(struct vnode *vp, char *buf, u_int buflen) * Requires a locked, referenced vnode. * Vnode is re-locked on success or ENODEV, otherwise unlocked. * - * If sysctl debug.disablefullpath is set, ENODEV is returned, - * vnode is left locked and path remain untouched. - * * If vp is a directory, the call to vn_fullpath_global() always succeeds * because it falls back to the ".." lookup if the namecache lookup fails. */ @@ -2531,10 +2507,6 @@ vn_path_to_global_path(struct thread *td, struct vnode int error; ASSERT_VOP_ELOCKED(vp, __func__); - - /* Return ENODEV if sysctl debug.disablefullpath==1 */ - if (__predict_false(disablefullpath)) - return (ENODEV); /* Construct global filesystem path from vp. */ VOP_UNLOCK(vp); From owner-svn-src-all@freebsd.org Sat Feb 1 20:37:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8916422C214; Sat, 1 Feb 2020 20:37:12 +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 4895Vc37HVz43Sw; Sat, 1 Feb 2020 20:37:12 +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 66B324A95; Sat, 1 Feb 2020 20:37:12 +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 011KbC3L051950; Sat, 1 Feb 2020 20:37:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KbCDT051949; Sat, 1 Feb 2020 20:37:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002012037.011KbCDT051949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 20:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357385 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:37:12 -0000 Author: mjg Date: Sat Feb 1 20:37:11 2020 New Revision: 357385 URL: https://svnweb.freebsd.org/changeset/base/357385 Log: cache: return the total length from vn_fullpath1 This removes strlen from getcwd. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Feb 1 20:36:35 2020 (r357384) +++ head/sys/kern/vfs_cache.c Sat Feb 1 20:37:11 2020 (r357385) @@ -388,7 +388,7 @@ STATNODE_COUNTER(shrinking_skipped, static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t buflen); + char *buf, char **retbuf, size_t *buflen); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); @@ -2198,15 +2198,15 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s rdir = fdp->fd_rdir; vrefact(rdir); FILEDESC_SUNLOCK(fdp); - error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen); + error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, &buflen); vrele(rdir); vrele(cdir); if (!error) { if (bufseg == UIO_SYSSPACE) - bcopy(bp, buf, strlen(bp) + 1); + bcopy(bp, buf, buflen); else - error = copyout(bp, buf, strlen(bp) + 1); + error = copyout(bp, buf, buflen); #ifdef KTRACE if (KTRPOINT(curthread, KTR_NAMEI)) ktrnamei(bp); @@ -2226,18 +2226,20 @@ vn_fullpath(struct thread *td, struct vnode *vn, char char *buf; struct filedesc *fdp; struct vnode *rdir; + size_t buflen; int error; if (__predict_false(vn == NULL)) return (EINVAL); - buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + buflen = MAXPATHLEN; + buf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); rdir = fdp->fd_rdir; vrefact(rdir); FILEDESC_SUNLOCK(fdp); - error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); + error = vn_fullpath1(td, vn, rdir, buf, retbuf, &buflen); vrele(rdir); if (!error) @@ -2258,12 +2260,14 @@ vn_fullpath_global(struct thread *td, struct vnode *vn char **retbuf, char **freebuf) { char *buf; + size_t buflen; int error; if (__predict_false(vn == NULL)) return (EINVAL); - buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN); + buflen = MAXPATHLEN; + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, &buflen); if (!error) *freebuf = buf; else @@ -2338,14 +2342,17 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char */ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t buflen) + char *buf, char **retbuf, size_t *len) { int error, slash_prefixed; #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; #endif struct vnode *vp1; + size_t buflen; + buflen = *len; + buflen--; buf[buflen] = '\0'; error = 0; @@ -2436,6 +2443,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, stru SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, buf + buflen); *retbuf = buf + buflen; + *len -= buflen; return (0); } From owner-svn-src-all@freebsd.org Sat Feb 1 20:38:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09BBA22C421; Sat, 1 Feb 2020 20:38:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4895Wy6YGnz43hv; Sat, 1 Feb 2020 20:38:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0C54A97; Sat, 1 Feb 2020 20:38:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011KcM8e052049; Sat, 1 Feb 2020 20:38:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011KcMtT052048; Sat, 1 Feb 2020 20:38:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002012038.011KcMtT052048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 20:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357386 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 357386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:38:23 -0000 Author: cem Date: Sat Feb 1 20:38:22 2020 New Revision: 357386 URL: https://svnweb.freebsd.org/changeset/base/357386 Log: tpm(4): Fix 'go ready' in TPM 2.0 TIS driver tpmtis_go_ready() read the value of the TPM_STS register, ORed TPM_STS_CMD_READY with it, and wrote it back. However, the TPM Profile (PTP) specification states that only one bit in the write request value may be set to 1, or else the entire write request is ignored. Fix by just writing TPM_STS_CMD_READY. Similarly, remove the call which clears the TPM_STS_CMD_READY flag in the same function. It was being ignored for the same reason. Submitted by: Darrick Lew Reviewed by: vangyzen, myself MFC after: if you care about stable, you might want to do so Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23081 Modified: head/sys/dev/tpm/tpm_tis.c Modified: head/sys/dev/tpm/tpm_tis.c ============================================================================== --- head/sys/dev/tpm/tpm_tis.c Sat Feb 1 20:37:11 2020 (r357385) +++ head/sys/dev/tpm/tpm_tis.c Sat Feb 1 20:38:22 2020 (r357386) @@ -386,12 +386,11 @@ tpmtis_go_ready(struct tpm_sc *sc) mask = TPM_STS_CMD_RDY; sc->intr_type = TPM_INT_STS_CMD_RDY; - OR4(sc, TPM_STS, TPM_STS_CMD_RDY); + WR4(sc, TPM_STS, TPM_STS_CMD_RDY); bus_barrier(sc->mem_res, TPM_STS, 4, BUS_SPACE_BARRIER_WRITE); if (!tpm_wait_for_u32(sc, TPM_STS, mask, mask, TPM_TIMEOUT_B)) return (false); - AND4(sc, TPM_STS, ~TPM_STS_CMD_RDY); return (true); } From owner-svn-src-all@freebsd.org Sat Feb 1 20:38:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C47F622C497; Sat, 1 Feb 2020 20:38:39 +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 4895XH4w3dz43qD; Sat, 1 Feb 2020 20:38:39 +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 A38744A98; Sat, 1 Feb 2020 20:38:39 +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 011Kcdml052117; Sat, 1 Feb 2020 20:38:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011Kcc8q052112; Sat, 1 Feb 2020 20:38:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202002012038.011Kcc8q052112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Feb 2020 20:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357387 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 357387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:38:39 -0000 Author: mjg Date: Sat Feb 1 20:38:38 2020 New Revision: 357387 URL: https://svnweb.freebsd.org/changeset/base/357387 Log: cache: replace kern___getcwd with vn_getcwd The previous routine was resulting in extra data copies most notably in linux_getcwd. Modified: head/sys/compat/linux/linux_getcwd.c head/sys/kern/kern_sig.c head/sys/kern/vfs_cache.c head/sys/sys/syscallsubr.h head/sys/sys/vnode.h Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Sat Feb 1 20:38:22 2020 (r357386) +++ head/sys/compat/linux/linux_getcwd.c Sat Feb 1 20:38:38 2020 (r357387) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -60,28 +60,25 @@ __FBSDID("$FreeBSD$"); * Find pathname of process's current directory. */ int -linux_getcwd(struct thread *td, struct linux_getcwd_args *args) +linux_getcwd(struct thread *td, struct linux_getcwd_args *uap) { - char *path; - int error, lenused; + char *buf, *retbuf; + size_t buflen; + int error; - /* - * Linux returns ERANGE instead of EINVAL. - */ - if (args->bufsize < 2) + buflen = uap->bufsize; + if (__predict_false(buflen < 2)) return (ERANGE); + if (buflen > LINUX_PATH_MAX) + buflen = LINUX_PATH_MAX; - path = malloc(LINUX_PATH_MAX, M_LINUX, M_WAITOK); - - error = kern___getcwd(td, path, UIO_SYSSPACE, args->bufsize, - LINUX_PATH_MAX); + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_getcwd(td, buf, &retbuf, &buflen); if (error == 0) { - lenused = strlen(path) + 1; - error = copyout(path, args->buf, lenused); + error = copyout(retbuf, uap->buf, buflen); if (error == 0) - td->td_retval[0] = lenused; + td->td_retval[0] = buflen; } - - free(path, M_LINUX); + free(buf, M_TEMP); return (error); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Feb 1 20:38:22 2020 (r357386) +++ head/sys/kern/kern_sig.c Sat Feb 1 20:38:38 2020 (r357387) @@ -3608,6 +3608,7 @@ coredump(struct thread *td) struct vnode *vp; struct flock lf; struct vattr vattr; + size_t fullpathsize; int error, error1, locked; char *name; /* name of corefile */ void *rl_cookie; @@ -3711,13 +3712,14 @@ coredump(struct thread *td) * if the path of the core is relative, add the current dir in front if it. */ if (name[0] != '/') { - fullpath = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - if (kern___getcwd(td, fullpath, UIO_SYSSPACE, MAXPATHLEN, MAXPATHLEN) != 0) { - free(fullpath, M_TEMP); + fullpathsize = MAXPATHLEN; + freepath = malloc(fullpathsize, M_TEMP, M_WAITOK); + if (vn_getcwd(td, freepath, &fullpath, &fullpathsize) != 0) { + free(freepath, M_TEMP); goto out2; } devctl_safe_quote_sb(sb, fullpath); - free(fullpath, M_TEMP); + free(freepath, M_TEMP); sbuf_putc(sb, '/'); } devctl_safe_quote_sb(sb, name); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Feb 1 20:38:22 2020 (r357386) +++ head/sys/kern/vfs_cache.c Sat Feb 1 20:38:38 2020 (r357387) @@ -364,7 +364,7 @@ STATNODE_COUNTER(numposhits, "Number of cache hits (po STATNODE_COUNTER(numnegzaps, "Number of cache hits (negative) we do not want to cache"); STATNODE_COUNTER(numneghits, "Number of cache hits (negative)"); -/* These count for kern___getcwd(), too. */ +/* These count for vn_getcwd(), too. */ STATNODE_COUNTER(numfullpathcalls, "Number of fullpath search calls"); STATNODE_COUNTER(numfullpathfail1, "Number of fullpath search errors (ENOTDIR)"); STATNODE_COUNTER(numfullpathfail2, @@ -2171,26 +2171,31 @@ vfs_cache_lookup(struct vop_lookup_args *ap) int sys___getcwd(struct thread *td, struct __getcwd_args *uap) { + char *buf, *retbuf; + size_t buflen; + int error; - return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen, - MAXPATHLEN)); + buflen = uap->buflen; + if (__predict_false(buflen < 2)) + return (EINVAL); + if (buflen > MAXPATHLEN) + buflen = MAXPATHLEN; + + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_getcwd(td, buf, &retbuf, &buflen); + if (error == 0) + error = copyout(retbuf, uap->buf, buflen); + free(buf, M_TEMP); + return (error); } int -kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, size_t buflen, - size_t path_max) +vn_getcwd(struct thread *td, char *buf, char **retbuf, size_t *buflen) { - char *bp, *tmpbuf; struct filedesc *fdp; struct vnode *cdir, *rdir; int error; - if (__predict_false(buflen < 2)) - return (EINVAL); - if (buflen > path_max) - buflen = path_max; - - tmpbuf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); cdir = fdp->fd_cdir; @@ -2198,21 +2203,14 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s rdir = fdp->fd_rdir; vrefact(rdir); FILEDESC_SUNLOCK(fdp); - error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, &buflen); + error = vn_fullpath1(td, cdir, rdir, buf, retbuf, buflen); vrele(rdir); vrele(cdir); - if (!error) { - if (bufseg == UIO_SYSSPACE) - bcopy(bp, buf, buflen); - else - error = copyout(bp, buf, buflen); #ifdef KTRACE - if (KTRPOINT(curthread, KTR_NAMEI)) - ktrnamei(bp); + if (KTRPOINT(curthread, KTR_NAMEI) && error == 0) + ktrnamei(*retbuf); #endif - } - free(tmpbuf, M_TEMP); return (error); } @@ -2338,7 +2336,7 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char } /* - * The magic behind kern___getcwd() and vn_fullpath(). + * The magic behind vn_getcwd() and vn_fullpath(). */ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sat Feb 1 20:38:22 2020 (r357386) +++ head/sys/sys/syscallsubr.h Sat Feb 1 20:38:38 2020 (r357387) @@ -65,8 +65,6 @@ struct uio; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); -int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, - size_t buflen, size_t path_max); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp); int kern_accept4(struct thread *td, int s, struct sockaddr **name, Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Feb 1 20:38:22 2020 (r357386) +++ head/sys/sys/vnode.h Sat Feb 1 20:38:38 2020 (r357387) @@ -632,6 +632,7 @@ u_quad_t init_va_filerev(void); int speedup_syncer(void); int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen); +int vn_getcwd(struct thread *td, char *buf, char **retbuf, size_t *buflen); int vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); int vn_fullpath_global(struct thread *td, struct vnode *vn, From owner-svn-src-all@freebsd.org Sat Feb 1 20:41:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9683922C799; Sat, 1 Feb 2020 20:41:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.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 4895bw5s3Gz44CS; Sat, 1 Feb 2020 20:41:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f46.google.com with SMTP id h9so9950687otj.11; Sat, 01 Feb 2020 12:41:48 -0800 (PST) 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=hoy85VScIq6F1KMoXEU4Ntku1AOvpEJyV4sdwN4nMF4=; b=kQahtZ4FmsGbpGTjLj2+XRAjXXDg3+m7NRGqqKd1Eyq/ncD6Oux91WYtvNZQEhs1+g 7VEKudX30ERHltUA+UGVq7+tEpYE3BYbdXDXt8B3iy4aHTtjaE60hjni62u7wjAXqSog oMUtrJPNMQNLVWicF2Xg0+nwOfstRscEnyxmt84ijKMFPehUj7qyQO9krAbuAdNFLo3w DmtPpn9bJlEDNSoNkPldCyeus8BaFH0ywjNMl8KhR8sc1jEDpybWiKUge3Z87Ms6RF+/ ubM//1kcu7u4fy1aS/e7lK0hKRcbU4hDypQTdhxJJ0cXfhyLjWdBcbN/MY+rY/ex0m0Q 71uw== X-Gm-Message-State: APjAAAW+hfiNBtD6TUxmrgojvBDUW+pbvCbXRDDzOGM6sxUZYdiWIm5o UnDak4ajCzCdXc9fdJSlhoCMhg/X X-Google-Smtp-Source: APXvYqzVh7QpQHOM5JfXwQ0uIFYT8SHxpmMZk9AT1C4++6oNXv4vR6eUlfyc+6GNQP/ozor3aFdc5w== X-Received: by 2002:a05:6830:606:: with SMTP id w6mr1539896oti.323.1580589707750; Sat, 01 Feb 2020 12:41:47 -0800 (PST) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com. [209.85.167.172]) by smtp.gmail.com with ESMTPSA id t23sm3904244oic.28.2020.02.01.12.41.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Feb 2020 12:41:47 -0800 (PST) Received: by mail-oi1-f172.google.com with SMTP id b18so10966595oie.2; Sat, 01 Feb 2020 12:41:47 -0800 (PST) X-Received: by 2002:aca:cf12:: with SMTP id f18mr10287951oig.81.1580589707341; Sat, 01 Feb 2020 12:41:47 -0800 (PST) MIME-Version: 1.0 References: <202001311936.00VJaEDP056807@repo.freebsd.org> <18BC9807-4B4C-482C-AB7E-20F9C7B68F29@FreeBSD.org> <4a87b670557d23181c3a98bc5a65c8c1a42302d3.camel@freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 1 Feb 2020 12:41:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm To: Dimitry Andric Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4895bw5s3Gz44CS 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.210.46 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-3.06 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@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]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[46.210.85.209.rep.mailspike.net : 127.0.0.18]; RCVD_TLS_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[46.210.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-1.06)[ip: (-0.43), ipnet: 209.85.128.0/17(-3.04), asn: 15169(-1.76), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@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)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 20:41:49 -0000 Hi Dimitry, On Sat, Feb 1, 2020 at 12:29 PM Conrad Meyer wrote: > Please un-disable the Makefile warnings removed in r357349 earlier, too. Apologies, I just now caught up to my r357366 in my SVN email. Thank you. Best, Conrad From owner-svn-src-all@freebsd.org Sat Feb 1 21:43:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A372222DB22; Sat, 1 Feb 2020 21:43:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4896zQ3pk2z46xc; Sat, 1 Feb 2020 21:43:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DC2857D1; Sat, 1 Feb 2020 21:43:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011LhkQU093137; Sat, 1 Feb 2020 21:43:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011Lhkwl093136; Sat, 1 Feb 2020 21:43:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002012143.011Lhkwl093136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 21:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357388 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 357388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 21:43:46 -0000 Author: dim Date: Sat Feb 1 21:43:45 2020 New Revision: 357388 URL: https://svnweb.freebsd.org/changeset/base/357388 Log: Amend r357367 by using register values from the TPM datasheet. As Ian Lepore noted, writing ~1 to a register might have a completely different effect than doing a regular read-modify-write operation. Follow the TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22 datasheet instead, and use the actual values mentioned there: (uint32_t)1 to cancel the command, (uint32_t)0 to clear the field. MFC after: 3 days Modified: head/sys/dev/tpm/tpm_crb.c Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Sat Feb 1 20:38:38 2020 (r357387) +++ head/sys/dev/tpm/tpm_crb.c Sat Feb 1 21:43:45 2020 (r357388) @@ -70,7 +70,8 @@ __FBSDID("$FreeBSD$"); #define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) #define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) -#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) +#define TPM_CRB_CTRL_CANCEL_CMD 0x1 +#define TPM_CRB_CTRL_CANCEL_CLEAR 0x0 #define TPM_CRB_CTRL_START_CMD BIT(0) @@ -298,7 +299,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; return (true); } @@ -330,7 +331,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { From owner-svn-src-all@freebsd.org Sat Feb 1 21:47:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A455322DC7B; Sat, 1 Feb 2020 21:47:34 +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 48973p3t67z47Bq; Sat, 1 Feb 2020 21:47:34 +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 804D157DB; Sat, 1 Feb 2020 21:47:34 +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 011LlYbg093676; Sat, 1 Feb 2020 21:47:34 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011LlYfE093675; Sat, 1 Feb 2020 21:47:34 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202002012147.011LlYfE093675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 1 Feb 2020 21:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357389 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 357389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 21:47:34 -0000 Author: dougm Date: Sat Feb 1 21:47:34 2020 New Revision: 357389 URL: https://svnweb.freebsd.org/changeset/base/357389 Log: In dmar_gas_lowermatch, skip searching a subtree if all its addresses are greater than lowaddr. In dmar_gas_uppermatch, skip searching a subtree if all its gaps-between-alloctions are too small. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D23391 Modified: head/sys/x86/iommu/intel_gas.c Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Sat Feb 1 21:43:45 2020 (r357388) +++ head/sys/x86/iommu/intel_gas.c Sat Feb 1 21:47:34 2020 (r357389) @@ -370,6 +370,8 @@ dmar_gas_lowermatch(struct dmar_gas_match_args *a, str } if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE) return (ENOMEM); + if (entry->first >= a->common->lowaddr) + return (ENOMEM); child = RB_LEFT(entry, rb_entry); if (child != NULL && 0 == dmar_gas_lowermatch(a, child)) return (0); @@ -390,6 +392,8 @@ dmar_gas_uppermatch(struct dmar_gas_match_args *a, str { struct dmar_map_entry *child; + if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE) + return (ENOMEM); if (entry->last < a->common->highaddr) return (ENOMEM); child = RB_LEFT(entry, rb_entry); From owner-svn-src-all@freebsd.org Sat Feb 1 23:16:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CAD022FDE5; Sat, 1 Feb 2020 23:16:31 +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 48992R0YTsz4CDM; Sat, 1 Feb 2020 23:16:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09F9A687E; Sat, 1 Feb 2020 23:16:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011NGUAx047179; Sat, 1 Feb 2020 23:16:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011NGUk4047178; Sat, 1 Feb 2020 23:16:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002012316.011NGUk4047178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Feb 2020 23:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357391 - head/sys/dev/tpm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/tpm X-SVN-Commit-Revision: 357391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 23:16:31 -0000 Author: kib Date: Sat Feb 1 23:16:30 2020 New Revision: 357391 URL: https://svnweb.freebsd.org/changeset/base/357391 Log: Fix build. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/tpm/tpm_crb.c Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Sat Feb 1 22:07:37 2020 (r357390) +++ head/sys/dev/tpm/tpm_crb.c Sat Feb 1 23:16:30 2020 (r357391) @@ -299,7 +299,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); return (true); } @@ -331,7 +331,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR); /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { From owner-svn-src-all@freebsd.org Sat Feb 1 23:46:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 007EF230681; Sat, 1 Feb 2020 23:46:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4899j26250z4DDH; Sat, 1 Feb 2020 23:46:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5ADE6E09; Sat, 1 Feb 2020 23:46:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011NkU8C065049; Sat, 1 Feb 2020 23:46:30 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011NkUGw065048; Sat, 1 Feb 2020 23:46:30 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202002012346.011NkUGw065048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 1 Feb 2020 23:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357392 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 23:46:31 -0000 Author: jeff Date: Sat Feb 1 23:46:30 2020 New Revision: 357392 URL: https://svnweb.freebsd.org/changeset/base/357392 Log: Fix a bug in r356776 where the page allocator was not properly restored to the percpu page allocator after it had been temporarily overridden by startup_alloc. Reported by: pho, bdragon Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Feb 1 23:16:30 2020 (r357391) +++ head/sys/vm/uma_core.c Sat Feb 1 23:46:30 2020 (r357392) @@ -2101,7 +2101,9 @@ zone_kva_available(uma_zone_t zone, void *unused) if ((zone->uz_flags & UMA_ZFLAG_CACHE) != 0) return; KEG_GET(zone, keg); - if (keg->uk_allocf == startup_alloc) + if (keg->uk_flags & UMA_ZONE_PCPU) + keg->uk_allocf = pcpu_page_alloc; + else if (keg->uk_allocf == startup_alloc) keg->uk_allocf = page_alloc; }