From owner-svn-src-head@freebsd.org Sun Jan 5 00:58:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 689B91EC702; Sun, 5 Jan 2020 00:58:21 +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 47r0cs1n2wz4r4M; Sun, 5 Jan 2020 00:58:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 383111D8D5; Sun, 5 Jan 2020 00:58:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0050wL6c031179; Sun, 5 Jan 2020 00:58:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0050wKju031178; Sun, 5 Jan 2020 00:58:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001050058.0050wKju031178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 00:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356361 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 356361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 00:58:21 -0000 Author: mjg Date: Sun Jan 5 00:58:20 2020 New Revision: 356361 URL: https://svnweb.freebsd.org/changeset/base/356361 Log: vfs: predict VN_IS_DOOMED as false The macro is used everywhere. Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jan 4 23:51:44 2020 (r356360) +++ head/sys/sys/vnode.h Sun Jan 5 00:58:20 2020 (r356361) @@ -893,7 +893,7 @@ do { \ #define VOP_UNSET_TEXT_CHECKED(vp) VOP_UNSET_TEXT((vp)) #endif -#define VN_IS_DOOMED(vp) ((vp)->v_irflag & VIRF_DOOMED) +#define VN_IS_DOOMED(vp) __predict_false((vp)->v_irflag & VIRF_DOOMED) void vput(struct vnode *vp); void vrele(struct vnode *vp); From owner-svn-src-head@freebsd.org Sun Jan 5 00:59:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 540061EC9F3; Sun, 5 Jan 2020 00:59:17 +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 47r0dx1cbBz4rCW; Sun, 5 Jan 2020 00:59:17 +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 32C751D8D7; Sun, 5 Jan 2020 00:59:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0050xH1r031262; Sun, 5 Jan 2020 00:59:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0050xH70031261; Sun, 5 Jan 2020 00:59:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001050059.0050xH70031261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 00:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356362 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 00:59:17 -0000 Author: mjg Date: Sun Jan 5 00:59:16 2020 New Revision: 356362 URL: https://svnweb.freebsd.org/changeset/base/356362 Log: vfs: patch up vnode count assertions to report found value Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 5 00:58:20 2020 (r356361) +++ head/sys/kern/vfs_subr.c Sun Jan 5 00:59:16 2020 (r356362) @@ -2846,8 +2846,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat */ if (refcount_acquire_if_not_zero(&vp->v_usecount)) { #ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_holdcnt, -1) - 1; - VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); + int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); #else refcount_release(&vp->v_holdcnt); #endif @@ -2872,8 +2872,8 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat */ if (refcount_acquire_if_not_zero(&vp->v_usecount)) { #ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_holdcnt, -1) - 1; - VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); + int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); #else refcount_release(&vp->v_holdcnt); #endif @@ -2953,7 +2953,7 @@ vrefact(struct vnode *vp) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); #ifdef INVARIANTS int old = atomic_fetchadd_int(&vp->v_usecount, 1); - VNASSERT(old > 0, vp, ("%s: wrong use count", __func__)); + VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old)); #else refcount_acquire(&vp->v_usecount); #endif @@ -3189,7 +3189,7 @@ vholdnz(struct vnode *vp) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); #ifdef INVARIANTS int old = atomic_fetchadd_int(&vp->v_holdcnt, 1); - VNASSERT(old > 0, vp, ("%s: wrong hold count", __func__)); + VNASSERT(old > 0, vp, ("%s: wrong hold count %d", __func__, old)); #else atomic_add_int(&vp->v_holdcnt, 1); #endif From owner-svn-src-head@freebsd.org Sun Jan 5 00:59:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AA041ECA71; Sun, 5 Jan 2020 00:59:48 +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 47r0fW6rcHz4rL5; Sun, 5 Jan 2020 00:59:47 +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 E63A31D8D8; Sun, 5 Jan 2020 00:59:47 +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 0050xlcP031333; Sun, 5 Jan 2020 00:59:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0050xlfe031331; Sun, 5 Jan 2020 00:59:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001050059.0050xlfe031331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 00:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356363 - in head/sys: kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys ufs/ffs X-SVN-Commit-Revision: 356363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 00:59:48 -0000 Author: mjg Date: Sun Jan 5 00:59:47 2020 New Revision: 356363 URL: https://svnweb.freebsd.org/changeset/base/356363 Log: vfs: drop thread argument from vinactive Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 5 00:59:16 2020 (r356362) +++ head/sys/kern/vfs_subr.c Sun Jan 5 00:59:47 2020 (r356363) @@ -2895,7 +2895,7 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat refcount_acquire(&vp->v_usecount); if (oweinact && VOP_ISLOCKED(vp) == LK_EXCLUSIVE && (flags & LK_NOWAIT) == 0) - vinactive(vp, curthread); + vinactive(vp); VI_UNLOCK(vp); return (0); } @@ -3061,7 +3061,7 @@ vputx(struct vnode *vp, enum vputx_op func) ("vnode with usecount and VI_OWEINACT set")); if (error == 0) { if (vp->v_iflag & VI_OWEINACT) - vinactive(vp, curthread); + vinactive(vp); if (func != VPUTX_VUNREF) VOP_UNLOCK(vp); } @@ -3280,7 +3280,7 @@ vdropl(struct vnode *vp) * failed lock upgrade. */ void -vinactive(struct vnode *vp, struct thread *td) +vinactive(struct vnode *vp) { struct vm_object *obj; @@ -3308,7 +3308,7 @@ vinactive(struct vnode *vp, struct thread *td) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); } - VOP_INACTIVE(vp, td); + VOP_INACTIVE(vp, curthread); VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); @@ -3604,7 +3604,7 @@ vgonel(struct vnode *vp) if (oweinact || active) { VI_LOCK(vp); if ((vp->v_iflag & VI_DOINGINACT) == 0) - vinactive(vp, td); + vinactive(vp); VI_UNLOCK(vp); } if (vp->v_type == VSOCK) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Jan 5 00:59:16 2020 (r356362) +++ head/sys/sys/vnode.h Sun Jan 5 00:59:47 2020 (r356363) @@ -663,7 +663,7 @@ void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdl(struct vnode *); void vholdnz(struct vnode *); -void vinactive(struct vnode *, struct thread *); +void vinactive(struct vnode *vp); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, off_t length, int blksize); void v_inval_buf_range(struct vnode *vp, daddr_t startlbn, daddr_t endlbn, Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Jan 5 00:59:16 2020 (r356362) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Jan 5 00:59:47 2020 (r356363) @@ -2552,10 +2552,8 @@ process_deferred_inactive(struct mount *mp) { struct vnode *vp, *mvp; struct inode *ip; - struct thread *td; int error; - td = curthread; (void) vn_start_secondary_write(NULL, &mp, V_WAIT); loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { @@ -2591,7 +2589,7 @@ process_deferred_inactive(struct mount *mp) vdrop(vp); continue; } - vinactive(vp, td); + vinactive(vp); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("process_deferred_inactive: got VI_OWEINACT")); VI_UNLOCK(vp); From owner-svn-src-head@freebsd.org Sun Jan 5 01:00:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 400E01ECB38; Sun, 5 Jan 2020 01:00: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 47r0g00pXxz4rSw; Sun, 5 Jan 2020 01:00: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 170431D8E1; Sun, 5 Jan 2020 01:00: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 00510BWQ031471; Sun, 5 Jan 2020 01:00:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00510B4i031470; Sun, 5 Jan 2020 01:00:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001050100.00510B4i031470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 01:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356364 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 01:00:12 -0000 Author: mjg Date: Sun Jan 5 01:00:11 2020 New Revision: 356364 URL: https://svnweb.freebsd.org/changeset/base/356364 Log: vfs: factor out avoidable branches in _vn_lock Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Jan 5 00:59:47 2020 (r356363) +++ head/sys/kern/vfs_vnops.c Sun Jan 5 01:00:11 2020 (r356364) @@ -1564,28 +1564,53 @@ vn_poll(struct file *fp, int events, struct ucred *act * Acquire the requested lock and then check for validity. LK_RETRY * permits vn_lock to return doomed vnodes. */ -int -_vn_lock(struct vnode *vp, int flags, char *file, int line) +static int __noinline +_vn_lock_fallback(struct vnode *vp, int flags, char *file, int line, int error) { - int error; - VNASSERT((flags & LK_TYPE_MASK) != 0, vp, - ("vn_lock: no locktype")); - VNASSERT(vp->v_holdcnt != 0, vp, ("vn_lock: zero hold count")); -retry: - error = VOP_LOCK1(vp, flags, file, line); - flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ KASSERT((flags & LK_RETRY) == 0 || error == 0, ("vn_lock: error %d incompatible with flags %#x", error, flags)); + if (error == 0) + VNASSERT(VN_IS_DOOMED(vp), vp, ("vnode not doomed")); + if ((flags & LK_RETRY) == 0) { - if (error == 0 && VN_IS_DOOMED(vp)) { + if (error == 0) { VOP_UNLOCK(vp); error = ENOENT; } - } else if (error != 0) - goto retry; - return (error); + return (error); + } + + /* + * LK_RETRY case. + * + * Nothing to do if we got the lock. + */ + if (error == 0) + return (0); + + /* + * Interlock was dropped by the call in _vn_lock. + */ + flags &= ~LK_INTERLOCK; + do { + error = VOP_LOCK1(vp, flags, file, line); + } while (error != 0); + return (0); +} + +int +_vn_lock(struct vnode *vp, int flags, char *file, int line) +{ + int error; + + VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("vn_lock: no locktype")); + VNASSERT(vp->v_holdcnt != 0, vp, ("vn_lock: zero hold count")); + error = VOP_LOCK1(vp, flags, file, line); + if (__predict_false(error != 0 || VN_IS_DOOMED(vp))) + return (_vn_lock_fallback(vp, flags, file, line, error)); + return (0); } /* From owner-svn-src-head@freebsd.org Sun Jan 5 01:33:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F6F11F03ED; Sun, 5 Jan 2020 01:33:17 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47r1P93YBpz4t1R; Sun, 5 Jan 2020 01:33:17 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 85B4E170E3; Sun, 5 Jan 2020 01:33:16 +0000 (UTC) Date: Sun, 5 Jan 2020 01:33:15 +0000 From: Mark Linimon To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356348 - in head/sys: kern vm Message-ID: <20200105013314.GA3681@lonesome.com> References: <202001040315.0043FYhn047977@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001040315.0043FYhn047977@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 47r1P93YBpz4t1R 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 01:33:17 -0000 On Sat, Jan 04, 2020 at 03:15:34AM +0000, Jeff Roberson wrote: > Use a separate lock for the zone and keg. Out of curiosity, will there be measurable real-world speedups from this an similar work, or will this mostly apply to edge cases, or ... ? mcl From owner-svn-src-head@freebsd.org Sun Jan 5 01:42:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A50611F12AA; Sun, 5 Jan 2020 01:42:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47r1bf4jGbz4tcq; Sun, 5 Jan 2020 01:42:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C96D1E11F; Sun, 5 Jan 2020 01:42:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0051gMJX060781; Sun, 5 Jan 2020 01:42:22 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0051gLaj060774; Sun, 5 Jan 2020 01:42:21 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202001050142.0051gLaj060774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 5 Jan 2020 01:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356366 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 356366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 01:42:22 -0000 Author: mm Date: Sun Jan 5 01:42:21 2020 New Revision: 356366 URL: https://svnweb.freebsd.org/changeset/base/356366 Log: MFV r356365: Sync libarchive with vendor Relevant vendor changes: Issue #1302: Plug memory leak on failure of archive_write_client_open() Modified: head/contrib/libarchive/libarchive/archive_cryptor.c head/contrib/libarchive/libarchive/archive_cryptor_private.h head/contrib/libarchive/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_digest_private.h head/contrib/libarchive/libarchive/archive_hmac.c head/contrib/libarchive/libarchive/archive_hmac_private.h head/contrib/libarchive/libarchive/archive_write.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_cryptor.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_cryptor.c Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_cryptor.c Sun Jan 5 01:42:21 2020 (r356366) @@ -85,6 +85,35 @@ pbkdf2_sha1(const char *pw, size_t pw_len, const uint8 return (BCRYPT_SUCCESS(status)) ? 0: -1; } +#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_PKCS5_H) + +static int +pbkdf2_sha1(const char *pw, size_t pw_len, const uint8_t *salt, + size_t salt_len, unsigned rounds, uint8_t *derived_key, + size_t derived_key_len) +{ + mbedtls_md_context_t ctx; + const mbedtls_md_info_t *info; + int ret; + + mbedtls_md_init(&ctx); + info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); + if (info == NULL) { + mbedtls_md_free(&ctx); + return (-1); + } + ret = mbedtls_md_setup(&ctx, info, 1); + if (ret != 0) { + mbedtls_md_free(&ctx); + return (-1); + } + ret = mbedtls_pkcs5_pbkdf2_hmac(&ctx, (const unsigned char *)pw, + pw_len, salt, salt_len, rounds, derived_key_len, derived_key); + + mbedtls_md_free(&ctx); + return (ret); +} + #elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_PBKDF2_H) static int @@ -265,6 +294,38 @@ aes_ctr_release(archive_crypto_ctx *ctx) HeapFree(GetProcessHeap(), 0, ctx->keyObj); ctx->keyObj = NULL; } + memset(ctx, 0, sizeof(*ctx)); + return 0; +} + +#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H) +static int +aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) +{ + mbedtls_aes_init(&ctx->ctx); + ctx->key_len = key_len; + memcpy(ctx->key, key, key_len); + memset(ctx->nonce, 0, sizeof(ctx->nonce)); + ctx->encr_pos = AES_BLOCK_SIZE; + return 0; +} + +static int +aes_ctr_encrypt_counter(archive_crypto_ctx *ctx) +{ + if (mbedtls_aes_setkey_enc(&ctx->ctx, ctx->key, + ctx->key_len * 8) != 0) + return (-1); + if (mbedtls_aes_crypt_ecb(&ctx->ctx, MBEDTLS_AES_ENCRYPT, ctx->nonce, + ctx->encr_buf) != 0) + return (-1); + return 0; +} + +static int +aes_ctr_release(archive_crypto_ctx *ctx) +{ + mbedtls_aes_free(&ctx->ctx); memset(ctx, 0, sizeof(*ctx)); return 0; } Modified: head/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_cryptor_private.h Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_cryptor_private.h Sun Jan 5 01:42:21 2020 (r356366) @@ -83,6 +83,23 @@ typedef struct { unsigned encr_pos; } archive_crypto_ctx; +#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H) +#include +#include +#include + +#define AES_MAX_KEY_SIZE 32 +#define AES_BLOCK_SIZE 16 + +typedef struct { + mbedtls_aes_context ctx; + uint8_t key[AES_MAX_KEY_SIZE]; + unsigned key_len; + uint8_t nonce[AES_BLOCK_SIZE]; + uint8_t encr_buf[AES_BLOCK_SIZE]; + unsigned encr_pos; +} archive_crypto_ctx; + #elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_AES_H) #if defined(HAVE_NETTLE_PBKDF2_H) #include Modified: head/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_digest.c Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_digest.c Sun Jan 5 01:42:21 2020 (r356366) @@ -178,6 +178,40 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) + +static int +__archive_mbedtls_md5init(archive_md5_ctx *ctx) +{ + mbedtls_md5_init(ctx); + if (mbedtls_md5_starts_ret(ctx) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +{ + if (mbedtls_md5_finish_ret(ctx, md) == 0) { + mbedtls_md5_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_md5_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int @@ -335,6 +369,40 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) + +static int +__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +{ + mbedtls_ripemd160_init(ctx); + if (mbedtls_ripemd160_starts_ret(ctx) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +{ + if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { + mbedtls_ripemd160_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_ripemd160_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int @@ -491,6 +559,40 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) + +static int +__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +{ + mbedtls_sha1_init(ctx); + if (mbedtls_sha1_starts_ret(ctx) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +{ + if (mbedtls_sha1_finish_ret(ctx, md) == 0) { + mbedtls_sha1_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_sha1_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int @@ -720,6 +822,40 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) + +static int +__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +{ + mbedtls_sha256_init(ctx); + if (mbedtls_sha256_starts_ret(ctx, 0) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +{ + if (mbedtls_sha256_finish_ret(ctx, md) == 0) { + mbedtls_sha256_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_sha256_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int @@ -921,6 +1057,40 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) + +static int +__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +{ + mbedtls_sha512_init(ctx); + if (mbedtls_sha512_starts_ret(ctx, 1) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha384final(archive_sha384_ctx *ctx, void *md) +{ + if (mbedtls_sha512_finish_ret(ctx, md) == 0) { + mbedtls_sha512_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_sha512_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE) static int @@ -1146,6 +1316,40 @@ __archive_libsystem_sha512final(archive_sha512_ctx *ct return (ARCHIVE_OK); } +#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) + +static int +__archive_mbedtls_sha512init(archive_sha512_ctx *ctx) +{ + mbedtls_sha512_init(ctx); + if (mbedtls_sha512_starts_ret(ctx, 0) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha512update(archive_sha512_ctx *ctx, const void *indata, + size_t insize) +{ + if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0) + return (ARCHIVE_OK); + else + return (ARCHIVE_FATAL); +} + +static int +__archive_mbedtls_sha512final(archive_sha512_ctx *ctx, void *md) +{ + if (mbedtls_sha512_finish_ret(ctx, md) == 0) { + mbedtls_sha512_free(ctx); + return (ARCHIVE_OK); + } else { + mbedtls_sha512_free(ctx); + return (ARCHIVE_FATAL); + } +} + #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE) static int @@ -1276,6 +1480,10 @@ const struct archive_digest __archive_digest = &__archive_libsystem_md5init, &__archive_libsystem_md5update, &__archive_libsystem_md5final, +#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) + &__archive_mbedtls_md5init, + &__archive_mbedtls_md5update, + &__archive_mbedtls_md5final, #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) &__archive_nettle_md5init, &__archive_nettle_md5update, @@ -1303,6 +1511,10 @@ const struct archive_digest __archive_digest = &__archive_libmd_ripemd160init, &__archive_libmd_ripemd160update, &__archive_libmd_ripemd160final, +#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) + &__archive_mbedtls_ripemd160init, + &__archive_mbedtls_ripemd160update, + &__archive_mbedtls_ripemd160final, #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) &__archive_nettle_ripemd160init, &__archive_nettle_ripemd160update, @@ -1330,6 +1542,10 @@ const struct archive_digest __archive_digest = &__archive_libsystem_sha1init, &__archive_libsystem_sha1update, &__archive_libsystem_sha1final, +#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) + &__archive_mbedtls_sha1init, + &__archive_mbedtls_sha1update, + &__archive_mbedtls_sha1final, #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) &__archive_nettle_sha1init, &__archive_nettle_sha1update, @@ -1369,6 +1585,10 @@ const struct archive_digest __archive_digest = &__archive_libsystem_sha256init, &__archive_libsystem_sha256update, &__archive_libsystem_sha256final, +#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) + &__archive_mbedtls_sha256init, + &__archive_mbedtls_sha256update, + &__archive_mbedtls_sha256final, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) &__archive_nettle_sha256init, &__archive_nettle_sha256update, @@ -1404,6 +1624,10 @@ const struct archive_digest __archive_digest = &__archive_libsystem_sha384init, &__archive_libsystem_sha384update, &__archive_libsystem_sha384final, +#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) + &__archive_mbedtls_sha384init, + &__archive_mbedtls_sha384update, + &__archive_mbedtls_sha384final, #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE) &__archive_nettle_sha384init, &__archive_nettle_sha384update, @@ -1443,6 +1667,10 @@ const struct archive_digest __archive_digest = &__archive_libsystem_sha512init, &__archive_libsystem_sha512update, &__archive_libsystem_sha512final +#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) + &__archive_mbedtls_sha512init, + &__archive_mbedtls_sha512update, + &__archive_mbedtls_sha512final #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE) &__archive_nettle_sha512init, &__archive_nettle_sha512update, Modified: head/contrib/libarchive/libarchive/archive_digest_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_digest_private.h Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_digest_private.h Sun Jan 5 01:42:21 2020 (r356366) @@ -112,6 +112,24 @@ #include #endif +/* mbed TLS crypto headers */ +#if defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) +#include +#endif +#if defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) +#include +#endif +#if defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) +#include +#endif +#if defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) +#include +#endif +#if defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) ||\ + defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) +#include +#endif + /* Nettle crypto headers */ #if defined(ARCHIVE_CRYPTO_MD5_NETTLE) #include @@ -159,6 +177,8 @@ typedef MD5_CTX archive_md5_ctx; typedef MD5_CTX archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) typedef CC_MD5_CTX archive_md5_ctx; +#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) +typedef mbedtls_md5_context archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) typedef struct md5_ctx archive_md5_ctx; #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) @@ -173,6 +193,8 @@ typedef unsigned char archive_md5_ctx; typedef RMD160_CTX archive_rmd160_ctx; #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) typedef RIPEMD160_CTX archive_rmd160_ctx; +#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) +typedef mbedtls_ripemd160_context archive_rmd160_ctx; #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) typedef struct ripemd160_ctx archive_rmd160_ctx; #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) @@ -187,6 +209,8 @@ typedef SHA1_CTX archive_sha1_ctx; typedef SHA1_CTX archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) typedef CC_SHA1_CTX archive_sha1_ctx; +#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) +typedef mbedtls_sha1_context archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) typedef struct sha1_ctx archive_sha1_ctx; #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) @@ -207,6 +231,8 @@ typedef SHA2_CTX archive_sha256_ctx; typedef SHA256_CTX archive_sha256_ctx; #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) typedef CC_SHA256_CTX archive_sha256_ctx; +#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) +typedef mbedtls_sha256_context archive_sha256_ctx; #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) typedef struct sha256_ctx archive_sha256_ctx; #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) @@ -225,6 +251,8 @@ typedef SHA384_CTX archive_sha384_ctx; typedef SHA2_CTX archive_sha384_ctx; #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) typedef CC_SHA512_CTX archive_sha384_ctx; +#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) +typedef mbedtls_sha512_context archive_sha384_ctx; #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE) typedef struct sha384_ctx archive_sha384_ctx; #elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) @@ -245,6 +273,8 @@ typedef SHA2_CTX archive_sha512_ctx; typedef SHA512_CTX archive_sha512_ctx; #elif defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM) typedef CC_SHA512_CTX archive_sha512_ctx; +#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) +typedef mbedtls_sha512_context archive_sha512_ctx; #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE) typedef struct sha512_ctx archive_sha512_ctx; #elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) @@ -259,6 +289,7 @@ typedef unsigned char archive_sha512_ctx; #if defined(ARCHIVE_CRYPTO_MD5_LIBC) ||\ defined(ARCHIVE_CRYPTO_MD5_LIBMD) || \ defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) ||\ + defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_MD5_NETTLE) ||\ defined(ARCHIVE_CRYPTO_MD5_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_MD5_WIN) @@ -272,6 +303,7 @@ typedef unsigned char archive_sha512_ctx; __archive_digest.md5update(ctx, buf, n) #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) ||\ + defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_RMD160_NETTLE) ||\ defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) #define ARCHIVE_HAS_RMD160 @@ -286,6 +318,7 @@ typedef unsigned char archive_sha512_ctx; #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) ||\ defined(ARCHIVE_CRYPTO_SHA1_LIBMD) || \ defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) ||\ + defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_SHA1_NETTLE) ||\ defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA1_WIN) @@ -303,6 +336,7 @@ typedef unsigned char archive_sha512_ctx; defined(ARCHIVE_CRYPTO_SHA256_LIBC3) ||\ defined(ARCHIVE_CRYPTO_SHA256_LIBMD) ||\ defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) ||\ + defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_SHA256_NETTLE) ||\ defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA256_WIN) @@ -319,6 +353,7 @@ typedef unsigned char archive_sha512_ctx; defined(ARCHIVE_CRYPTO_SHA384_LIBC2) ||\ defined(ARCHIVE_CRYPTO_SHA384_LIBC3) ||\ defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) ||\ + defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_SHA384_NETTLE) ||\ defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA384_WIN) @@ -336,6 +371,7 @@ typedef unsigned char archive_sha512_ctx; defined(ARCHIVE_CRYPTO_SHA512_LIBC3) ||\ defined(ARCHIVE_CRYPTO_SHA512_LIBMD) ||\ defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM) ||\ + defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) ||\ defined(ARCHIVE_CRYPTO_SHA512_NETTLE) ||\ defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA512_WIN) Modified: head/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_hmac.c Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_hmac.c Sun Jan 5 01:42:21 2020 (r356366) @@ -150,6 +150,52 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) } } +#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_MD_H) +static int +__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) +{ + const mbedtls_md_info_t *info; + int ret; + + mbedtls_md_init(ctx); + info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); + if (info == NULL) { + mbedtls_md_free(ctx); + return (-1); + } + ret = mbedtls_md_setup(ctx, info, 1); + if (ret != 0) { + mbedtls_md_free(ctx); + return (-1); + } + ret = mbedtls_md_hmac_starts(ctx, key, key_len); + if (ret != 0) { + mbedtls_md_free(ctx); + return (-1); + } + return 0; +} + +static void +__hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data, + size_t data_len) +{ + mbedtls_md_hmac_update(ctx, data, data_len); +} + +static void __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len) +{ + (void)out_len; /* UNUSED */ + + mbedtls_md_hmac_finish(ctx, out); +} + +static void __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) +{ + mbedtls_md_free(ctx); + memset(ctx, 0, sizeof(*ctx)); +} + #elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_HMAC_H) static int @@ -201,6 +247,7 @@ static void __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len) { unsigned int len = (unsigned int)*out_len; + HMAC_Final(*ctx, out, &len); *out_len = len; } Modified: head/contrib/libarchive/libarchive/archive_hmac_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_hmac_private.h Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_hmac_private.h Sun Jan 5 01:42:21 2020 (r356366) @@ -64,6 +64,11 @@ typedef struct { } archive_hmac_sha1_ctx; +#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_MD_H) +#include + +typedef mbedtls_md_context_t archive_hmac_sha1_ctx; + #elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_HMAC_H) #include Modified: head/contrib/libarchive/libarchive/archive_write.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write.c Sun Jan 5 01:30:41 2020 (r356365) +++ head/contrib/libarchive/libarchive/archive_write.c Sun Jan 5 01:42:21 2020 (r356366) @@ -449,6 +449,30 @@ archive_write_client_write(struct archive_write_filter } static int +archive_write_client_free(struct archive_write_filter *f) +{ + struct archive_write *a = (struct archive_write *)f->archive; + struct archive_none *state = (struct archive_none *)f->data; + + if (state != NULL) { + free(state->buffer); + free(state); + state = NULL; + } + + a->client_data = NULL; + /* Clear passphrase. */ + if (a->passphrase != NULL) { + memset(a->passphrase, 0, strlen(a->passphrase)); + free(a->passphrase); + a->passphrase = NULL; + } + + return (ARCHIVE_OK); +} + + +static int archive_write_client_close(struct archive_write_filter *f) { struct archive_write *a = (struct archive_write *)f->archive; @@ -484,17 +508,9 @@ archive_write_client_close(struct archive_write_filter } if (a->client_closer) (*a->client_closer)(&a->archive, a->client_data); - free(state->buffer); - free(state); + /* Clear the close handler myself not to be called again. */ f->state = ARCHIVE_WRITE_FILTER_STATE_CLOSED; - a->client_data = NULL; - /* Clear passphrase. */ - if (a->passphrase != NULL) { - memset(a->passphrase, 0, strlen(a->passphrase)); - free(a->passphrase); - a->passphrase = NULL; - } return (ret); } @@ -523,6 +539,7 @@ archive_write_open(struct archive *_a, void *client_da client_filter->open = archive_write_client_open; client_filter->write = archive_write_client_write; client_filter->close = archive_write_client_close; + client_filter->free = archive_write_client_free; ret = __archive_write_filters_open(a); if (ret < ARCHIVE_WARN) { From owner-svn-src-head@freebsd.org Sun Jan 5 02:47:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 504861F6F12; Sun, 5 Jan 2020 02:47:57 +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 47r33K1SlNz3DdF; Sun, 5 Jan 2020 02:47:57 +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 2D1981ED3E; Sun, 5 Jan 2020 02:47:57 +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 0052lv6a098032; Sun, 5 Jan 2020 02:47:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0052lu11098031; Sun, 5 Jan 2020 02:47:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001050247.0052lu11098031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 02:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356367 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 356367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 02:47:57 -0000 Author: emaste Date: Sun Jan 5 02:47:56 2020 New Revision: 356367 URL: https://svnweb.freebsd.org/changeset/base/356367 Log: Do not build GCC 4.2.1 by default for any CPU architecture By default set to NO: GCC GCC_BOOTSTRAP GNUCXX As described by imp@ on the freebsd-arch mailing list Aug 13, 2019 with Subject: Gcc 4.2.1 to be removed before FreeBSD 13, a firm timeline https://lists.freebsd.org/pipermail/freebsd-arch/2019-August/019674.html Reviewed by: jhb, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23026 Modified: head/UPDATING head/share/mk/src.opts.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jan 5 01:42:21 2020 (r356366) +++ head/UPDATING Sun Jan 5 02:47:56 2020 (r356367) @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200104: + GCC 4.2.1 is now not built by default, as part of the GCC 4.2.1 + retirement plan. Specifically, the GCC, GCC_BOOTSTRAP, and GNUCXX + options default to off for all supported CPU architectures. As a + short-term transition aid they may be enabled via WITH_* options. + GCC 4.2.1 is expected to be removed from the tree on 2020-03-31. + 20200102: Support for armv5 has been disconnected and is being removed. The machine combination MACHINE=arm MACHINE_ARCH=arm is no longer valid. Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 5 01:42:21 2020 (r356366) +++ head/share/mk/src.opts.mk Sun Jan 5 02:47:56 2020 (r356367) @@ -199,6 +199,9 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ DTRACE_TESTS \ EXPERIMENTAL \ + GCC \ + GCC_BOOTSTRAP \ + GNUCXX \ GNU_GREP_COMPAT \ GPL_DTC \ HESIOD \ @@ -297,24 +300,22 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF .include -# If the compiler is not C++11 capable, disable Clang and use GCC instead. -# This means that architectures that have GCC 4.2 as default can not -# build Clang without using an external compiler. +# If the compiler is not C++11 capable, disable Clang. External toolchain will +# be required. .if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && \ ${__TT} != "riscv" && ${__TT} != "sparc64") # Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD -__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX .elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64" # If an external compiler that supports C++11 is used as ${CC} and Clang -# supports the target, then Clang is enabled but GCC is installed as the +# supports the target, then Clang is enabled but we still require an external +# toolchain. # default /usr/bin/cc. -__DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX LLD +__DEFAULT_YES_OPTIONS+=CLANG LLD __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else # Everything else disables Clang, and uses GCC instead. -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD .endif # In-tree binutils/gcc are older versions without modern architecture support. From owner-svn-src-head@freebsd.org Sun Jan 5 02:57:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 009AC1F7BB2; Sun, 5 Jan 2020 02:57:48 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47r3Gh5BtCz3F2T; Sun, 5 Jan 2020 02:57:48 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id AE0A7170E3; Sun, 5 Jan 2020 02:57:47 +0000 (UTC) Date: Sun, 5 Jan 2020 02:57:46 +0000 From: Mark Linimon To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356367 - in head: . share/mk Message-ID: <20200105025745.GA8991@lonesome.com> References: <202001050247.0052lu11098031@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001050247.0052lu11098031@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 47r3Gh5BtCz3F2T 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 02:57:49 -0000 On Sun, Jan 05, 2020 at 02:47:56AM +0000, Ed Maste wrote: > Do not build GCC 4.2.1 by default for any CPU architecture And there was much rejoicing :-) (but plz not to MFC tnx) mcl From owner-svn-src-head@freebsd.org Sun Jan 5 03:00:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B15F81D005B; Sun, 5 Jan 2020 03:00:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47r3Kl3tj4z3FBL; Sun, 5 Jan 2020 03:00:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66D111EF33; Sun, 5 Jan 2020 03:00:27 +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 00530RY0004039; Sun, 5 Jan 2020 03:00:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00530Qdf004034; Sun, 5 Jan 2020 03:00:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001050300.00530Qdf004034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 03:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356368 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 356368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 03:00:27 -0000 Author: emaste Date: Sun Jan 5 03:00:26 2020 New Revision: 356368 URL: https://svnweb.freebsd.org/changeset/base/356368 Log: Adjust WITH_/WITHOUT_ descriptions for GCC options after r356367 The options default to NO on all archs now, and will be removed before FreeBSD 13. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP head/tools/build/options/WITHOUT_GNUCXX head/tools/build/options/WITH_GCC head/tools/build/options/WITH_GCC_BOOTSTRAP head/tools/build/options/WITH_GNUCXX Modified: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_GCC_BOOTSTRAP Sun Jan 5 02:47:56 2020 (r356367) +++ head/tools/build/options/WITHOUT_GCC_BOOTSTRAP Sun Jan 5 03:00:26 2020 (r356368) @@ -1,5 +1,2 @@ .\" $FreeBSD$ Set to not build gcc and g++ as part of the bootstrap process. -You must enable either gcc or clang bootstrap to be able to build the system, -unless an alternative compiler is provided via -XCC. Modified: head/tools/build/options/WITHOUT_GNUCXX ============================================================================== --- head/tools/build/options/WITHOUT_GNUCXX Sun Jan 5 02:47:56 2020 (r356367) +++ head/tools/build/options/WITHOUT_GNUCXX Sun Jan 5 03:00:26 2020 (r356368) @@ -1,3 +1,2 @@ .\" $FreeBSD$ Do not build the GNU C++ stack (g++, libstdc++). -This is the default on platforms where clang is the system compiler. Modified: head/tools/build/options/WITH_GCC ============================================================================== --- head/tools/build/options/WITH_GCC Sun Jan 5 02:47:56 2020 (r356367) +++ head/tools/build/options/WITH_GCC Sun Jan 5 03:00:26 2020 (r356368) @@ -1,2 +1,4 @@ .\" $FreeBSD$ Set to build and install gcc and g++. +This option is deprecated and will be removed before +.Fx 13 . Modified: head/tools/build/options/WITH_GCC_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITH_GCC_BOOTSTRAP Sun Jan 5 02:47:56 2020 (r356367) +++ head/tools/build/options/WITH_GCC_BOOTSTRAP Sun Jan 5 03:00:26 2020 (r356368) @@ -1,2 +1,4 @@ .\" $FreeBSD$ Set to build gcc and g++ as part of the bootstrap process. +This option is deprecated and will be removed before +.Fx 13 . Modified: head/tools/build/options/WITH_GNUCXX ============================================================================== --- head/tools/build/options/WITH_GNUCXX Sun Jan 5 02:47:56 2020 (r356367) +++ head/tools/build/options/WITH_GNUCXX Sun Jan 5 03:00:26 2020 (r356368) @@ -1,3 +1,4 @@ .\" $FreeBSD$ Build the GNU C++ stack (g++, libstdc++). -This is the default on platforms where gcc is the system compiler. +This option is deprecated and will be removed before +.Fx 13 . From owner-svn-src-head@freebsd.org Sun Jan 5 03:01:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 953BA1D05DF; Sun, 5 Jan 2020 03:01:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (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 47r3Lp4GG7z3FpC; Sun, 5 Jan 2020 03:01:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f175.google.com with SMTP id f10so39662773ils.8; Sat, 04 Jan 2020 19:01:22 -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=9V8ieWMsLMmPwVJYw0+RiqGryBckXymnqcQoUtOwVBI=; b=fGMbmVYUhV2OZgVc3bc4ml99eN8cwXp4DerbDO49nPUVl1YCqIjKYu42DnE8TXh3EY ZMCSgjabVWEGpff9FLK4yXhvwcRf+q9i/l3dgR6asMybktS+0tZSobIlTa1UVFbVatn5 iaadskvjt1h6G54ZsVs5tixt68w7s1F/5rhAFi4d21SPTtvZu0JIsHLmlt8DG5QswdKE k432EC7QI5ou/vHHyKtrwIFEukAqqCWEB7uUzixusHkYb/QUD7XHvtiYihZBEd41dcyy 5kHUwXM1P8+aPDqCg+Yl05P8mi/hm3XT2YTdpeSUF0fWmrLxkiuVG67pkqXMeRXSkFvT WXEA== X-Gm-Message-State: APjAAAUt5bCEKHJJiXkB+Xus6F94CQhRSNc6Q20Yv8jnPnVeM7S7nwDn bw1URIf4SOgb7wseDdje935yApvasv2S8/2Z7LMxKQ== X-Google-Smtp-Source: APXvYqyjAYJ1oc2jJKWbo37EZk5kAhcN5rRGs4+GnI3zc2KsQP6jbfi8Ny7hfi1SAUCUW9rQyIb/1jh4cKO0vibBXvo= X-Received: by 2002:a92:5c52:: with SMTP id q79mr67701356ilb.11.1578193281159; Sat, 04 Jan 2020 19:01:21 -0800 (PST) MIME-Version: 1.0 References: <202001050247.0052lu11098031@repo.freebsd.org> <20200105025745.GA8991@lonesome.com> In-Reply-To: <20200105025745.GA8991@lonesome.com> From: Ed Maste Date: Sat, 4 Jan 2020 22:01:09 -0500 Message-ID: Subject: Re: svn commit: r356367 - in head: . share/mk To: Mark Linimon Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47r3Lp4GG7z3FpC X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.175 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.00 / 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[175.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.00)[ip: (-4.98), ipnet: 209.85.128.0/17(-3.11), asn: 15169(-1.86), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[175.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 03:01:23 -0000 On Sat, 4 Jan 2020 at 21:57, Mark Linimon wrote: > > On Sun, Jan 05, 2020 at 02:47:56AM +0000, Ed Maste wrote: > > Do not build GCC 4.2.1 by default for any CPU architecture > > And there was much rejoicing :-) > > (but plz not to MFC tnx) Indeed, I should have tagged it with: Relnotes: YES MFC after: never From owner-svn-src-head@freebsd.org Sun Jan 5 03:03:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45D3D1D0B8C; Sun, 5 Jan 2020 03:03:35 +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 47r3PM19Gdz3GGq; Sun, 5 Jan 2020 03:03:35 +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 225E11F194; Sun, 5 Jan 2020 03:03:35 +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 00533Z1b010857; Sun, 5 Jan 2020 03:03:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00533Z3G010856; Sun, 5 Jan 2020 03:03:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001050303.00533Z3G010856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 03:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356369 - 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: 356369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 03:03:35 -0000 Author: emaste Date: Sun Jan 5 03:03:34 2020 New Revision: 356369 URL: https://svnweb.freebsd.org/changeset/base/356369 Log: src.conf.5: regen after r356367, default to GCC off Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jan 5 03:00:26 2020 (r356368) +++ head/share/man/man5/src.conf.5 Sun Jan 5 03:03:34 2020 (r356369) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 3, 2020 +.Dd January 4, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -726,29 +726,14 @@ and .Xr ftpd 8 . .It Va WITHOUT_GAMES Set to not build games. -.It Va WITHOUT_GCC -Set to not build and install gcc and g++ as part of the normal build process. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC Set to build and install gcc and g++. -.Pp -This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. -.It Va WITHOUT_GCC_BOOTSTRAP -Set to not build gcc and g++ as part of the bootstrap process. -You must enable either gcc or clang bootstrap to be able to build the system, -unless an alternative compiler is provided via -XCC. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +This option is deprecated and will be removed before +.Fx 13 . .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. -.Pp -This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +This option is deprecated and will be removed before +.Fx 13 . .It Va WITHOUT_GCOV Set to not build the .Xr gcov 1 @@ -786,18 +771,10 @@ if a newer version is not installed. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. -.It Va WITHOUT_GNUCXX -Do not build the GNU C++ stack (g++, libstdc++). -This is the default on platforms where clang is the system compiler. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). -This is the default on platforms where gcc is the system compiler. -.Pp -This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +This option is deprecated and will be removed before +.Fx 13 . .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 From owner-svn-src-head@freebsd.org Sun Jan 5 03:08:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3737F1D1412; Sun, 5 Jan 2020 03:08:00 +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 47r3VS0hDcz3GWW; Sun, 5 Jan 2020 03:08:00 +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 123651F1AA; Sun, 5 Jan 2020 03:08:00 +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 00537xce011112; Sun, 5 Jan 2020 03:07:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00537xae011111; Sun, 5 Jan 2020 03:07:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001050307.00537xae011111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 03:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356370 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 356370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 03:08:00 -0000 Author: emaste Date: Sun Jan 5 03:07:59 2020 New Revision: 356370 URL: https://svnweb.freebsd.org/changeset/base/356370 Log: arch.7: update to show mips* and sparc64 use external GCC after r356367 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun Jan 5 03:03:34 2020 (r356369) +++ head/share/man/man7/arch.7 Sun Jan 5 03:07:59 2020 (r356370) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2020 +.Dd January 4, 2020 .Dt ARCH 7 .Os .Sh NAME @@ -307,21 +307,21 @@ This table shows the default tool chain for each archi .It armv6 Ta Clang Ta lld .It armv7 Ta Clang Ta lld .It i386 Ta Clang Ta lld -.It mips Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mipsel Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mipselhf Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mipshf Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mipsn32 Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mips64 Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mips64el Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mips64elhf Ta GCC 4.2.1 Ta GNU ld 2.17.50 -.It mips64hf Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It mips Ta GCC(1) Ta GNU ld 2.17.50 +.It mipsel Ta GCC(1) Ta GNU ld 2.17.50 +.It mipselhf Ta GCC(1) Ta GNU ld 2.17.50 +.It mipshf Ta GCC(1) Ta GNU ld 2.17.50 +.It mipsn32 Ta GCC(1) Ta GNU ld 2.17.50 +.It mips64 Ta GCC(1) Ta GNU ld 2.17.50 +.It mips64el Ta GCC(1) Ta GNU ld 2.17.50 +.It mips64elhf Ta GCC(1) Ta GNU ld 2.17.50 +.It mips64hf Ta GCC(1) Ta GNU ld 2.17.50 .It powerpc Ta Clang Ta GNU ld 2.17.50 .It powerpcspe Ta Clang Ta GNU ld 2.17.50 .It powerpc64 Ta Clang Ta lld .It riscv64 Ta GCC(1) Ta GNU ld(1) .It riscv64sf Ta GCC(1) Ta GNU ld(1) -.It sparc64 Ta GCC 4.2.1 Ta GNU ld 2.17.50 +.It sparc64 Ta GCC(1) Ta GNU ld 2.17.50 .El .Pp (1) External toolchain provided by ports/packages. From owner-svn-src-head@freebsd.org Sun Jan 5 03:15:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 716C81D1FBD; Sun, 5 Jan 2020 03:15: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 47r3fs290Hz3GwS; Sun, 5 Jan 2020 03:15:17 +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 4583B1F374; Sun, 5 Jan 2020 03:15:17 +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 0053FH3P017273; Sun, 5 Jan 2020 03:15:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0053FHcb017272; Sun, 5 Jan 2020 03:15:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001050315.0053FHcb017272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Jan 2020 03:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356371 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 03:15:17 -0000 Author: kevans Date: Sun Jan 5 03:15:16 2020 New Revision: 356371 URL: https://svnweb.freebsd.org/changeset/base/356371 Log: shmfd/mmap: restrict maxprot with MAP_SHARED + F_SEAL_WRITE If a write seal is set on a shared mapping, we must exclude VM_PROT_WRITE as the fd is effectively read-only. This was discovered by running devel/linux-ltp, which mmap's with acceptable protections specified then attempts to raise to PROT_READ|PROT_WRITE with mprotect(2), which we allowed. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22978 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Jan 5 03:07:59 2020 (r356370) +++ head/sys/kern/uipc_shm.c Sun Jan 5 03:15:16 2020 (r356371) @@ -1116,7 +1116,13 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a /* FREAD should always be set. */ if ((fp->f_flag & FREAD) != 0) maxprot |= VM_PROT_EXECUTE | VM_PROT_READ; - if ((fp->f_flag & FWRITE) != 0) + + /* + * If FWRITE's set, we can allow VM_PROT_WRITE unless it's a shared + * mapping with a write seal applied. + */ + if ((fp->f_flag & FWRITE) != 0 && ((flags & MAP_SHARED) == 0 || + (shmfd->shm_seals & F_SEAL_WRITE) == 0)) maxprot |= VM_PROT_WRITE; writecnt = (flags & MAP_SHARED) != 0 && (prot & VM_PROT_WRITE) != 0; From owner-svn-src-head@freebsd.org Sun Jan 5 04:06:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 528521D7706; Sun, 5 Jan 2020 04:06:41 +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 47r4p90yY5z3Jlr; Sun, 5 Jan 2020 04:06:41 +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 1480E1FCA5; Sun, 5 Jan 2020 04:06:41 +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 00546e6w047399; Sun, 5 Jan 2020 04:06:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00546eN9047396; Sun, 5 Jan 2020 04:06:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001050406.00546eN9047396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Jan 2020 04:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356372 - in head/sys: compat/cloudabi kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/cloudabi kern sys X-SVN-Commit-Revision: 356372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 04:06:41 -0000 Author: kevans Date: Sun Jan 5 04:06:40 2020 New Revision: 356372 URL: https://svnweb.freebsd.org/changeset/base/356372 Log: shm: correct KPI mistake introduced around memfd_create When file sealing and shm_open2 were introduced, we should have grown a new kern_shm_open2 helper that did the brunt of the work with the new interface while kern_shm_open remains the same. Instead, more complexity was introduced to kern_shm_open to handle the additional features and consumers had to keep changing in somewhat awkward ways, and a kern_shm_open2 was added to wrap kern_shm_open. Backpedal on this and correct the situation- kern_shm_open returns to the interface it had prior to file sealing being introduced, and neither function needs an initial_seals argument anymore as it's handled in kern_shm_open2 based on the shmflags. Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/kern/uipc_shm.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Sun Jan 5 03:15:16 2020 (r356371) +++ head/sys/compat/cloudabi/cloudabi_fd.c Sun Jan 5 04:06:40 2020 (r356372) @@ -96,7 +96,7 @@ cloudabi_sys_fd_create1(struct thread *td, cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); return (kern_shm_open(td, SHM_ANON, O_RDWR | O_CLOEXEC, 0, - &fcaps, F_SEAL_SEAL)); + &fcaps)); default: return (EINVAL); } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Jan 5 03:15:16 2020 (r356371) +++ head/sys/kern/uipc_shm.c Sun Jan 5 04:06:40 2020 (r356372) @@ -731,8 +731,8 @@ shm_remove(char *path, Fnv32_t fnv, struct ucred *ucre } int -kern_shm_open(struct thread *td, const char *userpath, int flags, mode_t mode, - struct filecaps *fcaps, int initial_seals) +kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, + int shmflags, struct filecaps *fcaps, const char *name __unused) { struct filedesc *fdp; struct shmfd *shmfd; @@ -741,8 +741,15 @@ kern_shm_open(struct thread *td, const char *userpath, void *rl_cookie; Fnv32_t fnv; mode_t cmode; - int fd, error; + int error, fd, initial_seals; + if ((shmflags & ~SHM_ALLOW_SEALING) != 0) + return (EINVAL); + + initial_seals = F_SEAL_SEAL; + if ((shmflags & SHM_ALLOW_SEALING) != 0) + initial_seals &= ~F_SEAL_SEAL; + #ifdef CAPABILITY_MODE /* * shm_open(2) is only allowed for anonymous objects. @@ -923,8 +930,8 @@ int freebsd12_shm_open(struct thread *td, struct freebsd12_shm_open_args *uap) { - return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC, uap->mode, - NULL, F_SEAL_SEAL)); + return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC, + uap->mode, NULL)); } #endif @@ -1476,18 +1483,11 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, posix_shm_list, "POSIX SHM list"); int -kern_shm_open2(struct thread *td, const char *path, int flags, mode_t mode, - int shmflags, const char *name __unused) +kern_shm_open(struct thread *td, const char *path, int flags, mode_t mode, + struct filecaps *caps) { - int initial_seals; - if ((shmflags & ~SHM_ALLOW_SEALING) != 0) - return (EINVAL); - - initial_seals = F_SEAL_SEAL; - if ((shmflags & SHM_ALLOW_SEALING) != 0) - initial_seals &= ~F_SEAL_SEAL; - return (kern_shm_open(td, path, flags, mode, NULL, initial_seals)); + return (kern_shm_open2(td, path, flags, mode, 0, caps, NULL)); } /* @@ -1505,5 +1505,5 @@ sys_shm_open2(struct thread *td, struct shm_open2_args { return (kern_shm_open2(td, uap->path, uap->flags, uap->mode, - uap->shmflags, uap->name)); + uap->shmflags, NULL, uap->name)); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Jan 5 03:15:16 2020 (r356371) +++ head/sys/sys/syscallsubr.h Sun Jan 5 04:06:40 2020 (r356372) @@ -257,9 +257,10 @@ int kern_setsockopt(struct thread *td, int s, int leve int kern_settimeofday(struct thread *td, struct timeval *tv, struct timezone *tzp); int kern_shm_open(struct thread *td, const char *userpath, int flags, - mode_t mode, struct filecaps *fcaps, int initial_seals); + mode_t mode, struct filecaps *fcaps); int kern_shm_open2(struct thread *td, const char *path, int flags, - mode_t mode, int shmflags, const char *name); + mode_t mode, int shmflags, struct filecaps *fcaps, + const char *name); int kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg); int kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, From owner-svn-src-head@freebsd.org Sun Jan 5 04:55:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E43991DD6CE; Sun, 5 Jan 2020 04:55:16 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 47r5tC4pWNz3Nsw; Sun, 5 Jan 2020 04:55:15 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 052E721B24; Sat, 4 Jan 2020 23:55:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 04 Jan 2020 23:55:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm2; bh=a PYNbb3HTJg2/529k2PxN/CivG8Q+RhhURXZOSo+O2g=; b=E6N/zTuaHTsjtxlo1 yCly5SAYEN0Mx6HAqgrl+qjK7R9XAZ1bEKH/hBKG7Bf90Vp324BkSFuQBAMrWSbG 5Ye9es8B2OkLLyhxaHnl4lTecRjv3/2s4dqJP1nSC78ZBla/n3eWfHXR5P7gOsIX Az6I5J7F/Xz/35mDQsU7qck/D9QAlLNcj16kDQhZEqlsP0ZHh7yuzr5ikrSoShZU +2Ssb30ySGzCkJGdwRgVlJHxwRkSMv4XghLbLeOTlRm9vaho/xvjPYeTqeQQuE3G eWq+g65bObSBgfp2e8/BKGkXkqWv5NK45EsFcA/KhTOVso6WTVdxclLaciIAWHM6 Z9UZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=aPYNbb3HTJg2/529k2PxN/CivG8Q+RhhURXZOSo+O 2g=; b=lWK98CRQaPEQbi52H7PZ3M0JSDQQK4UGbk+KHx/zhugEeAJuFRAl6jpOB 1pOCGlIF0HfmB5gmXhMNRYp5PLlOEKcSilG4ijRFMoTK81CTXZKMRlxW0RQD4b0I eKlcwRJEMIYFmqgaWK2AEw0mykK1zSZiZlOqIVbeV8PUPni1FA7z4dTnSMQAWtLC PgG/ZRN5b+o46bmiVrPgaRYWywQEEDjP82oZE2VDuc/CVIIYDDXPPmi0AjziC2Mr ZpM4QZYkPZrPPZJ0yz8i23K1xqqIm/Vej3IoCuRXBLughTzPjzdodEgkNljn2yNa mlIlnqmY+U76/apccmaHgQLTKlYzw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdegiedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtggfuhfgjfffgkfhfvffosehtje hmtdhhtddvnecuhfhrohhmpefutghothhtucfnohhnghcuoehstghothhtlhesshgrmhhs tghordhorhhgqeenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucfkphepudejge drvddvjedruddtrdduheenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehs rghmshgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [172.20.10.2] (15.sub-174-227-10.myvzw.com [174.227.10.15]) by mail.messagingengine.com (Postfix) with ESMTPA id 3CA4280060; Sat, 4 Jan 2020 23:55:14 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r356192 - head/sys/geom From: Scott Long In-Reply-To: <201912300046.xBU0kAhm035303@repo.freebsd.org> Date: Sat, 4 Jan 2020 23:55:13 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201912300046.xBU0kAhm035303@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47r5tC4pWNz3Nsw X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm2 header.b=E6N/zTua; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=lWK98CRQ; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.28 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-5.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm2,messagingengine.com:s=fm1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.28]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; DMARC_NA(0.00)[samsco.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; RWL_MAILSPIKE_GOOD(0.00)[28.4.111.66.rep.mailspike.net : 127.0.0.18]; IP_SCORE(-3.49)[ip: (-9.84), ipnet: 66.111.4.0/24(-4.88), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[28.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[15.10.227.174.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 04:55:17 -0000 Good job! > On Dec 29, 2019, at 7:46 PM, Alexander Motin wrote: > > Author: mav > Date: Mon Dec 30 00:46:10 2019 > New Revision: 356192 > URL: https://svnweb.freebsd.org/changeset/base/356192 > > Log: > Retire nstart/nend counters. > > Those counters were abused for decade to workaround broken orphanization > process in different classes by delaying the call while there are active > requests. But from one side it did not close all the races, while from > another was quite expensive on SMP due to trashing twice per request cache > lines of consumer and provider and requiring locks. It lost its sense > after I manually went through all the GEOM classes in base and made > orphanization wait for either provider close or request completion. > > Consumer counters are still used under INVARIANTS to detect premature > consumer close and detach. Provider counters are removed completely. > > Sponsored by: iXsystems, Inc. > > Modified: > head/sys/geom/geom.h > head/sys/geom/geom_event.c > head/sys/geom/geom_io.c > head/sys/geom/geom_subr.c From owner-svn-src-head@freebsd.org Sun Jan 5 08:35:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E7231F339C for ; Sun, 5 Jan 2020 08:35:00 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (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 47rBlk6LwJz43K2 for ; Sun, 5 Jan 2020 08:34:58 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pj1-x102a.google.com with SMTP id a6so6295705pjh.2 for ; Sun, 05 Jan 2020 00:34:58 -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=+vfTMhoycwapEZ+lyJ5+TT8Ek8FG4ALeeIW9XxUxs+k=; b=R5cvxoU4vP5AapabaLT8+X0jHXFCL40V+0t6WDcq0kZADothMVIm5KH5V4enuoV0P0 A04KCrZ+g6BqZRqnShVZLKI3KdSsrNoMFzlrTZHRjmd34RwRVeo06CmYqHBLxxOOsjWB fXQp62zZ8C0ZFO0B3lL1XZvWAGBH9CcvTh988Aka0YuMQx/rBRCTZCqkaLnWcYSy8dGl ykT+bRVHNeC724zNcE+4wi9uLz657TXGZYP8KQHyBdD7ssJZLJdMGBeelZDj48yq/R+G EiN+wPRiiCWauR7cKTJbgXUwGV4t6764a8itWf39oAah2vbHFdVvgQlUMNV3o3mCpSlu 6rZQ== 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=+vfTMhoycwapEZ+lyJ5+TT8Ek8FG4ALeeIW9XxUxs+k=; b=EUGWrCyXXcEJTZ8EITu9NWxvhNEaIt8RivMU0xI1GJ2lf/ln99ZlcBkWNJ9z5tmsxr 9b71LLKJwa+bGYW7FObLCmEYJvTTcSf9KELF1zv0f0PJzvrDMWaQttr07cG8I3oXZsU5 s10NRausoLE5kQ0+/eWZyB3B7BEV7X5Aj5YTcDSuOgbST9XE7n26QPsCmxQtSU6qvvZ4 tyC1FIMRLi0Y1TOpQ7HUsUA1pKnnbTkswYAs1H537h6LwZf1WJNLlwPjmJMahON3cT0M 2Twrgvn8Y8BLsKMJqxiRJU96MaUnIMQ8hAJOhYu17QxOtMbWzUBhI2uZGOBZNVJiCOb0 KqxQ== X-Gm-Message-State: APjAAAUwTthI1kTiZtwECg0zPj+V0J4FzW51m5e+0qOOfRUaNUS0RhBh vku6jLAwYqS23hSH5TVuJ5sYog== X-Google-Smtp-Source: APXvYqx+OvnGcaE4sqlsW4Xr4o72rQVubY1zFW+htY8g08jrgEy6ez1T0Y30lUZn/QQtAYn243LK7A== X-Received: by 2002:a17:90a:33ad:: with SMTP id n42mr36177086pjb.23.1578213291975; Sun, 05 Jan 2020 00:34:51 -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 2sm66910766pgo.79.2020.01.05.00.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jan 2020 00:34:51 -0800 (PST) Date: Sat, 4 Jan 2020 22:34:49 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Mark Linimon cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356348 - in head/sys: kern vm In-Reply-To: <20200105013314.GA3681@lonesome.com> Message-ID: References: <202001040315.0043FYhn047977@repo.freebsd.org> <20200105013314.GA3681@lonesome.com> 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: 47rBlk6LwJz43K2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=R5cvxoU4; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::102a) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.61 / 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-head@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:+]; 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.81)[ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.86), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 08:35:00 -0000 On Sun, 5 Jan 2020, Mark Linimon wrote: > On Sat, Jan 04, 2020 at 03:15:34AM +0000, Jeff Roberson wrote: >> Use a separate lock for the zone and keg. > > Out of curiosity, will there be measurable real-world speedups from > this an similar work, or will this mostly apply to edge cases, or ... ? It depends on which real world. A lot of workloads don't really show much allocator activity. For very high speed networking, and especially very high speed networking on big NUMA machines, the speedup is considerable. Netflix reported the earlier round of work cut the time spent in uma by about 30%. For non-numa machines the last ~6 patches cut another 30% off of that in my tests. Even for Netflix, uma was not in the top 5 of their profile before this work. The major perf upshot was somewhere around an 8x improvement when freeing on a different NUMA domain than you allocated from when the allocation policy is first-touch. This is called a cross-domain or 'xdomain' free in the code. This made it possible to enable first-touch for UMA by default on all NUMA machines. I wrote a simple allocator perf test that loops allocating 2k mbufs and appending them to a random remote core's queue after which it drains its local queue. 10 million iterations across 32 cores in two numa domains gives 320,000,000 packets allocated and freed. The time within the same domain was about 4 seconds, before this patch series going to a different domain was around 40 seconds and after it was around 5 seconds. So only a ~25% penalty when doing 2 million packets-per-second-per-core. Many of the recent changes were really as much about code organization and readability as performance. After 18 years of features coming and going, reorganizations, etc. it was getting a bit crufty. Jeff > > mcl > From owner-svn-src-head@freebsd.org Sun Jan 5 12:46:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00B4D1EBC8E; Sun, 5 Jan 2020 12:46: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 47rJL3608dz4Ggn; Sun, 5 Jan 2020 12:46: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 C8FDF25B32; Sun, 5 Jan 2020 12:46: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 005CkZ0f062527; Sun, 5 Jan 2020 12:46:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005CkZNj062526; Sun, 5 Jan 2020 12:46:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001051246.005CkZNj062526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 12:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356373 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 12:46:36 -0000 Author: mjg Date: Sun Jan 5 12:46:35 2020 New Revision: 356373 URL: https://svnweb.freebsd.org/changeset/base/356373 Log: Mark mtxpool_sleep as read mostly, not frequently. The latter is not justified. Modified: head/sys/kern/kern_mtxpool.c Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Sun Jan 5 04:06:40 2020 (r356372) +++ head/sys/kern/kern_mtxpool.c Sun Jan 5 12:46:35 2020 (r356373) @@ -82,7 +82,7 @@ struct mtx_pool { #define mtx_pool_shift mtx_pool_header.mtxpool_shift #define mtx_pool_next mtx_pool_header.mtxpool_next -struct mtx_pool __read_frequently *mtxpool_sleep; +struct mtx_pool __read_mostly *mtxpool_sleep; #if UINTPTR_MAX == UINT64_MAX /* 64 bits */ # define POINTER_BITS 64 From owner-svn-src-head@freebsd.org Sun Jan 5 12:47:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 274A71EBD30; Sun, 5 Jan 2020 12:47:31 +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 47rJM65YFbz4GpS; Sun, 5 Jan 2020 12:47:30 +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 B9E2225B34; Sun, 5 Jan 2020 12:47:30 +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 005ClU31062617; Sun, 5 Jan 2020 12:47:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005ClTe0062612; Sun, 5 Jan 2020 12:47:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001051247.005ClTe0062612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 12:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356374 - 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: 356374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 12:47:31 -0000 Author: mjg Date: Sun Jan 5 12:47:29 2020 New Revision: 356374 URL: https://svnweb.freebsd.org/changeset/base/356374 Log: locks: convert delay times to u_short int is just a waste of space for this purpose. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/kern/subr_lock.c head/sys/sys/lock.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Jan 5 12:46:35 2020 (r356373) +++ head/sys/kern/kern_mutex.c Sun Jan 5 12:47:29 2020 (r356374) @@ -144,9 +144,9 @@ static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, static struct lock_delay_config __read_frequently mtx_delay; -SYSCTL_INT(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base, +SYSCTL_U16(_debug_mtx, OID_AUTO, delay_base, CTLFLAG_RW, &mtx_delay.base, 0, ""); -SYSCTL_INT(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max, +SYSCTL_U16(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max, 0, ""); LOCK_DELAY_SYSINIT_DEFAULT(mtx_delay); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Jan 5 12:46:35 2020 (r356373) +++ head/sys/kern/kern_rwlock.c Sun Jan 5 12:47:29 2020 (r356374) @@ -94,18 +94,18 @@ struct lock_class lock_class_rw = { }; #ifdef ADAPTIVE_RWLOCKS -static int __read_frequently rowner_retries; -static int __read_frequently rowner_loops; +static u_short __read_frequently rowner_retries; +static u_short __read_frequently rowner_loops; static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, "rwlock debugging"); -SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); -SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); +SYSCTL_U16(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); +SYSCTL_U16(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); static struct lock_delay_config __read_frequently rw_delay; -SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base, +SYSCTL_U16(_debug_rwlock, OID_AUTO, delay_base, CTLFLAG_RW, &rw_delay.base, 0, ""); -SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max, +SYSCTL_U16(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max, 0, ""); static void Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Jan 5 12:46:35 2020 (r356373) +++ head/sys/kern/kern_sx.c Sun Jan 5 12:47:29 2020 (r356374) @@ -143,17 +143,17 @@ struct lock_class lock_class_sx = { #endif #ifdef ADAPTIVE_SX -static __read_frequently u_int asx_retries; -static __read_frequently u_int asx_loops; +static u_short __read_frequently asx_retries; +static u_short __read_frequently asx_loops; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); -SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); -SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); +SYSCTL_U16(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); +SYSCTL_U16(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); static struct lock_delay_config __read_frequently sx_delay; -SYSCTL_INT(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base, +SYSCTL_U16(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW, &sx_delay.base, 0, ""); -SYSCTL_INT(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max, +SYSCTL_U16(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max, 0, ""); static void Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sun Jan 5 12:46:35 2020 (r356373) +++ head/sys/kern/subr_lock.c Sun Jan 5 12:47:29 2020 (r356374) @@ -123,7 +123,7 @@ void lock_delay(struct lock_delay_arg *la) { struct lock_delay_config *lc = la->config; - u_int i; + u_short i; la->delay <<= 1; if (__predict_false(la->delay > lc->max)) Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Sun Jan 5 12:46:35 2020 (r356373) +++ head/sys/sys/lock.h Sun Jan 5 12:47:29 2020 (r356374) @@ -183,13 +183,13 @@ extern struct lock_class lock_class_lockmgr; extern struct lock_class *lock_classes[]; struct lock_delay_config { - u_int base; - u_int max; + u_short base; + u_short max; }; struct lock_delay_arg { struct lock_delay_config *config; - u_int delay; + u_short delay; u_int spin_cnt; }; From owner-svn-src-head@freebsd.org Sun Jan 5 12:48:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3359A1EC00C; Sun, 5 Jan 2020 12:48:21 +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 47rJN50VFzz4GxN; Sun, 5 Jan 2020 12:48:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C6A925B35; Sun, 5 Jan 2020 12:48:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 005CmK8w062706; Sun, 5 Jan 2020 12:48:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005CmJ53062700; Sun, 5 Jan 2020 12:48:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001051248.005CmJ53062700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Jan 2020 12:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356375 - in head/sys: amd64/amd64 kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: amd64/amd64 kern sys X-SVN-Commit-Revision: 356375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 12:48:21 -0000 Author: mjg Date: Sun Jan 5 12:48:19 2020 New Revision: 356375 URL: https://svnweb.freebsd.org/changeset/base/356375 Log: locks: add default delay struct Use it for all primitives. This makes everything fit in 8 bytes. Modified: head/sys/amd64/amd64/pmap.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/kern/subr_lock.c head/sys/sys/lock.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/amd64/amd64/pmap.c Sun Jan 5 12:48:19 2020 (r356375) @@ -763,8 +763,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, invl_max_qlen, CTLFLAG_ ""); #endif -static struct lock_delay_config __read_frequently di_delay; -LOCK_DELAY_SYSINIT_DEFAULT(di_delay); +#define di_delay locks_delay static void pmap_delayed_invl_start_u(void) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/kern/kern_mutex.c Sun Jan 5 12:48:19 2020 (r356375) @@ -140,6 +140,7 @@ struct lock_class lock_class_mtx_spin = { }; #ifdef ADAPTIVE_MUTEXES +#ifdef MUTEX_CUSTOM_BACKOFF static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging"); static struct lock_delay_config __read_frequently mtx_delay; @@ -150,8 +151,12 @@ SYSCTL_U16(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW 0, ""); LOCK_DELAY_SYSINIT_DEFAULT(mtx_delay); +#else +#define mtx_delay locks_delay #endif +#endif +#ifdef MUTEX_SPIN_CUSTOM_BACKOFF static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL, "mtx spin debugging"); @@ -163,6 +168,9 @@ SYSCTL_INT(_debug_mtx_spin, OID_AUTO, delay_max, CTLFL &mtx_spin_delay.max, 0, ""); LOCK_DELAY_SYSINIT_DEFAULT(mtx_spin_delay); +#else +#define mtx_spin_delay locks_delay +#endif /* * System-wide mutexes Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/kern/kern_rwlock.c Sun Jan 5 12:48:19 2020 (r356375) @@ -94,6 +94,7 @@ struct lock_class lock_class_rw = { }; #ifdef ADAPTIVE_RWLOCKS +#ifdef RWLOCK_CUSTOM_BACKOFF static u_short __read_frequently rowner_retries; static u_short __read_frequently rowner_loops; static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, @@ -117,6 +118,11 @@ rw_lock_delay_init(void *arg __unused) rowner_loops = max(10000, rw_delay.max); } LOCK_DELAY_SYSINIT(rw_lock_delay_init); +#else +#define rw_delay locks_delay +#define rowner_retries locks_delay_retries +#define rowner_loops locks_delay_loops +#endif #endif /* Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/kern/kern_sx.c Sun Jan 5 12:48:19 2020 (r356375) @@ -143,6 +143,7 @@ struct lock_class lock_class_sx = { #endif #ifdef ADAPTIVE_SX +#ifdef SX_CUSTOM_BACKOFF static u_short __read_frequently asx_retries; static u_short __read_frequently asx_loops; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); @@ -165,6 +166,11 @@ sx_lock_delay_init(void *arg __unused) asx_loops = max(10000, sx_delay.max); } LOCK_DELAY_SYSINIT(sx_lock_delay_init); +#else +#define sx_delay locks_delay +#define asx_retries locks_delay_retries +#define asx_loops locks_delay_loops +#endif #endif void Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/kern/subr_lock.c Sun Jan 5 12:48:19 2020 (r356375) @@ -161,6 +161,29 @@ lock_delay_default_init(struct lock_delay_config *lc) lc->max = 32678; } +struct lock_delay_config __read_frequently locks_delay; +u_short __read_frequently locks_delay_retries; +u_short __read_frequently locks_delay_loops; + +SYSCTL_U16(_debug_lock, OID_AUTO, delay_base, CTLFLAG_RW, &locks_delay.base, + 0, ""); +SYSCTL_U16(_debug_lock, OID_AUTO, delay_max, CTLFLAG_RW, &locks_delay.max, + 0, ""); +SYSCTL_U16(_debug_lock, OID_AUTO, delay_retries, CTLFLAG_RW, &locks_delay_retries, + 0, ""); +SYSCTL_U16(_debug_lock, OID_AUTO, delay_loops, CTLFLAG_RW, &locks_delay_loops, + 0, ""); + +static void +locks_delay_init(void *arg __unused) +{ + + lock_delay_default_init(&locks_delay); + locks_delay_retries = 10; + locks_delay_loops = max(10000, locks_delay.max); +} +LOCK_DELAY_SYSINIT(locks_delay_init); + #ifdef DDB DB_SHOW_COMMAND(lock, db_show_lock) { Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Sun Jan 5 12:47:29 2020 (r356374) +++ head/sys/sys/lock.h Sun Jan 5 12:48:19 2020 (r356375) @@ -187,6 +187,10 @@ struct lock_delay_config { u_short max; }; +extern struct lock_delay_config locks_delay; +extern u_short locks_delay_retries; +extern u_short locks_delay_loops; + struct lock_delay_arg { struct lock_delay_config *config; u_short delay; From owner-svn-src-head@freebsd.org Sun Jan 5 13:56:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D46C1F287D; Sun, 5 Jan 2020 13:56:33 +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 47rKtm71w8z4Kj8; Sun, 5 Jan 2020 13:56:32 +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 EAFFA267C4; Sun, 5 Jan 2020 13:56:32 +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 005DuWon004140; Sun, 5 Jan 2020 13:56:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005DuWBM004139; Sun, 5 Jan 2020 13:56:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001051356.005DuWBM004139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 Jan 2020 13:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356376 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 13:56:33 -0000 Author: tuexen Date: Sun Jan 5 13:56:32 2020 New Revision: 356376 URL: https://svnweb.freebsd.org/changeset/base/356376 Log: Ensure that we don't miss a trigger for kicking off the SCTP iterator. Reported by: nwhitehorn@ MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jan 5 12:48:19 2020 (r356375) +++ head/sys/netinet/sctputil.c Sun Jan 5 13:56:32 2020 (r356376) @@ -1475,12 +1475,11 @@ no_stcb: void sctp_iterator_worker(void) { - struct sctp_iterator *it, *nit; + struct sctp_iterator *it; /* This function is called with the WQ lock in place */ - sctp_it_ctl.iterator_running = 1; - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { + while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK(); From owner-svn-src-head@freebsd.org Sun Jan 5 14:06:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D0F81F34FE; Sun, 5 Jan 2020 14:06:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rL6S75Ttz4L6x; Sun, 5 Jan 2020 14:06:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9EC1269A1; Sun, 5 Jan 2020 14:06:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 005E6eoE010068; Sun, 5 Jan 2020 14:06:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005E6ecB010067; Sun, 5 Jan 2020 14:06:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001051406.005E6ecB010067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 Jan 2020 14:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356377 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 14:06:41 -0000 Author: tuexen Date: Sun Jan 5 14:06:40 2020 New Revision: 356377 URL: https://svnweb.freebsd.org/changeset/base/356377 Log: Return -1 consistently if an error occurs. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jan 5 13:56:32 2020 (r356376) +++ head/sys/netinet/sctp_pcb.c Sun Jan 5 14:06:40 2020 (r356377) @@ -7131,7 +7131,7 @@ sctp_initiate_iterator(inp_func inpf, SCTP_M_ITER); if (it == NULL) { SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOMEM); - return (ENOMEM); + return (-1); } memset(it, 0, sizeof(*it)); it->function_assoc = af; From owner-svn-src-head@freebsd.org Sun Jan 5 14:08:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 372721F3773; Sun, 5 Jan 2020 14:08:02 +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 47rL820k5jz4LFj; Sun, 5 Jan 2020 14:08:02 +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 13F05269A3; Sun, 5 Jan 2020 14:08:02 +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 005E81LU010183; Sun, 5 Jan 2020 14:08:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005E81PJ010181; Sun, 5 Jan 2020 14:08:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001051408.005E81PJ010181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 Jan 2020 14:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356378 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 14:08:02 -0000 Author: tuexen Date: Sun Jan 5 14:08:01 2020 New Revision: 356378 URL: https://svnweb.freebsd.org/changeset/base/356378 Log: Don't make the sendall iterator as being up if it could not be started. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jan 5 14:06:40 2020 (r356377) +++ head/sys/netinet/sctp_output.c Sun Jan 5 14:08:01 2020 (r356378) @@ -6932,7 +6932,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, (void *)ca, 0, sctp_sendall_completes, inp, 1); if (ret) { - SCTP_PRINTF("Failed to initiate iterator for sendall\n"); + inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; SCTP_FREE(ca, SCTP_M_COPYAL); SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); return (EFAULT); From owner-svn-src-head@freebsd.org Sun Jan 5 14:37:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B26F01F6201; Sun, 5 Jan 2020 14:37:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rLpK4pklz4MNv; Sun, 5 Jan 2020 14:37:45 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id d73so12473068wmd.1; Sun, 05 Jan 2020 06:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=/zJ9J222Np/+QIvOhu0JCmCPXMScas+RhXF300UXiuM=; b=LnV/C7+6WDJM/9/Ay7jWxrioy2oz2X7RG7XDKDOvVHZLxezj/DE2OtlZYhWlrQvXG6 Q58sf2KNs6gkHlHX4BhaOT1fWki5u2blFsgR/H8BR77RNvhzVW2uBmwQRJ2BY5KdIFuQ I78w75WEmL0LSqRe6PcC/m/aTGCMP9xDtcyygZ0Al7RaLlqG6X9HRziIDSDM9a2Q6fPk d1WdQIRpc9/xN44JoWPN62zvTjx3SVErLBtQEV0M0GiiUVSPsPXbdrl1Ip8jXtzRnL1c IgMlppEQdARCtsno3soDxUDzs8yxPmhsv+9zwCN/lMOzab4tk3IBJUo8Lru89bonxQM0 6kjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=/zJ9J222Np/+QIvOhu0JCmCPXMScas+RhXF300UXiuM=; b=CpXlDoIaeSWywQnrmjs7ktYk05WluFP2R7OiBTYlLDw0IYBMlpgfmenzLKrrrl4GDT IRk51m7nmsKXtuL4vgyCh9IIWkovdkj1ZB1NZdSa0xIt+oDozp1x3HboNpsWt9eCZfu2 XqqxcZVloCmrFYG2DWRL2ZJ4uYrf9MC8MQKUxnlgi92H9xdw5mjiDMfdVmc6/QdS5Tzu ZsC71i+ZfegxhbWusvo0pwZgkZNg0spe8cOl3AtGjRXqYRqxprNDlf8EHTcojfDkzZ7p pho5KK8SCYUUf0Lk3YRP0SnpFxoC7DLyhvWCwAMrAiGzUMQan4WpTKnAlnJxBhOd7ajd LwZA== X-Gm-Message-State: APjAAAXtXLLYP0NaT38V/xtSRIVQRBWzmxcDGgZXxWaNNhrmZ8+CJkeL WwmDL6R+uMMYqSLBx+avv9OJP2wt X-Google-Smtp-Source: APXvYqyF3G0T8BgQ3om/lC6a159f5xKnS2cfsbc4cv8EdG0k0yw2y+1lIbDs6kn/iAukUBx2W0EPtw== X-Received: by 2002:a7b:cbcd:: with SMTP id n13mr29570710wmi.104.1578235063716; Sun, 05 Jan 2020 06:37:43 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id j12sm72943679wrw.54.2020.01.05.06.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 06:37:42 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 5 Jan 2020 14:37:43 +0000 From: Edward Tomasz Napierala To: Dmitry Chagin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356241 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux Message-ID: <20200105143743.GA22122@brick> Mail-Followup-To: Dmitry Chagin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912312201.xBVM1889057554@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 47rLpK4pklz4MNv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LnV/C7+6; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-2.07 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.37)[ip: (2.65), ipnet: 2a00:1450::/32(-2.61), asn: 15169(-1.86), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[206.209.1.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 14:37:46 -0000 HNY, and sorry for the late response. Now... I don't know. Looking at sys/amd64/linux/linux_locore.asm, it looks like __vdso_getcpu() should return ENOSYS, but for some reason the getcpu(2) syscall works just fine. The VDSO symbol doesn't get used for some reason? On 0101T0116, Dmitry Chagin wrote: > Hi, HNY! What about vdso? > > ср, 1 янв. 2020 г. в 01:01, Edward Tomasz Napierala : > > > Author: trasz > > Date: Tue Dec 31 22:01:08 2019 > > New Revision: 356241 > > URL: https://svnweb.freebsd.org/changeset/base/356241 > > > > Log: > > Add basic getcpu(2) support to linuxulator. The purpose of this > > syscall is to query the CPU number and the NUMA domain the calling > > thread is currently running on. The third argument is ignored. > > It doesn't do anything regarding scheduling - it's literally > > just a way to query the current state, without any guarantees > > you won't get rescheduled an opcode later. > > > > This unbreaks Java from CentOS 8 > > (java-11-openjdk-11.0.5.10-0.el8_0.x86_64). > > > > Reviewed by: kib > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D22972 > > > > Modified: > > head/sys/amd64/linux/linux_dummy.c > > head/sys/amd64/linux32/linux32_dummy.c > > head/sys/arm64/linux/linux_dummy.c > > head/sys/compat/linux/linux_misc.c > > head/sys/i386/linux/linux_dummy.c > > > > Modified: head/sys/amd64/linux/linux_dummy.c > > > > ============================================================================== > > --- head/sys/amd64/linux/linux_dummy.c Tue Dec 31 18:58:29 2019 > > (r356240) > > +++ head/sys/amd64/linux/linux_dummy.c Tue Dec 31 22:01:08 2019 > > (r356241) > > @@ -102,8 +102,6 @@ DUMMY(tee); > > DUMMY(vmsplice); > > /* Linux 2.6.18: */ > > DUMMY(move_pages); > > -/* Linux 2.6.19: */ > > -DUMMY(getcpu); > > /* Linux 2.6.22: */ > > DUMMY(signalfd); > > /* Linux 2.6.27: */ > > > > Modified: head/sys/amd64/linux32/linux32_dummy.c > > > > ============================================================================== > > --- head/sys/amd64/linux32/linux32_dummy.c Tue Dec 31 18:58:29 2019 > > (r356240) > > +++ head/sys/amd64/linux32/linux32_dummy.c Tue Dec 31 22:01:08 2019 > > (r356241) > > @@ -108,8 +108,6 @@ DUMMY(tee); > > DUMMY(vmsplice); > > /* Linux 2.6.18: */ > > DUMMY(move_pages); > > -/* Linux 2.6.19: */ > > -DUMMY(getcpu); > > /* Linux 2.6.22: */ > > DUMMY(signalfd); > > /* Linux 2.6.27: */ > > > > Modified: head/sys/arm64/linux/linux_dummy.c > > > > ============================================================================== > > --- head/sys/arm64/linux/linux_dummy.c Tue Dec 31 18:58:29 2019 > > (r356240) > > +++ head/sys/arm64/linux/linux_dummy.c Tue Dec 31 22:01:08 2019 > > (r356241) > > @@ -104,8 +104,6 @@ DUMMY(tee); > > DUMMY(vmsplice); > > /* Linux 2.6.18: */ > > DUMMY(move_pages); > > -/* Linux 2.6.19: */ > > -DUMMY(getcpu); > > /* Linux 2.6.27: */ > > DUMMY(signalfd4); > > DUMMY(inotify_init1); > > > > Modified: head/sys/compat/linux/linux_misc.c > > > > ============================================================================== > > --- head/sys/compat/linux/linux_misc.c Tue Dec 31 18:58:29 2019 > > (r356240) > > +++ head/sys/compat/linux/linux_misc.c Tue Dec 31 22:01:08 2019 > > (r356241) > > @@ -2353,3 +2353,19 @@ out: > > td->td_retval[0] = dst - args->buf; > > return (error); > > } > > + > > +int > > +linux_getcpu(struct thread *td, struct linux_getcpu_args *args) > > +{ > > + int cpu, error, node; > > + > > + cpu = td->td_oncpu; /* Make sure it doesn't change during > > copyout(9) */ > > + error = 0; > > + node = 0; /* XXX: Fake NUMA node 0 for now */ > > + > > + if (args->cpu != NULL) > > + error = copyout(&cpu, args->cpu, sizeof(l_int)); > > + if (args->node != NULL) > > + error = copyout(&node, args->node, sizeof(l_int)); > > + return (error); > > +} > > > > Modified: head/sys/i386/linux/linux_dummy.c > > > > ============================================================================== > > --- head/sys/i386/linux/linux_dummy.c Tue Dec 31 18:58:29 2019 > > (r356240) > > +++ head/sys/i386/linux/linux_dummy.c Tue Dec 31 22:01:08 2019 > > (r356241) > > @@ -104,8 +104,6 @@ DUMMY(tee); > > DUMMY(vmsplice); > > /* Linux 2.6.18: */ > > DUMMY(move_pages); > > -/* Linux 2.6.19: */ > > -DUMMY(getcpu); > > /* Linux 2.6.22: */ > > DUMMY(signalfd); > > /* Linux 2.6.27: */ > > From owner-svn-src-head@freebsd.org Sun Jan 5 15:24:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3D181F9E50; Sun, 5 Jan 2020 15:24:01 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 47rMqj18VQz4PHv; Sun, 5 Jan 2020 15:24:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f173.google.com with SMTP id t17so40607613ilm.13; Sun, 05 Jan 2020 07:24:00 -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; bh=FRG81yH986WTI+8E7/BsaDh/3zJrWcJWObPJnv1IzPg=; b=UfxwgGERXwumDBkoF/maelc0hqyLFucJJB8Z5dbQMWwlBtdCE6yLR9nb0nNUq92DPR LzlMKA/hUGuTSqtJp5d2Xg84LSBcWqkBU57yTbZcTxRSOSanD4sJxeuJpwvxlLPG6mCM J9z0i3XcpFUqtHGe5YjYcT5IvzV+yL9A7wns904o+fu5IGt7ZDD2/sJicOsWzktd8o8y n0K6O0z52QKiS8sFiRDle8P6pxgcm6c4ah8y3nOO5rqowGMKWJwE7Gh7OLx11+dlqm3f eF/RhL8SE0k89cbGi7qH3LiHU8FK0aRHvPb51vWXwr2houectgBCywKa9SoajKseDSi3 24sw== X-Gm-Message-State: APjAAAVKJ+lAIuygEO15TbxNr+xxnU/81//Plfl973o2qX7SFqivtEYX cWDznXekBltL+nqinVJPyfc4CZO7gRmU2lpfFgiX0yzL X-Google-Smtp-Source: APXvYqx0+ReDxX2bVNDrV+wIIQCJH4xHaEsYu/t4r6lDd0BPYsNiGWmE3jKBPW1233ZVuh9FvKwWZVX65IUZstl2tFA= X-Received: by 2002:a92:db4f:: with SMTP id w15mr77730124ilq.182.1578237838550; Sun, 05 Jan 2020 07:23:58 -0800 (PST) MIME-Version: 1.0 References: <202001050247.0052lu11098031@repo.freebsd.org> In-Reply-To: <202001050247.0052lu11098031@repo.freebsd.org> From: Ed Maste Date: Sun, 5 Jan 2020 10:23:46 -0500 Message-ID: Subject: Re: svn commit: r356367 - in head: . share/mk To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47rMqj18VQz4PHv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.173 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.35 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.35)[ip: (-6.72), ipnet: 209.85.128.0/17(-3.10), asn: 15169(-1.86), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[173.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[173.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 15:24:02 -0000 On Sat, 4 Jan 2020 at 21:48, Ed Maste wrote: > > Author: emaste > Date: Sun Jan 5 02:47:56 2020 > New Revision: 356367 > URL: https://svnweb.freebsd.org/changeset/base/356367 > > Log: > Do not build GCC 4.2.1 by default for any CPU architecture mips.mips64 is currently failing on ci.freebsd.org (but not tinderbox) with: 09:23:51 --- libcxxrt.a --- 09:23:51 building static cxxrt library 09:23:51 ar -crD libcxxrt.a `NM='nm' NMFLAGS='' lorder libelftc_dem_gnu3.o terminate.o dynamic_cast.o memory.o auxhelper.o exception.o stdexcept.o typeinfo.o guard.o | tsort -q` 09:23:51 --- libcxxrt.so.1.full --- 09:23:51 /usr/obj/usr/src/mips.mips64/tmp/usr/bin/ld: BFD 2.17.50 [FreeBSD] 2007-07-03 assertion fail /usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/elf64-mips.c:2297 09:23:51 /usr/obj/usr/src/mips.mips64/tmp/usr/bin/ld: BFD 2.17.50 [FreeBSD] 2007-07-03 internal error, aborting at /usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/reloc.c line 445 in unsigned int bfd_get_reloc_size(reloc_howto_type *) 09:23:51 09:23:51 /usr/obj/usr/src/mips.mips64/tmp/usr/bin/ld: Please report this bug. 09:23:51 09:23:51 cc: error: linker command failed with exit code 1 (use -v to see invocation) 09:23:51 *** [libcxxrt.so.1.full] Error code 1 It looks like this is just using external GCC, not full external toolchain, and needs to switch. sparc64 is failing with: 09:12:41 --- lib/libssp_nonshared__PL --- 09:12:41 /tmp/libssp_nonshared-e776f8.s: Assembler messages: 09:12:41 /tmp/libssp_nonshared-e776f8.s:15: Error: unknown pseudo-op: `.cfi_sections' 09:12:41 cc: error: assembler command failed with exit code 1 (use -v to see invocation) 09:12:41 *** [libssp_nonshared.o] Error code 1 This might be the same problem as above, for CI. Running in tinderbox sparc64 fails with: collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped compilation terminated. /usr/local/bin/sparc64-unknown-freebsd12.0-ld: BFD (GNU Binutils) 2.33.1 assertion fail elfxx-sparc.c:763 From owner-svn-src-head@freebsd.org Sun Jan 5 16:59:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9FBC1DA4D9; Sun, 5 Jan 2020 16:59:24 +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 47rPxm5SWmz4Tx0; Sun, 5 Jan 2020 16:59:24 +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 B6C8B8DA; Sun, 5 Jan 2020 16:59:24 +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 005GxOdL013760; Sun, 5 Jan 2020 16:59:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005GxOOa013759; Sun, 5 Jan 2020 16:59:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051659.005GxOOa013759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 16:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356379 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 16:59:24 -0000 Author: emaste Date: Sun Jan 5 16:59:24 2020 New Revision: 356379 URL: https://svnweb.freebsd.org/changeset/base/356379 Log: src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* After GCC was disabled by default in r356367, mips and sparc64 started relying external GCC. However, the in-tree Binutils ld 2.17.50 is not compatible with GCC for some mips64 targets, so turn off BINUTILS_BOOTSTRAP and rely on external binutils (linker) as well. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 5 14:08:01 2020 (r356378) +++ head/share/mk/src.opts.mk Sun Jan 5 16:59:24 2020 (r356379) @@ -489,6 +489,10 @@ MK_BSDINSTALL:= no MK_SVNLITE:= no .endif +.if ${__T:Mmips64*} && ${MK_GCC} == "no" +MK_BINUTILS_BOOTSTRAP:= no +.endif + .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no From owner-svn-src-head@freebsd.org Sun Jan 5 17:12:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C49E11DC2BE; Sun, 5 Jan 2020 17:12:41 +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 47rQF54qt9z4VwB; Sun, 5 Jan 2020 17:12:41 +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 A1141C9C; Sun, 5 Jan 2020 17:12:41 +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 005HCf8Y025251; Sun, 5 Jan 2020 17:12:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005HCfOI025250; Sun, 5 Jan 2020 17:12:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051712.005HCfOI025250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 17:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356380 - 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: 356380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 17:12:41 -0000 Author: emaste Date: Sun Jan 5 17:12:41 2020 New Revision: 356380 URL: https://svnweb.freebsd.org/changeset/base/356380 Log: src.conf.5: regen after r356379, disable BINUTILS_BOOTSTRAP on mips64* Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jan 5 16:59:24 2020 (r356379) +++ head/share/man/man5/src.conf.5 Sun Jan 5 17:12:41 2020 (r356380) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 4, 2020 +.Dd January 5, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -207,13 +207,13 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64, mips/mips64el, mips/mips64, mips/mips64elhf and mips/mips64hf. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 From owner-svn-src-head@freebsd.org Sun Jan 5 17:22:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD2B61DD2AD; Sun, 5 Jan 2020 17:22:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 47rQRz0xNTz4W9k; Sun, 5 Jan 2020 17:22:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f182.google.com with SMTP id p8so40772171iln.12; Sun, 05 Jan 2020 09:22:06 -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; bh=zTnC4ReBQ+VVTbJKhd5xtTmvQJikKqsTGfHac0+oiD4=; b=jJuJ3OmV7vzpJ/SqblxpHqQuAkxKHI5JFNJKLSol/ogHV9X0tyazLp4/T1dlVUmQ+6 fGqIpJByWmttr73SQBBHE4s6VEMAJNWd/1m7qu99WR2/MwWwqer6IXFtkLGd0nKY+An9 gDuxr63UTYABhG7SULZBM1NHDwdNroRpTsPOFCQ2WroqZFrlKU4awxAhOHVrA0hdO6lS C9PCxqXV0CUmYG9QcrBDOR74csQ2n3RO0lKu0QDTh8PanXmkMf89aGVatejcceEVfbqu 1wgAlKfEwobQajlOiXr/Oe4i1HFUx1koVXsaZmStSlWh5zRpA71ytQOAWFXU7qhtvzus FLVw== X-Gm-Message-State: APjAAAWF43wtUT8et2q7cOxsMQfmYzfXljgGJTI7c/oA6OEljX1Dab16 3uzDA518MERlHJOsTrPyAxo77jTtKqDwCFthuo3yog== X-Google-Smtp-Source: APXvYqwnUAq16wRs5iEXfkpbMOo/JYwrt0KGFX98+XP/LSmhSBzR4HwFwMlUX2SuI+/tR9Ree1r3NsxEBwIMHWy534s= X-Received: by 2002:a92:db4f:: with SMTP id w15mr77990436ilq.182.1578244925748; Sun, 05 Jan 2020 09:22:05 -0800 (PST) MIME-Version: 1.0 References: <202001051659.005GxOOa013759@repo.freebsd.org> In-Reply-To: <202001051659.005GxOOa013759@repo.freebsd.org> From: Ed Maste Date: Sun, 5 Jan 2020 12:21:53 -0500 Message-ID: Subject: Re: svn commit: r356379 - head/share/mk To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47rQRz0xNTz4W9k X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.182 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.28 / 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)[3]; 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]; IP_SCORE(-2.28)[ip: (-6.36), ipnet: 209.85.128.0/17(-3.10), asn: 15169(-1.86), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[182.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[182.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 17:22:07 -0000 On Sun, 5 Jan 2020 at 11:59, Ed Maste wrote: > > Author: emaste > Date: Sun Jan 5 16:59:24 2020 > New Revision: 356379 > URL: https://svnweb.freebsd.org/changeset/base/356379 > > Log: > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* I should probably make this the case for all of mips* and sparc64. Using a decade-old binutils with a contemporary compiler (either Clang or GCC) isn't likely to be a combination used by anyone else and it's not going to be a good use of our time investigating and addressing any issues that arise. From owner-svn-src-head@freebsd.org Sun Jan 5 17:26:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C2751DDB28 for ; Sun, 5 Jan 2020 17:26:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 47rQXs4kvNz4WZy for ; Sun, 5 Jan 2020 17:26:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x836.google.com with SMTP id n15so40785909qtp.5 for ; Sun, 05 Jan 2020 09:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qNU8mvvGe4Wt/2Fkm+TCLHYsqdwd0RWyF672F8ABkAk=; b=LRGEzvAKU93wmahLSx6/tvjnShdVxZkvA0Yg5pHH8dff/+WQtwdArfU/2E1K6AHqJ2 fRrIh/ZTNY9qA8KLW/Kpy6K/t/8yfPJI/mC7sB7AoKDBcLuBbd9owI4zOdqKpp7OvGQN zA9tvHAe8ysiGHBAJfFOAVTFZI7DlsuIAVPu6igZVzXkznOAUSgp0NlcDpViMbDU3nsb f+njoOdCrUzBUkmGS1p5OBBlbIUsHU7Jhrotaoj9Jl+glE2q369qgSYCITmDP3tr8I1l m9nMU9Dw3MAs//w+mPXjLCcMMP0qqdRLnZ2aBZNYdmR2pIGRsBRYZyTsRwt3nvP2Pvy4 POvA== 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=qNU8mvvGe4Wt/2Fkm+TCLHYsqdwd0RWyF672F8ABkAk=; b=OTkSDI/GbwQiSixBKGxFKBdEl5k6u8uGk8jz/5Q6SGDrFVUgqoRJWxCq3SF10dZm3Y R6gfpp+oJaVLkOB39fnIiqrHNOaBsUhDGt1CddHzKJZsrrhSTbfU8Tny2DAtlBeKl4zs jCyooLWWQDoep51Tz8Tw4mwygpQhtsucUAg4PeTavDsoN0ou0yAOwEOSiN0uTe4XIFtg wn8J9IkXYeAsP5iET/tlrhtHkkxdtURBOO9S9PGj/Sf3GGSe9VL3qCIPQAfXtppkc77k j8McYKf5ZJm9lNfT5tKuJnUhT+08UXdnzxLUL1KZrw1jDM+bF6qN1WC6ZX8rGHcjIjCE PEIA== X-Gm-Message-State: APjAAAXDIoOvjyNqWwaQSCF26i62UMTOhKCNHaVWKwbBr842cUkKQIWy kT5dMFshi0pKpRuZOzYPLGeMHZQ3jTqa5MXY7Uwqzw== X-Google-Smtp-Source: APXvYqx8OT/gppzkZQZGuNK6OLqBVgftXhGkZrnRAnEkcDy10sav8IGMnMl4UR25DLB2ShfcOIFCZ4lpl2mKio0AxD4= X-Received: by 2002:aed:3b79:: with SMTP id q54mr61989096qte.187.1578245179792; Sun, 05 Jan 2020 09:26:19 -0800 (PST) MIME-Version: 1.0 References: <202001051659.005GxOOa013759@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 5 Jan 2020 11:26:07 -0600 Message-ID: Subject: Re: svn commit: r356379 - head/share/mk To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47rQXs4kvNz4WZy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=LRGEzvAK; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::836) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[6.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.64)[ip: (-9.17), ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.86), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 17:26:22 -0000 On Sun, Jan 5, 2020, 10:22 AM Ed Maste wrote: > On Sun, 5 Jan 2020 at 11:59, Ed Maste wrote: > > > > Author: emaste > > Date: Sun Jan 5 16:59:24 2020 > > New Revision: 356379 > > URL: https://svnweb.freebsd.org/changeset/base/356379 > > > > Log: > > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* > > I should probably make this the case for all of mips* and sparc64. > Using a decade-old binutils with a contemporary compiler (either Clang > or GCC) isn't likely to be a combination used by anyone else and it's > not going to be a good use of our time investigating and addressing > any issues that arise. > I'd agree. There are lots of bugs or missing features in our binutils that will bite people... Warner > From owner-svn-src-head@freebsd.org Sun Jan 5 17:53:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA6BE1E0C50; Sun, 5 Jan 2020 17:53:50 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from gate.utahime.jp (gate.utahime.jp [183.180.29.210]) (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 47rR8Y2RDDz4XxP; Sun, 5 Jan 2020 17:53:48 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gate.utahime.jp (Postfix) with ESMTPS id CF40E488BB; Mon, 6 Jan 2020 02:53:44 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1578246824; bh=LLvNZ2RSkoaFr/LYcks1xZqWzMTcUnMiT6MgyDV4t9Y=; h=Date:To:Cc:Subject:From:In-Reply-To:References; b=qk7VYg8uzmoG/Xz+f2vflSOl9RYyML+7BO/6PSct4//uEOrnDPTfVhHCjeG+p910B 1ZszEBRY/mUjxrY3OUhSqge5oHrRyYwysZG1FQ3FPZDbTu5O6WBn55GWKMIIEvnV9D ETf1f2sKkaHKDTH0Q3mWD8JIIAL21g5yQEYU5I94KPiYZjbRGwXASs+uHaMEWrqukG e6N8YJaqwEgtsSnlJ1RriVzUFYyy10wdbT9TjTjTIDXtBx3J7QlabMbwuHIPdxenyy YwImzWMp1SWBqnQO8jhSBnSmxBkWWFrRIoZBKvwqckf4EFYqQdlEtxBtS7FphcOnGQ oChWuWDrVFF5g== Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id B3A715EF34; Mon, 6 Jan 2020 02:53:42 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.1 at eastasia.home.utahime.org Date: Mon, 06 Jan 2020 02:52:57 +0900 (JST) Message-Id: <20200106.025257.202876441661893679.yasu@utahime.org> To: imp@bsdimp.com Cc: emaste@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r356379 - head/share/mk From: Yasuhiro KIMURA In-Reply-To: References: <202001051659.005GxOOa013759@repo.freebsd.org> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47rR8Y2RDDz4XxP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=qk7VYg8u; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [0.96 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; NEURAL_HAM_MEDIUM(-0.60)[-0.602,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[utahime.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[utahime.org:+]; NEURAL_SPAM_LONG(0.21)[0.215,0]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.34)[ip: (0.24), ipnet: 183.180.0.0/16(0.12), asn: 2519(1.33), country: JP(0.03)]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 17:53:50 -0000 From: Warner Losh Subject: Re: svn commit: r356379 - head/share/mk Date: Sun, 5 Jan 2020 11:26:07 -0600 >> > Author: emaste >> > Date: Sun Jan 5 16:59:24 2020 >> > New Revision: 356379 >> > URL: https://svnweb.freebsd.org/changeset/base/356379 >> > >> > Log: >> > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* >> >> I should probably make this the case for all of mips* and sparc64. >> Using a decade-old binutils with a contemporary compiler (either Clang >> or GCC) isn't likely to be a combination used by anyone else and it's >> not going to be a good use of our time investigating and addressing >> any issues that arise. >> > I'd agree. There are lots of bugs or missing features in our binutils that > will bite people... Just out of curiosity, is there any retirement plan for binutils in base system at the moment? --- Yasuhiro KIMURA From owner-svn-src-head@freebsd.org Sun Jan 5 18:01:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 545921E0F12; Sun, 5 Jan 2020 18:01:16 +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 47rRK81g6qz4Y9D; Sun, 5 Jan 2020 18:01:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 340DD144B; Sun, 5 Jan 2020 18:01:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 005I1F35053129; Sun, 5 Jan 2020 18:01:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005I1FYt053128; Sun, 5 Jan 2020 18:01:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051801.005I1FYt053128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 18:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356381 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:01:16 -0000 Author: emaste Date: Sun Jan 5 18:01:15 2020 New Revision: 356381 URL: https://svnweb.freebsd.org/changeset/base/356381 Log: src.opts.mk: disable BINUTILS_BOOTSTRAP on all mips* and sparc64 Extend r356379 to include 32-bit mips and sparc64. Using a decade-old binutils linker with a contemporary compiler (either Clang or GCC) is a combination unlikely to be used by anyone else, and it's not going to be a good use of our time investigating and addressing any issues that arise. Expect that all architectures newly migrated to external GCC will also use external binutils. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 5 17:12:41 2020 (r356380) +++ head/share/mk/src.opts.mk Sun Jan 5 18:01:15 2020 (r356381) @@ -489,7 +489,7 @@ MK_BSDINSTALL:= no MK_SVNLITE:= no .endif -.if ${__T:Mmips64*} && ${MK_GCC} == "no" +.if (${__TT} == "mips" || ${__TT} == "sparc64") && ${MK_GCC} == "no" MK_BINUTILS_BOOTSTRAP:= no .endif From owner-svn-src-head@freebsd.org Sun Jan 5 18:01:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0BCC1E0F95; Sun, 5 Jan 2020 18:01:53 +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 47rRKs3qRTz4YKD; Sun, 5 Jan 2020 18:01:53 +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 7E954147A; Sun, 5 Jan 2020 18:01:53 +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 005I1ros054013; Sun, 5 Jan 2020 18:01:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005I1rnm054012; Sun, 5 Jan 2020 18:01:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051801.005I1rnm054012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356382 - 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: 356382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:01:53 -0000 Author: emaste Date: Sun Jan 5 18:01:52 2020 New Revision: 356382 URL: https://svnweb.freebsd.org/changeset/base/356382 Log: src.conf.5: regen after r356381, disable BINUTILS_BOOTSTRAP more widely Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jan 5 18:01:15 2020 (r356381) +++ head/share/man/man5/src.conf.5 Sun Jan 5 18:01:52 2020 (r356382) @@ -207,13 +207,13 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64, riscv/riscv64, mips/mips64el, mips/mips64, mips/mips64elhf and mips/mips64hf. +arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7 and i386/i386. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 From owner-svn-src-head@freebsd.org Sun Jan 5 18:03:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3335D1E10C7; Sun, 5 Jan 2020 18:03:54 +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 47rRNB0Yp2z4Yfk; Sun, 5 Jan 2020 18:03:54 +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 0E7A915DF; Sun, 5 Jan 2020 18:03:54 +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 005I3rGP054787; Sun, 5 Jan 2020 18:03:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005I3r7e054786; Sun, 5 Jan 2020 18:03:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051803.005I3r7e054786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 18:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356383 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 356383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:03:54 -0000 Author: emaste Date: Sun Jan 5 18:03:53 2020 New Revision: 356383 URL: https://svnweb.freebsd.org/changeset/base/356383 Log: arch.7: update toolchain table for external ld use As of r356379 and r356381 mips* and sparc64 now use external Binutils ld as their linker. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun Jan 5 18:01:52 2020 (r356382) +++ head/share/man/man7/arch.7 Sun Jan 5 18:03:53 2020 (r356383) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2020 +.Dd January 5, 2020 .Dt ARCH 7 .Os .Sh NAME @@ -307,21 +307,21 @@ This table shows the default tool chain for each archi .It armv6 Ta Clang Ta lld .It armv7 Ta Clang Ta lld .It i386 Ta Clang Ta lld -.It mips Ta GCC(1) Ta GNU ld 2.17.50 -.It mipsel Ta GCC(1) Ta GNU ld 2.17.50 -.It mipselhf Ta GCC(1) Ta GNU ld 2.17.50 -.It mipshf Ta GCC(1) Ta GNU ld 2.17.50 -.It mipsn32 Ta GCC(1) Ta GNU ld 2.17.50 -.It mips64 Ta GCC(1) Ta GNU ld 2.17.50 -.It mips64el Ta GCC(1) Ta GNU ld 2.17.50 -.It mips64elhf Ta GCC(1) Ta GNU ld 2.17.50 -.It mips64hf Ta GCC(1) Ta GNU ld 2.17.50 -.It powerpc Ta Clang Ta GNU ld 2.17.50 -.It powerpcspe Ta Clang Ta GNU ld 2.17.50 +.It mips Ta GCC(1) Ta GNU ld(1) +.It mipsel Ta GCC(1) Ta GNU ld(1) +.It mipselhf Ta GCC(1) Ta GNU ld(1) +.It mipshf Ta GCC(1) Ta GNU ld(1) +.It mipsn32 Ta GCC(1) Ta GNU ld(1) +.It mips64 Ta GCC(1) Ta GNU ld(1) +.It mips64el Ta GCC(1) Ta GNU ld(1) +.It mips64elhf Ta GCC(1) Ta GNU ld(1) +.It mips64hf Ta GCC(1) Ta GNU ld(1) +.It powerpc Ta Clang Ta GNU ld(1) +.It powerpcspe Ta Clang Ta GNU ld(1) .It powerpc64 Ta Clang Ta lld .It riscv64 Ta GCC(1) Ta GNU ld(1) .It riscv64sf Ta GCC(1) Ta GNU ld(1) -.It sparc64 Ta GCC(1) Ta GNU ld 2.17.50 +.It sparc64 Ta GCC(1) Ta GNU ld(1) .El .Pp (1) External toolchain provided by ports/packages. From owner-svn-src-head@freebsd.org Sun Jan 5 18:03:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 546651E10FF; Sun, 5 Jan 2020 18:03:59 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) (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 47rRNH1B4cz4Ym5; Sun, 5 Jan 2020 18:03:58 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-yb1-xb44.google.com with SMTP id x14so21129589ybr.4; Sun, 05 Jan 2020 10:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qrOr6c0F4ZIsNJGSW4R5CT1UOeznIPyhvJxU1GPr/iQ=; b=FTTS0GCoC4iA/CFcH9OJ1ZpEzpkTIq5VRP045Dd6bq+uqcdT+d3zRDhQDCHdOxAA0n dbK5m8iJrMCIrF6L2zHwQNyu2g54n+EX/TB3ELsbXOU1pAsKMlys/BvL+LTT+l192kF5 d9AUGlyrJ2CrQDBT7jottgX4wXWq79xmhE6kjhiNpnywWW0I5UDGvaWFS5PGpdWk7TQ1 Ctn8cMgl5S9DGKrosIlKPQJcA12GNveRGKiMjKOq2USKI9iOUr2XAhKnR35FYpy0SuYL 1MBMKFXWuzXS5mz3xQyFDQNhnaGBTNNT+c3nnxqfMnakLuQPaIYm3IfWs0uf9U92Bfjm fYeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qrOr6c0F4ZIsNJGSW4R5CT1UOeznIPyhvJxU1GPr/iQ=; b=I8v630zmBz6OSFEr4O32leloP3Cz+/2CKVzzCZQaMWYYJzZOuNlOHlb7KfTGBUcPO6 10qrPh+LpEjuGuJXzDa98Pz3rdBOu9GTDUSiudZnrM8CsLOLUqIoCiD4dF47eqSRKUYY 3tIw1Vt2kygMJbSq+C2liMhK/aeIoVWhupQzKxPfKQCAcwrV6mJdu0zhO2du1MA1R/WF 1WJm4oJs8fdhvzFlIlNxR9vgnTk666gZ6Z6Qkrg1bcNS1GjmVWxo8cOBv8GZdP49NiN6 B3XjDtUNnKWIcPiWUNcul5JT6Mo32qPDsFyjL8SvNGkpn9eYRPLeUwdsyxkRZ8pFBJ8a O1hA== X-Gm-Message-State: APjAAAXnegUYh32ZgItZ8DG45KYdyHv2v3EdSJybYnEDJ0SnDF8DjGyZ GlIOI0vdGxmbDOA5/Roqhy3P6ODF X-Google-Smtp-Source: APXvYqzodVc5MDNCCY54E++LjO97cinOgULEpxNz8XLrM9/VnLM6GTk0//ZNUq5YJNZ9yUi3L3dxhg== X-Received: by 2002:a25:e616:: with SMTP id d22mr71978301ybh.220.1578247437662; Sun, 05 Jan 2020 10:03:57 -0800 (PST) Received: from titan.knownspace (173-19-125-130.client.mchsi.com. [173.19.125.130]) by smtp.gmail.com with ESMTPSA id l22sm27029583ywl.54.2020.01.05.10.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 10:03:57 -0800 (PST) Date: Sun, 5 Jan 2020 12:03:54 -0600 From: Justin Hibbits To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r356379 - head/share/mk Message-ID: <20200105120354.3b9c1c49@titan.knownspace> In-Reply-To: References: <202001051659.005GxOOa013759@repo.freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47rRNH1B4cz4Ym5 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:03:59 -0000 On Sun, 5 Jan 2020 12:21:53 -0500 Ed Maste wrote: > On Sun, 5 Jan 2020 at 11:59, Ed Maste wrote: > > > > Author: emaste > > Date: Sun Jan 5 16:59:24 2020 > > New Revision: 356379 > > URL: https://svnweb.freebsd.org/changeset/base/356379 > > > > Log: > > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* > > I should probably make this the case for all of mips* and sparc64. > Using a decade-old binutils with a contemporary compiler (either Clang > or GCC) isn't likely to be a combination used by anyone else and it's > not going to be a good use of our time investigating and addressing > any issues that arise. powerpc and powerpcspe still use in-tree binutils (or external binutils... but in-tree works well enough, until we start adding ifuncs), until such a time that lld is fully functional. - Justin From owner-svn-src-head@freebsd.org Sun Jan 5 18:06:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B814F1E1252; Sun, 5 Jan 2020 18:06:32 +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 47rRRD4S2Pz4Yvt; Sun, 5 Jan 2020 18:06:32 +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 93F2915E1; Sun, 5 Jan 2020 18:06:32 +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 005I6WMZ054957; Sun, 5 Jan 2020 18:06:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005I6WKm054956; Sun, 5 Jan 2020 18:06:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001051806.005I6WKm054956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Jan 2020 18:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356384 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 356384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:06:32 -0000 Author: emaste Date: Sun Jan 5 18:06:32 2020 New Revision: 356384 URL: https://svnweb.freebsd.org/changeset/base/356384 Log: arch.7: correct overzealous claims of external binutils use powerpc and powerpcspe still use in-tree ld 2.17.50 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun Jan 5 18:03:53 2020 (r356383) +++ head/share/man/man7/arch.7 Sun Jan 5 18:06:32 2020 (r356384) @@ -316,8 +316,8 @@ This table shows the default tool chain for each archi .It mips64el Ta GCC(1) Ta GNU ld(1) .It mips64elhf Ta GCC(1) Ta GNU ld(1) .It mips64hf Ta GCC(1) Ta GNU ld(1) -.It powerpc Ta Clang Ta GNU ld(1) -.It powerpcspe Ta Clang Ta GNU ld(1) +.It powerpc Ta Clang Ta GNU ld 2.17.50 +.It powerpcspe Ta Clang Ta GNU ld 2.17.50 .It powerpc64 Ta Clang Ta lld .It riscv64 Ta GCC(1) Ta GNU ld(1) .It riscv64sf Ta GCC(1) Ta GNU ld(1) From owner-svn-src-head@freebsd.org Sun Jan 5 18:16:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 930C91E172E; Sun, 5 Jan 2020 18:16:42 +0000 (UTC) (envelope-from pfg@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 47rRfy3PBNz4ZTB; Sun, 5 Jan 2020 18:16:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id DA28AC1D8; Sun, 5 Jan 2020 18:16:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r356367 - in head: . share/mk To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001050247.0052lu11098031@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <0b3ae104-ea62-1aa8-c926-c6021565a050@FreeBSD.org> Date: Sun, 5 Jan 2020 13:16:40 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <202001050247.0052lu11098031@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:16:42 -0000 FWIW, On 04/01/2020 21:47, Ed Maste wrote: > Author: emaste > Date: Sun Jan 5 02:47:56 2020 > New Revision: 356367 > URL: https://svnweb.freebsd.org/changeset/base/356367 > > Log: > Do not build GCC 4.2.1 by default for any CPU architecture  It's really nice how the compiler warning trend went down. On FreeBSD-head-mips-build* it went from 7691 warnings to 473 + 83. Cheers, Pedro. *https://ci.freebsd.org/job/FreeBSD-head-mips-build/ From owner-svn-src-head@freebsd.org Sun Jan 5 18:17:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55F021E17E9 for ; Sun, 5 Jan 2020 18:17:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 47rRgy2xGcz4Zbq for ; Sun, 5 Jan 2020 18:17:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id c17so37741463qkg.7 for ; Sun, 05 Jan 2020 10:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R5asjnM09eV6gmtT5J+HYzmb5e6pRkftWHYdoABqCzs=; b=Krv7aPfXLG1NTgLTYKmVJhOySg5bev+YbsjPnd0o/RnCDjVt2rw9s3ZAlSL9uimy2z upUF6Wvob2DlMc3h2NrCFyOgSrBTlnFsk7ewYGcMRNB7wlehhFbdLdK+3/ffikUD08Ut HEP51VYRTx2tFSve2jMEIVeX5L8ooQ5b0s3a6NcmoVIULW5UCaiSqHeAY4DBmUcWXLsR 7XCaFc6/O+Hs2V5nL7RHmBgBL5Y1ZUrKmrlRq/kMFZX0N+rE6I3UaaKKURkJpndtOQcn SXnGb4DBZVuKyCaYZbuPDODmUzFPBBvq5J80f+ZJwVoDis2cV9LExglerSnN89ZxS58x S0GQ== 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=R5asjnM09eV6gmtT5J+HYzmb5e6pRkftWHYdoABqCzs=; b=Xf4xMLRaEP8FZsl2AWkJm+EeI04HJIE+8mBHRxRsVxTFmpKNp6t0rZy0fx2Vl4L6Qp qs5Ruow6FeWkJ6FqLwfFxAnDZlwk/pqSKB/50tahlt+R8X7W1sJsVn7RfSjHST1Ulh3n 6AuPX+5caYDxjulBzeMNodobGui5sL8DCKj//Hw22fBFz9P5CCl5wQXfybY7vAZlAXIO T96MAkvw6YA5KnyvUmMbNeg18l4SgM1dkjVrNFNd9CMlP+VNli71czwF7QXBOFW9EdpB xqWY7wfviCqkBVTDutPjX/aNI7i5DhpfOWiUrygwqgj6RW1L0lMz/0vkgB4J3co7djbS YbsA== X-Gm-Message-State: APjAAAXV+hQENv9DhjqeDAMBRN/tNPbnBuedWINf21wdUr5tU1v1x8NC luz7WXejhFI198zO471O0QTlA4VE2cvOgHvYqBT7pw== X-Google-Smtp-Source: APXvYqyZe6UX4PnyYQFgeFdC+lFAaMsVtQcx4eHDsOkQgVTuOMjLWUlHJlhVvdNewojPpy4WGslNE5+/tDmwSrou8LU= X-Received: by 2002:a37:a80a:: with SMTP id r10mr74179261qke.240.1578248253386; Sun, 05 Jan 2020 10:17:33 -0800 (PST) MIME-Version: 1.0 References: <202001051659.005GxOOa013759@repo.freebsd.org> <20200106.025257.202876441661893679.yasu@utahime.org> In-Reply-To: <20200106.025257.202876441661893679.yasu@utahime.org> From: Warner Losh Date: Sun, 5 Jan 2020 12:17:21 -0600 Message-ID: Subject: Re: svn commit: r356379 - head/share/mk To: Yasuhiro KIMURA Cc: Ed Maste , svn-src-head , svn-src-all@freebsd.org, src-committers@freebsd.org X-Rspamd-Queue-Id: 47rRgy2xGcz4Zbq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Krv7aPfX; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[5]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[b.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.68)[ip: (-9.36), ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.86), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:17:35 -0000 On Sun, Jan 5, 2020, 10:53 AM Yasuhiro KIMURA wrote: > From: Warner Losh > Subject: Re: svn commit: r356379 - head/share/mk > Date: Sun, 5 Jan 2020 11:26:07 -0600 > > >> > Author: emaste > >> > Date: Sun Jan 5 16:59:24 2020 > >> > New Revision: 356379 > >> > URL: https://svnweb.freebsd.org/changeset/base/356379 > >> > > >> > Log: > >> > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64* > >> > >> I should probably make this the case for all of mips* and sparc64. > >> Using a decade-old binutils with a contemporary compiler (either Clang > >> or GCC) isn't likely to be a combination used by anyone else and it's > >> not going to be a good use of our time investigating and addressing > >> any issues that arise. > >> > > I'd agree. There are lots of bugs or missing features in our binutils > that > > will bite people... > > Just out of curiosity, is there any retirement plan for binutils in > base system at the moment? > There are no firm plans at the moment. However, it looks like it's not used except for powerpc. I'd expect that once the issues there are resolved with clang, or that platform migrates to an external toolchain, binutils in base's days will be numbered since it is GPL and the project has a long term goal of being GPL free where possible. Warner --- > Yasuhiro KIMURA > From owner-svn-src-head@freebsd.org Sun Jan 5 18:17:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E01B81E183D; Sun, 5 Jan 2020 18:17:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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 47rRh95TXYz4Zjv; Sun, 5 Jan 2020 18:17:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f178.google.com with SMTP id v15so40896146iln.0; Sun, 05 Jan 2020 10:17:45 -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=x6/NQXW69sVzc1CKyh7h2R1noD+jHj8Cs3w9babuRvo=; b=sJlxzBZw/QRhURkgx5W7UOwmoMWQtfMGmHkiIL7OZefyjjEXhwHSBHHbssAPAuVJ22 EAkIWMms/huGKHnPtfmc+wOQLeGY/VIQPhw2yWQAcRMax3fToeZ73wnK27qO3Y8EA4bT /dydbr8P3ezqcqI2LmOqDURCsc//DcdGwAWt93DlkSOL2wX5nor7IVnCsR/CiBvFKV9l aMMtflnmmHunY/Cf5A1CAIKLvgOg99w5jB3ssO/52CGSxn/PPg84RqZXgKaRBqwGOKUu jxVIeBjPT7uWot61HGv3V+6YFfpq08MmNF+cuuIyUpw3mCgiHHfmD65owmORbcRrfJoO UZMw== X-Gm-Message-State: APjAAAXVO36aCrN+IyuDRpQ+GC7h5DtFfO7jCrkvJjcHtNudyawG7EdP uD2IKwwI57h8covIZ+MGh7ckrAbcfkvibdENpZxIrw== X-Google-Smtp-Source: APXvYqw7MXDlmwLgn9OrHGPIPoAwywQyBun5JYaTybvp/drTGQSWAIDJeYtHPvGZCV9P8qGoObGy99a1M+c/s7IgNAw= X-Received: by 2002:a92:5c52:: with SMTP id q79mr69471028ilb.11.1578248264812; Sun, 05 Jan 2020 10:17:44 -0800 (PST) MIME-Version: 1.0 References: <202001051659.005GxOOa013759@repo.freebsd.org> <20200106.025257.202876441661893679.yasu@utahime.org> In-Reply-To: <20200106.025257.202876441661893679.yasu@utahime.org> From: Ed Maste Date: Sun, 5 Jan 2020 13:17:32 -0500 Message-ID: Subject: Re: svn commit: r356379 - head/share/mk To: Yasuhiro KIMURA Cc: Warner Losh , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47rRh95TXYz4Zjv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.178 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[178.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.32)[ip: (-6.59), ipnet: 209.85.128.0/17(-3.10), asn: 15169(-1.86), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:17:46 -0000 On Sun, 5 Jan 2020 at 12:53, Yasuhiro KIMURA wrote: > > Just out of curiosity, is there any retirement plan for binutils in > base system at the moment? There's no specific plan, but it is an ongoing goal. Only three binutils tools are used (for bootstrapping and in the installed system): as, ld, and objdump. BINUTILS_BOOTSTRAP is enabled on x86, 32-bit arm, and powerpc. At least both x86 archs still use GNU as for a few files; there's work in progress to migrate to Clang's IAS for all assembly files. I am not sure if bootstrap as actually gets used on arm or powerpc. objdump is also built, but not used on any arch. ld is built on powerpc and still being used there; it's not built on x86 or 32-bit arm. Making further progress depends on lld maturing (for powerpc) and addressing the assembler issue. There's no commitment to removing binutils for 13.0 but there is a reasonable probability we'll be able to do so. From owner-svn-src-head@freebsd.org Sun Jan 5 18:21:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 488911E1B97; Sun, 5 Jan 2020 18:21:27 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 47rRmQ69ylz4b5v; Sun, 5 Jan 2020 18:21:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f169.google.com with SMTP id v15so40900591iln.0; Sun, 05 Jan 2020 10:21:26 -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=0qjeOqPSUW8e3Y8r1gLpDeccEOdECDn1uyqdM/5a/Do=; b=XwtGaBWUYwc3P5SQs10eCbWpL1L2+veo9Vbv91kCPT1OY7wc3lxSVVmgVxmvKSR/UL I6Onbw5jknRssuDNE5rjn/vnYhsvmCxz8GyiZSf31kmwPvKSBjDME7UbdSMVE4n7cL6Y lmxXxAIFt6hs8sJ9UGAvC+axeqVHY/1GEg3VWxhxF+JfOAFI/hmVkiHi1Y0C1tj1WVMZ fcnKeS7ThNQGnLZvlTIuITWTDavhjIa8nTAvSuu2DzqBQOrZaX/AMeYUiSFMYdu3pJ8Q 8KXi0LJWpsvOqnLsvgEXKvifOBQcFUVe57SeaEnt9aEiarfEDOPfkefrCVuP7UvgcfoZ g+Gg== X-Gm-Message-State: APjAAAWdYiARukeBLd+262xaoDbo1mOjLLP7dfovdQ9qDPN8wyP3MmzE gkFHFMz89JcMLkawJJwoKlWXITqQEmbhOTi3TjkmSA== X-Google-Smtp-Source: APXvYqwwNPZWbiq3LWTBugmiEGSG6K9nv1Y4a1yc1X3lSM03UXZKN7dQrv/B1a99AlJqVA5QGf49ckuT1JKVfOGowpA= X-Received: by 2002:a92:4448:: with SMTP id a8mr84856960ilm.256.1578248485167; Sun, 05 Jan 2020 10:21:25 -0800 (PST) MIME-Version: 1.0 References: <202001050247.0052lu11098031@repo.freebsd.org> <0b3ae104-ea62-1aa8-c926-c6021565a050@FreeBSD.org> In-Reply-To: <0b3ae104-ea62-1aa8-c926-c6021565a050@FreeBSD.org> From: Ed Maste Date: Sun, 5 Jan 2020 13:21:12 -0500 Message-ID: Subject: Re: svn commit: r356367 - in head: . share/mk To: Pedro Giffuni Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47rRmQ69ylz4b5v X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:21:27 -0000 On Sun, 5 Jan 2020 at 13:16, Pedro Giffuni wrote: > > It's really nice how the compiler warning trend went down. > > On FreeBSD-head-mips-build* it went from 7691 warnings to 473 + 83. Thanks for mentioning that. Continuing to support ancient GCC is a drag on everyone using a contemporary compiler for development (in-tree or external toolchain) and thus I stuck with Warner's original timeline even though there are a few warts to resolve on some archs still. From owner-svn-src-head@freebsd.org Sun Jan 5 18:45:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C110F1E22B7; Sun, 5 Jan 2020 18:45:35 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from gate.utahime.jp (gate.utahime.jp [183.180.29.210]) (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 47rSJG6TWVz4c0y; Sun, 5 Jan 2020 18:45:34 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gate.utahime.jp (Postfix) with ESMTPS id 85F38488E7; Mon, 6 Jan 2020 03:45:31 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1578249931; bh=zJpzndhXvRbrh1RzC6X5k4JbyVUneaJlJ8s+rWUtAWU=; h=Date:To:Cc:Subject:From:In-Reply-To:References; b=qtZ/p3I4OmwVGfTOuLxyM3PqlLUeFzEHrocDcwxT5ZMsavpoIebXQ7ySAfvvakb5B HquWLQwkScrgmo/jkh8ESHOh2sU6F5vx/xkb/OVu48EcbI4lWhH4Rjq1RNoFvpJnSw BykEiZj6GJkBjR33yihZAqWnipvpIY8hdPdTPOlws2AdTQDz/JqUf2ifSuWGQivGOd YyGXrsZYq/OrCQ8M9XkVnvAlIgqxywxbS6bfCVo5Nm4dPQDJlsFXamF1NtIIEVs8IX V5fce2WwO7iyPsXJkeLkR9ONRiIwtT9DVulSR9Nel/GyrmHoyd+3AA+YkcnVWU8/1Q MwvVeFRfm+Qmg== Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id 47F6A5EFA9; Mon, 6 Jan 2020 03:45:29 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.1 at eastasia.home.utahime.org Date: Mon, 06 Jan 2020 03:44:59 +0900 (JST) Message-Id: <20200106.034459.54741258810442187.yasu@utahime.org> To: imp@bsdimp.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, emaste@freebsd.org Subject: Re: svn commit: r356379 - head/share/mk From: Yasuhiro KIMURA In-Reply-To: References: <20200106.025257.202876441661893679.yasu@utahime.org> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47rSJG6TWVz4c0y X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=qtZ/p3I4; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [0.80 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; NEURAL_HAM_MEDIUM(-0.55)[-0.546,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[utahime.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[utahime.org:+]; NEURAL_SPAM_LONG(0.00)[0.002,0]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.34)[ip: (0.23), ipnet: 183.180.0.0/16(0.12), asn: 2519(1.33), country: JP(0.03)]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 18:45:35 -0000 From: Warner Losh Subject: Re: svn commit: r356379 - head/share/mk Date: Sun, 5 Jan 2020 12:17:21 -0600 > There are no firm plans at the moment. However, it looks like it's not used > except for powerpc. I'd expect that once the issues there are resolved with > clang, or that platform migrates to an external toolchain, binutils in > base's days will be numbered since it is GPL and the project has a long > term goal of being GPL free where possible. From: Ed Maste Subject: Re: svn commit: r356379 - head/share/mk Date: Sun, 5 Jan 2020 13:17:32 -0500 > There's no specific plan, but it is an ongoing goal. Only three > binutils tools are used (for bootstrapping and in the installed > system): as, ld, and objdump. > > BINUTILS_BOOTSTRAP is enabled on x86, 32-bit arm, and powerpc. At > least both x86 archs still use GNU as for a few files; there's work in > progress to migrate to Clang's IAS for all assembly files. I am not > sure if bootstrap as actually gets used on arm or powerpc. objdump is > also built, but not used on any arch. ld is built on powerpc and still > being used there; it's not built on x86 or 32-bit arm. > > Making further progress depends on lld maturing (for powerpc) and > addressing the assembler issue. There's no commitment to removing > binutils for 13.0 but there is a reasonable probability we'll be able > to do so. Thank you for reply. I understand current status and hope binutils is successfully removed from base system before the release of 13.0. --- Yasuhiro KIMURA From owner-svn-src-head@freebsd.org Sun Jan 5 19:11:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC9681E2EE6 for ; Sun, 5 Jan 2020 19:11:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (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 47rStS2N5Yz4dFt for ; Sun, 5 Jan 2020 19:11:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x842.google.com with SMTP id j5so40880146qtq.9 for ; Sun, 05 Jan 2020 11:11:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mivEVkhTAg+DlOncDkurfv1jdKKa6o3le6ojI8nvUu0=; b=YwDj/6VNKMM2Brgmfn6sOQtLBSPs/NVoL6oWq5U3BuaFJUOFFE6xIGonHJzO8wpfUw LyGvDYAOnCVyHdslB1T7hes9qBg+qpdbaTEQN4+h4lSXmFfHrrS2lcUKJy95AWnCcMCu uFrNxWfVITyjKtRvl4HRSUZGRGp8IR478pOur0zaxNqNOkpig3Zdn2bVOTpcoglcBOAX c17Qe0kEtxk4Plezg+Is+VJHV0J+q+HPG6hEPbHevwJAOvqHGeeLHCJVEiZKb1HGm2fW eLeAHjYpNRd6yuaBGbS8vAr1AkLO8m6znH4wtqXapg7YMdrdBxwGbf5/47K79yZvTpc7 KFIg== 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=mivEVkhTAg+DlOncDkurfv1jdKKa6o3le6ojI8nvUu0=; b=UOy9X/QupIE3fjP24Sb0hSUNjnCg9J4bYaaHlEWBMr+aS04MNqv2dbNzxEmetHFs2s e6uJOs4pXgCqlMftUeL132Niz0pRDNpTn0ZMPBxQpb6UiH/QHVpGvFN8uclM1q1HD7Fb aNhWePNd73gNmQTeVrnEn2gdMPcowds1DJTnBluYlfXTAheSgC1k7RG4ROGxbniOFLDB nSHgLudUWBck2Ka2zVsDxHcIeehafZrEAUtoH6gI1eUtM8qC1RXK5quFFdBbyMjvnmu+ HyvihIl6hybMAo4bCVbVK8uYZ4eixOi3ZrRhyRIcBOp5l30IVsPGJI9Aos3Ii9RB7/bw W9VA== X-Gm-Message-State: APjAAAVVrxqI6jaZQa9lZpP1VvYPWjh8tRcoqyfUkqDuLnXUVsFLE6Iz 2idC7nqrqn8hSOwdxqhpp98v/ylQIP/pH6F17Bubfg== X-Google-Smtp-Source: APXvYqylslzlBYdkn+cpqqPbWch5U2i9iCKaj6ZYsP+J8j8fK7TRMkhM3HEK/sx+Ydz4LzYDc8Ka4VcRyIh1ooSgBeY= X-Received: by 2002:ac8:21ec:: with SMTP id 41mr73266692qtz.242.1578251503196; Sun, 05 Jan 2020 11:11:43 -0800 (PST) MIME-Version: 1.0 References: <202001050247.0052lu11098031@repo.freebsd.org> <0b3ae104-ea62-1aa8-c926-c6021565a050@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Sun, 5 Jan 2020 13:11:30 -0600 Message-ID: Subject: Re: svn commit: r356367 - in head: . share/mk To: Ed Maste Cc: Pedro Giffuni , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47rStS2N5Yz4dFt X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=YwDj/6VN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::842) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.38 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.38)[ip: (2.12), ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.86), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 19:11:45 -0000 On Sun, Jan 5, 2020, 11:21 AM Ed Maste wrote: > On Sun, 5 Jan 2020 at 13:16, Pedro Giffuni wrote: > > > > It's really nice how the compiler warning trend went down. > > > > On FreeBSD-head-mips-build* it went from 7691 warnings to 473 + 83. > > Thanks for mentioning that. Continuing to support ancient GCC is a > drag on everyone using a contemporary compiler for development > (in-tree or external toolchain) and thus I stuck with Warner's > original timeline even though there are a few warts to resolve on some > archs still. > And the warts are generally adequately resolved by external toolchain. Except for sparc64, for which nobody has done any nontrivial work on for this transition. All the other architects have had most of this issues identified with process resolved, or well on the way to resolution. This total lack of work on sparc64 may result in an accelerated timeline for its removal. Warner > From owner-svn-src-head@freebsd.org Sun Jan 5 19:14:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C5BD1E323B; Sun, 5 Jan 2020 19:14:17 +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 47rSxP0v7Rz4dqj; Sun, 5 Jan 2020 19:14:17 +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 18C5322A0; Sun, 5 Jan 2020 19:14:17 +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 005JEGm1096462; Sun, 5 Jan 2020 19:14:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005JEGl8096460; Sun, 5 Jan 2020 19:14:16 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001051914.005JEGl8096460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 5 Jan 2020 19:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356386 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 356386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 19:14:17 -0000 Author: bz Date: Sun Jan 5 19:14:16 2020 New Revision: 356386 URL: https://svnweb.freebsd.org/changeset/base/356386 Log: netgraph/ng_bridge: Reestablish old ABI In order to be able to merge r353026 bring back support for the old cookie API for a transition period in 12.x releases (and possibly 13) before the old API can be removed again entirely. Suggested by: julian Submitted by: Lutz Donnerhacke (lutz donnerhacke.de) PR: 240787 Reviewed by: julian MFC after: 2 weeks X-MFC with: r353026 Differential Revision: https://reviews.freebsd.org/D21961 Modified: head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_bridge.h Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Sun Jan 5 18:15:41 2020 (r356385) +++ head/sys/netgraph/ng_bridge.c Sun Jan 5 19:14:16 2020 (r356386) @@ -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: Modified: head/sys/netgraph/ng_bridge.h ============================================================================== --- head/sys/netgraph/ng_bridge.h Sun Jan 5 18:15:41 2020 (r356385) +++ head/sys/netgraph/ng_bridge.h Sun Jan 5 19:14:16 2020 (r356386) @@ -43,10 +43,24 @@ #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 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) */ @@ -59,6 +73,13 @@ struct ng_bridge_config { 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 { \ { "debugLevel", &ng_parse_uint8_type }, \ @@ -115,6 +136,15 @@ struct ng_bridge_host { 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 */ @@ -144,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-head@freebsd.org Sun Jan 5 19:44:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE30C1E422A for ; Sun, 5 Jan 2020 19:44:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-20.consmr.mail.gq1.yahoo.com (sonic305-20.consmr.mail.gq1.yahoo.com [98.137.64.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47rTby6Gg4z3Byn for ; Sun, 5 Jan 2020 19:44:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: J1LOu9YVM1n53nm1XDPWlJwM832p.Z0eUkpzASG3f4TbnXbHMld5raM1_4ZJ16K 36lQeU2G2dt0VvsDKENmRhgxM66wan5auISUsh4qrOehongkCbT82SROkXO0lJfUhZPl7j4VWGQC HnGfegEQSnHqZE3UdtvNCxlcZYYV1cbJvpfJF1xJ5n2pnFow1lqb64VKTb9AKgBLzFqmLNXyCb.D wMN1WAUsc5t88nXI6vMjdAPgC5W3ybgJSfRsUXSIN_TLtqaX2fhQ29qhVX9js66Dm5a34PphBBtE GToTc5pq5oNA.N5Ud7tOtgWqX3OXryo4bfhREyPdWYpPFM8uTBBYbrk3TG.NBl7TWIHy4BenZcaH M9PJpLUExeQMiSm.HHRssEnH1qXpz0CqS5VW2Y3PhTKYAf4x1XtChMAByuFvhQiYpKWg8TQgCHdR kYxHSbxCRnHGnbp2ZXWVkxEGIO6NXs3KYelD48eXy.GaJJOmTijxXVqF9jtgBqiXnuoqMFzHukLP EadZLbv8buROZ4U9KaZrCqJl9KGyWXEUtNJ5_xdbopGCGg12cKEpGvVeUfPPcXrobNWZX3MAJHI6 SPSwK_aRxuozhlVZCuBVTLo4g6bkgGQmzE.ESHIdljsQZHp2bXPvpTXCUNdImz6uliONfZia1SWC ZL3uLhFAsDig04Z7.PR7Tsq30N7nY8eAAujSbWyO_sS8NrEN0tXA_vMtnlpojuLByZy2SUHZ5lJI QM1hdfcfNMlcnspZ6rCAayNdr5rKmWr0i2ZNcUlBeMPS5VXfRLTdyR9NK1Zls883TuBBk45DkCK2 oeYiCiEzxMbim5lTPvUlGVKohaw0KUpSZ7w2Zm52mth_0yJt5_L8iXKTinDdFnB_R5_uBZIeRiJW 4RxltUwriIH16YDWy55_rueeYE6cMs90gChSXptNl_RybBDBz3PHtRsAKrNPH2LyKfm.HduGT7XN BJr4v4Xq7HZc_Q1cwKsCn9L3Tb7ZTwf.rZPsVVwzBs9xCSQjEhstQ730DJqTCgEWpE2kvccESbP8 sAt_6TH1HUVs0vAC94NFQq1BcKXm.dKCoenKN8aggA2ug.xkOlmlwImUdhVaP2dewB0xBSx8kUFg cQtpx_uBv11l4yhUcPFKsIfacqf8Kzp4IBTDl7q2SoFzuNMjGQBH786rpH0tR8hgplMifYtGsUz3 MNn9y9hSrCpA3HVqtUJP_9MsnckFtG43GmGVUCLvRveCrpMhXR1InwvEIM2LbmkkmUTcNRU6bGA8 zyL6pq6ckz8NSmr9OrWyXeZgbCx9hJ6Dzc2e83ABVnaG0eEiwybtyXUFWZbl2w35zkldspHqaBKv EcB6NDDcY23B9etVpQqSHFBItz7NOKvDBCIvJqVoTCejc55PsqBd5dsKbARcZgYbOhDxhuf_1.yB xpZv3cfFNze5NbMEw6XmPJNhQDbaGG2HF9g-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.gq1.yahoo.com with HTTP; Sun, 5 Jan 2020 19:44:13 +0000 Received: by smtp418.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 77d48376ce88ebe8291c421e1aee4171; Sun, 05 Jan 2020 19:44:09 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r356379 - head/share/mk Message-Id: <8FEA0145-AF03-46EA-8AD7-E0B13C29965A@yahoo.com> Date: Sun, 5 Jan 2020 11:44:07 -0800 To: Ed Maste , Justin Hibbits , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3608.40.2.2.4) References: <8FEA0145-AF03-46EA-8AD7-E0B13C29965A.ref@yahoo.com> X-Rspamd-Queue-Id: 47rTby6Gg4z3Byn X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.19 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.80)[-0.798,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.89)[-0.890,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[83.64.137.98.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[ip: (2.45), ipnet: 98.137.64.0/21(0.88), asn: 36647(0.70), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 19:44:15 -0000 Justin Hibbits chmeeedalf at gmail.com wrote on Sun Jan 5 18:03:59 UTC 2020 : > On Sun, 5 Jan 2020 12:21:53 -0500 Ed Maste = wrote: > On Sun, 5 Jan 2020 at 11:59, Ed Maste = wrote:=20 > > >=20 > > > Author: emaste=20 > > > Date: Sun Jan 5 16:59:24 2020=20 > > > New Revision: 356379=20 > > > URL: https://svnweb.freebsd.org/changeset/base/356379 > > >=20 > > > Log:=20 > > > src.opts.mk: disable BINUTILS_BOOTSTRAP on mips64*=20 > >=20 > > I should probably make this the case for all of mips* and sparc64.=20= > > Using a decade-old binutils with a contemporary compiler (either = Clang=20 > > or GCC) isn't likely to be a combination used by anyone else and = it's=20 > > not going to be a good use of our time investigating and addressing=20= > > any issues that arise.=20 > powerpc and powerpcspe still use in-tree binutils (or external = binutils... but in-tree works well enough, until we start adding = ifuncs), until such a time that lld is fully functional.=20 FYI: I've tried the following combinations involving devel/binutils@powerpc for 32-bit powerpc, either the kernel crashed extremely early or the build fails to complete. system-clang and devel/binutils@powerpc (the crashing case) devel/gcc9@powerpc and devel/binutils@powerpc (fails to build) (These were cross builds.) On the old 32-bit PowerMacs the crash is before Apple's displayed material is replaced and it gets back to Apple's prompt after the error message. The only combination that I've had success with so far for 32-bit powerpc has been system-clang for buildkernel with the in-tree-binutils used. This may not matter much until ifuncs additions are desired --or ever if lld becomes sufficient first. The build failure is for: --- libc.so.7.full --- /usr/local/bin/powerpc-unknown-freebsd13.0-ld: bss-plt forced due to = /usr/obj/powerpcvtsc_xtoolchain-gcc/powerpc.powerpc/usr/src/powerpc.powerp= c/tmp/usr/lib/crtbeginS.o collect2: error: ld returned 1 exit status *** [libc.so.7.full] Error code 1 As for the crashing case, looking at the kernel produced show significant differences in where ABS is used and some other differences. (I do not claim anything like a complete comparison.) Without work on one or both sides, devel/binutils@powerpc does not seem to be an alternative. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sun Jan 5 21:07:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F8BB1E6C86; Sun, 5 Jan 2020 21:07:20 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rWRq5kBTz3HMW; Sun, 5 Jan 2020 21:07:19 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 79520170E3; Sun, 5 Jan 2020 21:07:18 +0000 (UTC) Date: Sun, 5 Jan 2020 21:07:17 +0000 From: Mark Linimon To: Warner Losh Cc: Ed Maste , svn-src-head , svn-src-all , Pedro Giffuni , src-committers Subject: Re: svn commit: r356367 - in head: . share/mk Message-ID: <20200105210716.GA25654@lonesome.com> References: <202001050247.0052lu11098031@repo.freebsd.org> <0b3ae104-ea62-1aa8-c926-c6021565a050@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 47rWRq5kBTz3HMW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of linimon@lonesome.com has no SPF policy when checking 18.222.6.11) smtp.mailfrom=linimon@lonesome.com X-Spamd-Result: default: False [-1.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.922,0]; FROM_HAS_DN(0.00)[]; IP_SCORE(-0.21)[ip: (0.02), ipnet: 18.220.0.0/14(0.19), asn: 16509(-1.21), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lonesome.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.66)[-0.662,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[11.6.222.18.list.dnswl.org : 127.0.5.2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 21:07:20 -0000 On Sun, Jan 05, 2020 at 01:11:30PM -0600, Warner Losh wrote: > This total lack of work on sparc64 may result in an accelerated > timeline for its removal. IMHO it's time to just let it go. mcl From owner-svn-src-head@freebsd.org Sun Jan 5 21:23:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AB511E75A1; Sun, 5 Jan 2020 21:23:14 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rWpB0MGFz3JNg; Sun, 5 Jan 2020 21:23:13 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 14630170E3; Sun, 5 Jan 2020 21:23:13 +0000 (UTC) Date: Sun, 5 Jan 2020 21:23:11 +0000 From: Mark Linimon To: Warner Losh Cc: Yasuhiro KIMURA , svn-src-head , svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Maste Subject: Re: svn commit: r356379 - head/share/mk Message-ID: <20200105212311.GB25654@lonesome.com> References: <202001051659.005GxOOa013759@repo.freebsd.org> <20200106.025257.202876441661893679.yasu@utahime.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 47rWpB0MGFz3JNg X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of linimon@lonesome.com has no SPF policy when checking 18.222.6.11) smtp.mailfrom=linimon@lonesome.com X-Spamd-Result: default: False [-1.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.919,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.21)[ip: (0.02), ipnet: 18.220.0.0/14(0.19), asn: 16509(-1.21), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lonesome.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.66)[-0.664,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[11.6.222.18.list.dnswl.org : 127.0.5.2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 21:23:14 -0000 On Sun, Jan 05, 2020 at 12:17:21PM -0600, Warner Losh wrote: > I'd expect that once the issues [on powerpc] are resolved with clang, > or that platform migrates to an external toolchain AFAIK there never was a fallback plan to migrate powerpc to an external toolchain; powerpc64-head (at least) has already been switched to clang. You'll have to ask jhibbits about 32-bit. mcl From owner-svn-src-head@freebsd.org Sun Jan 5 22:25:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB24F1E899B for ; Sun, 5 Jan 2020 22:25:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47rY9W1Vz9z3M3B for ; Sun, 5 Jan 2020 22:25:02 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1578263102; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=cFB8RVHcNMF8gPCqL9FImqFErbkYx9YQvk4qbctJcAr+rn0KakrtBjY01i2HHBItJb4JMY7ffOz3A JhDCrW07q38W4h+S8wgCTFhXLAoC7fTiawPKsolYE6OXSfQdI+wESreZ78GHw0vp0P4BCRGF/VQiXO VNM6vkyNmztwLl4dXww9tuW4RbRfVKZIAoSAh7D7+JhG9z5kr4lCbnKmjUqrt9T3BupY5b2jSo7/Ee /OsP2OHIMPWiWgnpwbgV1qZyW8MSeHSJzloJZKYsbbVQaD5p/wJVaHx7MJcq41V2rtV5LhNk7B9f+f /Ahn1H5E7VyeWIA1ogLCRgiTtxNPKrw== 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=3gLbnQtjOpvjVZ8unURx9ELPeqoACeQbC5hISBECe4g=; b=T+AgJpy2DILrEaO/Yx/Wi8Wg6TSKIXazJzSW+nYxK4WQRRNvNZyHtPYwbjvTY210RTyw2Yb/MX2Cy ffRk86JygOwxucxm1OzXCxC1ni+xr181lqY6ipdwlqsuoQS8CeTeYY7TRfiWWUaNN+IMuXLyFP/atm eIvuBMLLklDeZ2AkULBQNyNwtyeGBO/eRq7lwRy8r/6GxKUe+y+/F5mejh7ujFp2nlYkTTdRpknRMw yEent0PCL/GKAch7oSJQZl55nkLfD1cmjyd6FQKukJMoGv03wU96lHRjOT8Dh5CVcLlTQ/v8bVCFGX qU+4Z56fbMIYIiAiyvrKMeX2qpWPFPg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=3gLbnQtjOpvjVZ8unURx9ELPeqoACeQbC5hISBECe4g=; b=EQ/o8co+ioKRGPtgj8PQcEPWxvkz72VEBbtSmfbKV2FEEFsLWFzdMeyj81tz7zixOp++AbFE5ECod 9T2PQB5wuDWwBqTwcIj3+WWigfBWBdN886yofBe4GmGh+sgKHzGElGa8hWs2YKdWMrKyQExeO4nj7y TIzC9mkMVM6hfJrni8mhiH0wWUJBcPCVZEJ24TC9P9JPjOF0LGCstHcD7wv5AAq1NPBfiYog5km4+9 3DjZJiYTDdBSnjcRjjRBiHD5ahlP23CFXeuV4rcOm/aKXRgWL9MO8CVj/+SIKp4rioU+Em3NzNT1ws jl8DplH9ZTGQ8KZ3JVDQUrm1wg8R6ag== X-MHO-RoutePath: aGlwcGll X-MHO-User: 3572e957-300a-11ea-829f-79a40d15cccd X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 3572e957-300a-11ea-829f-79a40d15cccd; Sun, 05 Jan 2020 22:25:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 005MOw7n025702; Sun, 5 Jan 2020 15:24:58 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r356379 - head/share/mk From: Ian Lepore To: Ed Maste , Yasuhiro KIMURA Cc: Warner Losh , svn-src-head , svn-src-all , src-committers Date: Sun, 05 Jan 2020 15:24:58 -0700 In-Reply-To: References: <202001051659.005GxOOa013759@repo.freebsd.org> <20200106.025257.202876441661893679.yasu@utahime.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47rY9W1Vz9z3M3B X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 22:25:04 -0000 On Sun, 2020-01-05 at 13:17 -0500, Ed Maste wrote: > On Sun, 5 Jan 2020 at 12:53, Yasuhiro KIMURA > wrote: > > > > Just out of curiosity, is there any retirement plan for binutils in > > base system at the moment? > > There's no specific plan, but it is an ongoing goal. Only three > binutils tools are used (for bootstrapping and in the installed > system): as, ld, and objdump. > > BINUTILS_BOOTSTRAP is enabled on x86, 32-bit arm, and powerpc. At > least both x86 archs still use GNU as for a few files; there's work > in > progress to migrate to Clang's IAS for all assembly files. I am not > sure if bootstrap as actually gets used on arm or powerpc. objdump is > also built, but not used on any arch. ld is built on powerpc and > still > being used there; it's not built on x86 or 32-bit arm. > I just set WITHOUT_BINUTILS_BOOTSTRAP in src.conf and did an arm32 crossbuild from amd64 after an rm -rf in $objdir, and both kernel and world built successfully. -- Ian > Making further progress depends on lld maturing (for powerpc) and > addressing the assembler issue. There's no commitment to removing > binutils for 13.0 but there is a reasonable probability we'll be able > to do so. From owner-svn-src-head@freebsd.org Sun Jan 5 22:54:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D27E1E9248; Sun, 5 Jan 2020 22:54:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rYqQ1QDkz3NBx; Sun, 5 Jan 2020 22:54:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA4C4EB5; Sun, 5 Jan 2020 22:54:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 005MsQcL027910; Sun, 5 Jan 2020 22:54:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 005MsQsH027909; Sun, 5 Jan 2020 22:54:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001052254.005MsQsH027909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 5 Jan 2020 22:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356389 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 22:54:26 -0000 Author: jeff Date: Sun Jan 5 22:54:25 2020 New Revision: 356389 URL: https://svnweb.freebsd.org/changeset/base/356389 Log: The fix in r356353 was insufficient. Not every architecture returns 0 for EARLY_COUNTER. Only amd64 seems to. Suggested by: markj Reported by: lwhsu Reviewed by: markj PR: 243117 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Jan 5 21:35:02 2020 (r356388) +++ head/sys/vm/uma_core.c Sun Jan 5 22:54:25 2020 (r356389) @@ -4153,8 +4153,10 @@ uma_zone_get_cur(uma_zone_t zone) int64_t nitems; u_int i; - nitems = counter_u64_fetch(zone->uz_allocs) - - counter_u64_fetch(zone->uz_frees); + nitems = 0; + if (zone->uz_allocs != EARLY_COUNTER && zone->uz_frees != EARLY_COUNTER) + nitems = counter_u64_fetch(zone->uz_allocs) - + counter_u64_fetch(zone->uz_frees); CPU_FOREACH(i) nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs) - atomic_load_64(&zone->uz_cpu[i].uc_frees); @@ -4168,7 +4170,9 @@ uma_zone_get_allocs(uma_zone_t zone) uint64_t nitems; u_int i; - nitems = counter_u64_fetch(zone->uz_allocs); + nitems = 0; + if (zone->uz_allocs != EARLY_COUNTER) + nitems = counter_u64_fetch(zone->uz_allocs); CPU_FOREACH(i) nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs); @@ -4181,7 +4185,9 @@ uma_zone_get_frees(uma_zone_t zone) uint64_t nitems; u_int i; - nitems = counter_u64_fetch(zone->uz_frees); + nitems = 0; + if (zone->uz_frees != EARLY_COUNTER) + nitems = counter_u64_fetch(zone->uz_frees); CPU_FOREACH(i) nitems += atomic_load_64(&zone->uz_cpu[i].uc_frees); From owner-svn-src-head@freebsd.org Sun Jan 5 23:27:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F25E1EA295; Sun, 5 Jan 2020 23:27:25 +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 47rZYT2F5lz3Q9g; Sun, 5 Jan 2020 23:27:24 +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 005NRFKv078673; Sun, 5 Jan 2020 15:27:15 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 005NRFsk078672; Sun, 5 Jan 2020 15:27:15 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202001052327.005NRFsk078672@gndrsh.dnsmgr.net> Subject: Re: svn commit: r356367 - in head: . share/mk In-Reply-To: To: Ed Maste Date: Sun, 5 Jan 2020 15:27:15 -0800 (PST) CC: Mark Linimon , src-committers , svn-src-all , svn-src-head 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: 47rZYT2F5lz3Q9g X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2020 23:27:25 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sat, 4 Jan 2020 at 21:57, Mark Linimon wrote: > > > > On Sun, Jan 05, 2020 at 02:47:56AM +0000, Ed Maste wrote: > > > Do not build GCC 4.2.1 by default for any CPU architecture > > > > And there was much rejoicing :-) > > > > (but plz not to MFC tnx) > > Indeed, I should have tagged it with: > > Relnotes: YES You can still add a entry to RELNOTES. > MFC after: never -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jan 6 01:51:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5AB41ED5BC; Mon, 6 Jan 2020 01:51:23 +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 47rdlb4M3Cz42ty; Mon, 6 Jan 2020 01:51:23 +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 90D386F2C; Mon, 6 Jan 2020 01:51:23 +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 0061pN6X034207; Mon, 6 Jan 2020 01:51:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0061pNNB034206; Mon, 6 Jan 2020 01:51:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001060151.0061pNNB034206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 6 Jan 2020 01:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356392 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 356392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 01:51:23 -0000 Author: mav Date: Mon Jan 6 01:51:23 2020 New Revision: 356392 URL: https://svnweb.freebsd.org/changeset/base/356392 Log: Fix host memory buffer sizes reporting. Hardware reports values in 4KB units, not in bytes. MFC after: 3 days Modified: head/sbin/nvmecontrol/identify_ext.c Modified: head/sbin/nvmecontrol/identify_ext.c ============================================================================== --- head/sbin/nvmecontrol/identify_ext.c Mon Jan 6 01:15:35 2020 (r356391) +++ head/sbin/nvmecontrol/identify_ext.c Mon Jan 6 01:51:23 2020 (r356392) @@ -192,8 +192,10 @@ nvme_print_controller(struct nvme_controller_data *cda uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf))); } - printf("Host Buffer Preferred Size: %d bytes\n", cdata->hmpre); - printf("Host Buffer Minimum Size: %d bytes\n", cdata->hmmin); + printf("Host Buffer Preferred Size: %llu bytes\n", + (long long unsigned)cdata->hmpre * 4096); + printf("Host Buffer Minimum Size: %llu bytes\n", + (long long unsigned)cdata->hmmin * 4096); printf("\n"); printf("NVM Command Set Attributes\n"); From owner-svn-src-head@freebsd.org Mon Jan 6 02:51:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A9931EE7BC; Mon, 6 Jan 2020 02:51:20 +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 47rg4m3cgPz452G; Mon, 6 Jan 2020 02:51:20 +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 5EAD079F3; Mon, 6 Jan 2020 02:51:20 +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 0062pKPb067927; Mon, 6 Jan 2020 02:51:20 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0062pJe9067924; Mon, 6 Jan 2020 02:51:19 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001060251.0062pJe9067924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 6 Jan 2020 02:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356393 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 02:51:20 -0000 Author: jeff Date: Mon Jan 6 02:51:19 2020 New Revision: 356393 URL: https://svnweb.freebsd.org/changeset/base/356393 Log: Fix uma boot pages calculations on NUMA machines that also don't have MD_UMA_SMALL_ALLOC. This is unusual but not impossible. Fix the alignemnt of zones while here. This was already correct because uz_cpu strongly aligned the zone structure but the specified alignment did not match reality and involved redundant defines. Reviewed by: markj, rlibby Differential Revision: https://reviews.freebsd.org/D23046 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Jan 6 01:51:23 2020 (r356392) +++ head/sys/vm/uma_core.c Mon Jan 6 02:51:19 2020 (r356393) @@ -2508,27 +2508,28 @@ zone_foreach(void (*zfunc)(uma_zone_t, void *arg), voi * zone of zones and zone of kegs are accounted separately. */ #define UMA_BOOT_ZONES 11 -/* Zone of zones and zone of kegs have arbitrary alignment. */ -#define UMA_BOOT_ALIGN 32 static int zsize, ksize; int uma_startup_count(int vm_zones) { int zones, pages; + u_int zppera, zipers; + u_int kppera, kipers; size_t space, size; ksize = sizeof(struct uma_keg) + (sizeof(struct uma_domain) * vm_ndomains); + ksize = roundup(ksize, UMA_SUPER_ALIGN); zsize = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); + zsize = roundup(zsize, UMA_SUPER_ALIGN); /* - * Memory for the zone of kegs and its keg, - * and for zone of zones. + * Memory for the zone of kegs and its keg, and for zone + * of zones. Allocated directly in uma_startup(). */ - pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + - roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + pages = howmany(zsize * 2 + ksize, PAGE_SIZE); #ifdef UMA_MD_SMALL_ALLOC zones = UMA_BOOT_ZONES; @@ -2542,23 +2543,33 @@ uma_startup_count(int vm_zones) /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > space) { /* See keg_large_init(). */ - u_int ppera; + zppera = howmany(zsize + slab_sizeof(1), PAGE_SIZE); + zipers = 1; + zones += vm_zones; + } else { + zppera = 1; + zipers = space / zsize; + } + pages += howmany(zones, zipers) * zppera; - ppera = howmany(roundup2(zsize, UMA_BOOT_ALIGN), PAGE_SIZE); - if (PAGE_SIZE * ppera - roundup2(zsize, UMA_BOOT_ALIGN) < size) - ppera++; - pages += (zones + vm_zones) * ppera; - } else if (roundup2(zsize, UMA_BOOT_ALIGN) > space) - /* See keg_small_init() special case for uk_ppera = 1. */ - pages += zones; - else - pages += howmany(zones, - space / roundup2(zsize, UMA_BOOT_ALIGN)); - /* ... and their kegs. Note that zone of zones allocates a keg! */ - pages += howmany(zones + 1, - space / roundup2(ksize, UMA_BOOT_ALIGN)); + if (ksize > space) { + /* See keg_large_init(). */ + kppera = howmany(ksize + slab_sizeof(1), PAGE_SIZE); + kipers = 1; + } else { + kppera = 1; + kipers = space / ksize; + } + pages += howmany(zones + 1, kipers) * kppera; + /* + * Allocate an additional slab for zones and kegs on NUMA + * systems. The round-robin allocation policy will populate at + * least one slab per-domain. + */ + pages += (vm_ndomains - 1) * (zppera + kppera); + return (pages); } @@ -2578,11 +2589,11 @@ uma_startup(void *mem, int npages) /* Use bootpages memory for the zone of zones and zone of kegs. */ m = (uintptr_t)mem; zones = (uma_zone_t)m; - m += roundup(zsize, CACHE_LINE_SIZE); + m += zsize; kegs = (uma_zone_t)m; - m += roundup(zsize, CACHE_LINE_SIZE); + m += zsize; masterkeg = (uma_keg_t)m; - m += roundup(ksize, CACHE_LINE_SIZE); + m += ksize; m = roundup(m, PAGE_SIZE); npages -= (m - (uintptr_t)mem) / PAGE_SIZE; mem = (void *)m; @@ -2596,7 +2607,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = masterkeg; - args.align = UMA_BOOT_ALIGN - 1; + args.align = UMA_SUPER_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -2610,7 +2621,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = NULL; - args.align = UMA_BOOT_ALIGN - 1; + args.align = UMA_SUPER_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(zones, zsize, &args, M_WAITOK); @@ -4295,10 +4306,7 @@ uma_zone_reserve_kva(uma_zone_t zone, int count) KEG_ASSERT_COLD(keg); ZONE_ASSERT_COLD(zone); - pages = count / keg->uk_ipers; - if (pages * keg->uk_ipers < count) - pages++; - pages *= keg->uk_ppera; + pages = howmany(count, keg->uk_ipers) * keg->uk_ppera; #ifdef UMA_MD_SMALL_ALLOC if (keg->uk_ppera > 1) { @@ -4340,9 +4348,7 @@ uma_prealloc(uma_zone_t zone, int items) int aflags, domain, slabs; KEG_GET(zone, keg); - slabs = items / keg->uk_ipers; - if (slabs * keg->uk_ipers < items) - slabs++; + slabs = howmany(items, keg->uk_ipers); while (slabs-- > 0) { aflags = M_NOWAIT; vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Mon Jan 6 01:51:23 2020 (r356392) +++ head/sys/vm/uma_int.h Mon Jan 6 02:51:19 2020 (r356393) @@ -166,14 +166,17 @@ struct uma_hash { }; /* - * align field or structure to cache line + * Align field or structure to cache 'sector' in intel terminology. This + * is more efficient with adjacent line prefetch. */ #if defined(__amd64__) || defined(__powerpc64__) -#define UMA_ALIGN __aligned(128) +#define UMA_SUPER_ALIGN (CACHE_LINE_SIZE * 2) #else -#define UMA_ALIGN __aligned(CACHE_LINE_SIZE) +#define UMA_SUPER_ALIGN CACHE_LINE_SIZE #endif +#define UMA_ALIGN __aligned(UMA_SUPER_ALIGN) + /* * The uma_bucket structure is used to queue and manage buckets divorced * from per-cpu caches. They are loaded into uma_cache_bucket structures @@ -532,7 +535,7 @@ struct uma_zone { KASSERT(uma_zone_get_allocs((z)) == 0, \ ("zone %s initialization after use.", (z)->uz_name)) -#undef UMA_ALIGN +#undef UMA_ALIGN #ifdef _KERNEL /* Internal prototypes */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jan 6 01:51:23 2020 (r356392) +++ head/sys/vm/vm_page.c Mon Jan 6 02:51:19 2020 (r356393) @@ -613,10 +613,17 @@ vm_page_startup(vm_offset_t vaddr) slab_ipers(sizeof(struct vm_map), UMA_ALIGN_PTR)); /* - * Before going fully functional kmem_init() does allocation - * from "KMAP ENTRY" and vmem_create() does allocation from "vmem". + * Before we are fully boot strapped we need to account for the + * following allocations: + * + * "KMAP ENTRY" from kmem_init() + * "vmem btag" from vmem_startup() + * "vmem" from vmem_create() + * "KMAP" from vm_map_startup() + * + * Each needs at least one page per-domain. */ - boot_pages += 2; + boot_pages += 4 * vm_ndomains; #endif /* * CTFLAG_RDTUN doesn't work during the early boot process, so we must From owner-svn-src-head@freebsd.org Mon Jan 6 09:49:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D9561FF072; Mon, 6 Jan 2020 09:49:21 +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 47rrM51Qrxz4V5V; Mon, 6 Jan 2020 09:49:21 +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 2C42EC817; Mon, 6 Jan 2020 09:49:21 +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 0069nLwF020556; Mon, 6 Jan 2020 09:49:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0069nK9e020554; Mon, 6 Jan 2020 09:49:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001060949.0069nK9e020554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Jan 2020 09:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356409 - in head/sys: dev/usb sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: dev/usb sys X-SVN-Commit-Revision: 356409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 09:49:21 -0000 Author: hselasky Date: Mon Jan 6 09:49:20 2020 New Revision: 356409 URL: https://svnweb.freebsd.org/changeset/base/356409 Log: Add own counter for cancelled USB transfers. Do not count these as errors. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_transfer.c head/sys/sys/param.h Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Jan 6 09:40:59 2020 (r356408) +++ head/sys/dev/usb/usb_device.h Mon Jan 6 09:49:20 2020 (r356409) @@ -191,6 +191,7 @@ struct usb_device { /* statistics */ struct usb_device_statistics stats_err; struct usb_device_statistics stats_ok; + struct usb_device_statistics stats_cancelled; /* generic clear stall message */ struct usb_udev_msg cs_msg[2]; Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon Jan 6 09:40:59 2020 (r356408) +++ head/sys/dev/usb/usb_transfer.c Mon Jan 6 09:49:20 2020 (r356409) @@ -2593,7 +2593,10 @@ usbd_transfer_done(struct usb_xfer *xfer, usb_error_t } #endif /* keep some statistics */ - if (xfer->error) { + if (xfer->error == USB_ERR_CANCELLED) { + info->udev->stats_cancelled.uds_requests + [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; + } else if (xfer->error != USB_ERR_NORMAL_COMPLETION) { info->udev->stats_err.uds_requests [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; } else { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jan 6 09:40:59 2020 (r356408) +++ head/sys/sys/param.h Mon Jan 6 09:49:20 2020 (r356409) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300074 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300075 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Jan 6 10:52:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FF6A1D0D2D; Mon, 6 Jan 2020 10:52:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rslf0wGhz4YbT; Mon, 6 Jan 2020 10:52:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0250FD4A0; Mon, 6 Jan 2020 10:52:14 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006AqD21061354; Mon, 6 Jan 2020 10:52:13 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006AqDQU061353; Mon, 6 Jan 2020 10:52:13 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202001061052.006AqDQU061353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Mon, 6 Jan 2020 10:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356413 - in head/sys: amd64/amd64 arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 X-SVN-Commit-Revision: 356413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 10:52:14 -0000 Author: kaktus Date: Mon Jan 6 10:52:13 2020 New Revision: 356413 URL: https://svnweb.freebsd.org/changeset/base/356413 Log: sysctl: mark more nodes as MPSAFE vm.kvm_size and vm.kvm_free are read only and marked as MPSAFE on i386 already. Mark them as that on amd64 and arm64 too to avoid locking Giant. Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23039 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jan 6 09:51:54 2020 (r356412) +++ head/sys/amd64/amd64/pmap.c Mon Jan 6 10:52:13 2020 (r356413) @@ -4072,8 +4072,9 @@ kvm_size(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &ksize, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_size, "LU", "Size of KVM"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, kvm_size, "LU", + "Size of KVM"); static int kvm_free(SYSCTL_HANDLER_ARGS) @@ -4082,8 +4083,9 @@ kvm_free(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &kfree, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_free, "LU", "Amount of KVM free"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, kvm_free, "LU", + "Amount of KVM free"); /* * Allocate physical memory for the vm_page array and map it into KVA, Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Jan 6 09:51:54 2020 (r356412) +++ head/sys/arm64/arm64/pmap.c Mon Jan 6 10:52:13 2020 (r356413) @@ -1845,8 +1845,9 @@ kvm_size(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &ksize, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_size, "LU", "Size of KVM"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, kvm_size, "LU", + "Size of KVM"); static int kvm_free(SYSCTL_HANDLER_ARGS) @@ -1855,8 +1856,9 @@ kvm_free(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &kfree, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_free, "LU", "Amount of KVM free"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, kvm_free, "LU", + "Amount of KVM free"); /* * grow the number of kernel page table entries, if needed From owner-svn-src-head@freebsd.org Mon Jan 6 12:48:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BFFD1DA381; Mon, 6 Jan 2020 12:48:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rwKM1ZDxz4fXg; Mon, 6 Jan 2020 12:48:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31134E880; Mon, 6 Jan 2020 12:48:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006Cm75x028557; Mon, 6 Jan 2020 12:48:07 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006Cm6mN028554; Mon, 6 Jan 2020 12:48:06 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202001061248.006Cm6mN028554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 6 Jan 2020 12:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356414 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 12:48:07 -0000 Author: rrs Date: Mon Jan 6 12:48:06 2020 New Revision: 356414 URL: https://svnweb.freebsd.org/changeset/base/356414 Log: This change adds a small feature to the tcp logging code. Basically a connection can now have a separate tag added to the id. Obtained from: Lawrence Stewart Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D22866 Modified: head/sys/netinet/tcp_log_buf.c head/sys/netinet/tcp_log_buf.h head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_log_buf.c ============================================================================== --- head/sys/netinet/tcp_log_buf.c Mon Jan 6 10:52:13 2020 (r356413) +++ head/sys/netinet/tcp_log_buf.c Mon Jan 6 12:48:06 2020 (r356414) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* Must come after qmath.h and tree.h */ #include #include @@ -78,6 +78,7 @@ static u_long tcp_log_auto_ratio = 0; static volatile u_long tcp_log_auto_ratio_cur = 0; static uint32_t tcp_log_auto_mode = TCP_LOG_STATE_TAIL; static bool tcp_log_auto_all = false; +static uint32_t tcp_disable_all_bb_logs = 0; RB_PROTOTYPE_STATIC(tcp_log_id_tree, tcp_log_id_bucket, tlb_rb, tcp_log_id_cmp) @@ -111,6 +112,10 @@ SYSCTL_UMA_CUR(_net_inet_tcp_bb, OID_AUTO, log_id_tcpc SYSCTL_U32(_net_inet_tcp_bb, OID_AUTO, log_version, CTLFLAG_RD, &tcp_log_version, 0, "Version of log formats exported"); +SYSCTL_U32(_net_inet_tcp_bb, OID_AUTO, disable_all, CTLFLAG_RW, + &tcp_disable_all_bb_logs, TCP_LOG_STATE_HEAD_AUTO, + "Disable all BB logging for all connections"); + SYSCTL_ULONG(_net_inet_tcp_bb, OID_AUTO, log_auto_ratio, CTLFLAG_RW, &tcp_log_auto_ratio, 0, "Do auto capturing for 1 out of N sessions"); @@ -156,7 +161,18 @@ SYSCTL_COUNTER_U64(_net_inet_tcp_bb, OID_AUTO, freed, #ifdef INVARIANTS #define TCPLOG_DEBUG_RINGBUF #endif +/* Number of requests to consider a PBCID "active". */ +#define ACTIVE_REQUEST_COUNT 10 +/* Statistic tracking for "active" PBCIDs. */ +static counter_u64_t tcp_log_pcb_ids_cur; +static counter_u64_t tcp_log_pcb_ids_tot; + +SYSCTL_COUNTER_U64(_net_inet_tcp_bb, OID_AUTO, pcb_ids_cur, CTLFLAG_RD, + &tcp_log_pcb_ids_cur, "Number of pcb IDs allocated in the system"); +SYSCTL_COUNTER_U64(_net_inet_tcp_bb, OID_AUTO, pcb_ids_tot, CTLFLAG_RD, + &tcp_log_pcb_ids_tot, "Total number of pcb IDs that have been allocated"); + struct tcp_log_mem { STAILQ_ENTRY(tcp_log_mem) tlm_queue; @@ -240,10 +256,14 @@ struct tcp_log_id_bucket * (struct tcp_log_id_bucket *) and (char *) interchangeably. */ char tlb_id[TCP_LOG_ID_LEN]; + char tlb_tag[TCP_LOG_TAG_LEN]; RB_ENTRY(tcp_log_id_bucket) tlb_rb; struct tcp_log_id_head tlb_head; struct mtx tlb_mtx; volatile u_int tlb_refcnt; + volatile u_int tlb_reqcnt; + uint32_t tlb_loglimit; + uint8_t tlb_logstate; }; struct tcp_log_id_node @@ -285,6 +305,7 @@ tcp_log_selectauto(void) * this session. */ if (tcp_log_auto_ratio && + (tcp_disable_all_bb_logs == 0) && (atomic_fetchadd_long(&tcp_log_auto_ratio_cur, 1) % tcp_log_auto_ratio) == 0) return (true); @@ -337,6 +358,7 @@ tcp_log_remove_bucket(struct tcp_log_id_bucket *tlb) #endif } TCPID_BUCKET_LOCK_DESTROY(tlb); + counter_u64_add(tcp_log_pcb_ids_cur, (int64_t)-1); uma_zfree(tcp_log_bucket_zone, tlb); } @@ -484,7 +506,53 @@ tcp_log_grow_tlb(char *tlb_id, struct tcpcb *tp) #endif } +static void +tcp_log_increment_reqcnt(struct tcp_log_id_bucket *tlb) +{ + + atomic_fetchadd_int(&tlb->tlb_reqcnt, 1); +} + /* + * Associate the specified tag with a particular TCP log ID. + * Called with INPCB locked. Returns with it unlocked. + * Returns 0 on success or EOPNOTSUPP if the connection has no TCP log ID. + */ +int +tcp_log_set_tag(struct tcpcb *tp, char *tag) +{ + struct tcp_log_id_bucket *tlb; + int tree_locked; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + tree_locked = TREE_UNLOCKED; + tlb = tp->t_lib; + if (tlb == NULL) { + INP_WUNLOCK(tp->t_inpcb); + return (EOPNOTSUPP); + } + + TCPID_BUCKET_REF(tlb); + INP_WUNLOCK(tp->t_inpcb); + TCPID_BUCKET_LOCK(tlb); + strlcpy(tlb->tlb_tag, tag, TCP_LOG_TAG_LEN); + if (!tcp_log_unref_bucket(tlb, &tree_locked, NULL)) + TCPID_BUCKET_UNLOCK(tlb); + + if (tree_locked == TREE_WLOCKED) { + TCPID_TREE_WLOCK_ASSERT(); + TCPID_TREE_WUNLOCK(); + } else if (tree_locked == TREE_RLOCKED) { + TCPID_TREE_RLOCK_ASSERT(); + TCPID_TREE_RUNLOCK(); + } else + TCPID_TREE_UNLOCK_ASSERT(); + + return (0); +} + +/* * Set the TCP log ID for a TCPCB. * Called with INPCB locked. Returns with it unlocked. */ @@ -509,6 +577,21 @@ restart: /* See if the ID is unchanged. */ if ((tp->t_lib != NULL && !strcmp(tp->t_lib->tlb_id, id)) || (tp->t_lib == NULL && *id == 0)) { + if (tp->t_lib != NULL) { + tcp_log_increment_reqcnt(tp->t_lib); + if ((tp->t_lib->tlb_logstate) && + (tp->t_log_state_set == 0)) { + /* Clone in any logging */ + + tp->t_logstate = tp->t_lib->tlb_logstate; + } + if ((tp->t_lib->tlb_loglimit) && + (tp->t_log_state_set == 0)) { + /* We also have a limit set */ + + tp->t_loglimit = tp->t_lib->tlb_loglimit; + } + } rv = 0; goto done; } @@ -677,7 +760,19 @@ refind: rv = ENOBUFS; goto done_noinp; } + counter_u64_add(tcp_log_pcb_ids_cur, 1); + counter_u64_add(tcp_log_pcb_ids_tot, 1); + if ((tcp_log_auto_all == false) && + tcp_log_auto_mode && + tcp_log_selectauto()) { + /* Save off the log state */ + tlb->tlb_logstate = tcp_log_auto_mode; + } else + tlb->tlb_logstate = TCP_LOG_STATE_OFF; + tlb->tlb_loglimit = 0; + tlb->tlb_tag[0] = '\0'; /* Default to an empty tag. */ + /* * Copy the ID to the bucket. * NB: Don't use strlcpy() unless you are sure @@ -699,6 +794,7 @@ refind: */ SLIST_INIT(&tlb->tlb_head); refcount_init(&tlb->tlb_refcnt, 1); + tlb->tlb_reqcnt = 1; memset(&tlb->tlb_mtx, 0, sizeof(struct mtx)); TCPID_BUCKET_LOCK_INIT(tlb); TCPID_BUCKET_LOCK(tlb); @@ -707,6 +803,8 @@ refind: #define FREE_NEW_TLB() do { \ TCPID_BUCKET_LOCK_DESTROY(tlb); \ uma_zfree(tcp_log_bucket_zone, tlb); \ + counter_u64_add(tcp_log_pcb_ids_cur, (int64_t)-1); \ + counter_u64_add(tcp_log_pcb_ids_tot, (int64_t)-1); \ bucket_locked = false; \ tlb = NULL; \ } while (0) @@ -762,6 +860,9 @@ refind: /* Take a reference on the bucket. */ TCPID_BUCKET_REF(tlb); + + /* Record the request. */ + tcp_log_increment_reqcnt(tlb); } tcp_log_grow_tlb(tlb->tlb_id, tp); @@ -770,6 +871,16 @@ refind: SLIST_INSERT_HEAD(&tlb->tlb_head, tln, tln_list); tp->t_lib = tlb; tp->t_lin = tln; + if (tp->t_lib->tlb_logstate) { + /* Clone in any logging */ + + tp->t_logstate = tp->t_lib->tlb_logstate; + } + if (tp->t_lib->tlb_loglimit) { + /* The loglimit too */ + + tp->t_loglimit = tp->t_lib->tlb_loglimit; + } tln = NULL; } @@ -823,6 +934,52 @@ tcp_log_get_id(struct tcpcb *tp, char *buf) } /* + * Get the tag associated with the TCPCB's log ID. + * Called with INPCB locked. Returns with it unlocked. + * 'buf' must point to a buffer that is at least TCP_LOG_TAG_LEN bytes long. + * Returns number of bytes copied. + */ +size_t +tcp_log_get_tag(struct tcpcb *tp, char *buf) +{ + struct tcp_log_id_bucket *tlb; + size_t len; + int tree_locked; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + tree_locked = TREE_UNLOCKED; + tlb = tp->t_lib; + + if (tlb != NULL) { + TCPID_BUCKET_REF(tlb); + INP_WUNLOCK(tp->t_inpcb); + TCPID_BUCKET_LOCK(tlb); + len = strlcpy(buf, tlb->tlb_tag, TCP_LOG_TAG_LEN); + KASSERT(len < TCP_LOG_TAG_LEN, + ("%s:%d: tp->t_lib->tlb_tag too long (%zu)", + __func__, __LINE__, len)); + if (!tcp_log_unref_bucket(tlb, &tree_locked, NULL)) + TCPID_BUCKET_UNLOCK(tlb); + + if (tree_locked == TREE_WLOCKED) { + TCPID_TREE_WLOCK_ASSERT(); + TCPID_TREE_WUNLOCK(); + } else if (tree_locked == TREE_RLOCKED) { + TCPID_TREE_RLOCK_ASSERT(); + TCPID_TREE_RUNLOCK(); + } else + TCPID_TREE_UNLOCK_ASSERT(); + } else { + INP_WUNLOCK(tp->t_inpcb); + *buf = '\0'; + len = 0; + } + + return (len); +} + +/* * Get number of connections with the same log ID. * Log ID is taken from given TCPCB. * Called with INPCB locked. @@ -1005,6 +1162,8 @@ tcp_log_init(void) tcp_log_que_read = counter_u64_alloc(M_WAITOK); tcp_log_que_freed = counter_u64_alloc(M_WAITOK); #endif + tcp_log_pcb_ids_cur = counter_u64_alloc(M_WAITOK); + tcp_log_pcb_ids_tot = counter_u64_alloc(M_WAITOK); rw_init_flags(&tcp_id_tree_lock, "TCP ID tree", RW_NEW); mtx_init(&tcp_log_expireq_mtx, "TCP log expireq", NULL, MTX_DEF); @@ -1023,7 +1182,10 @@ tcp_log_tcpcbinit(struct tcpcb *tp) * If we are doing auto-capturing, figure out whether we will capture * this session. */ - if (tcp_log_selectauto()) { + tp->t_loglimit = tcp_log_session_limit; + if ((tcp_log_auto_all == true) && + tcp_log_auto_mode && + tcp_log_selectauto()) { tp->t_logstate = tcp_log_auto_mode; tp->t_flags2 |= TF2_LOG_AUTO; } @@ -1162,6 +1324,8 @@ tcp_log_tcpcbfini(struct tcpcb *tp) INP_WLOCK_ASSERT(tp->t_inpcb); + TCP_LOG_EVENT(tp, NULL, NULL, NULL, TCP_LOG_CONNEND, 0, 0, NULL, false); + /* * If we were gathering packets to be automatically dumped, try to do * it now. If this succeeds, the log information in the TCPCB will be @@ -1327,6 +1491,25 @@ tcp_log_tcpcbfini(struct tcpcb *tp) tp->t_logstate = TCP_LOG_STATE_OFF; } +static void +tcp_log_purge_tp_logbuf(struct tcpcb *tp) +{ + struct tcp_log_mem *log_entry; + struct inpcb *inp; + + inp = tp->t_inpcb; + INP_WLOCK_ASSERT(inp); + if (tp->t_lognum == 0) + return; + + while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) + tcp_log_remove_log_head(tp, log_entry); + KASSERT(tp->t_lognum == 0, + ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", + __func__, tp->t_lognum)); + tp->t_logstate = TCP_LOG_STATE_OFF; +} + /* * This logs an event for a TCP socket. Normally, this is called via * TCP_LOG_EVENT or TCP_LOG_EVENT_VERBOSE. See the documentation for @@ -1350,7 +1533,17 @@ tcp_log_event_(struct tcpcb *tp, struct tcphdr *th, st __func__, func, line)); INP_WLOCK_ASSERT(tp->t_inpcb); - + if (tcp_disable_all_bb_logs) { + /* + * The global shutdown logging + * switch has been thrown. Call + * the purge function that frees + * purges out the logs and + * turns off logging. + */ + tcp_log_purge_tp_logbuf(tp); + return (NULL); + } KASSERT(tp->t_logstate == TCP_LOG_STATE_HEAD || tp->t_logstate == TCP_LOG_STATE_TAIL || tp->t_logstate == TCP_LOG_STATE_CONTINUAL || @@ -1371,7 +1564,7 @@ tcp_log_event_(struct tcpcb *tp, struct tcphdr *th, st * here. */ retry: - if (tp->t_lognum < tcp_log_session_limit) { + if (tp->t_lognum < tp->t_loglimit) { if ((log_entry = uma_zalloc(tcp_log_zone, M_NOWAIT)) != NULL) tp->t_lognum++; } else @@ -1574,7 +1767,10 @@ tcp_log_state_change(struct tcpcb *tp, int state) default: return (EINVAL); } - + if (tcp_disable_all_bb_logs) { + /* We are prohibited from doing any logs */ + tp->t_logstate = TCP_LOG_STATE_OFF; + } tp->t_flags2 &= ~(TF2_LOG_AUTO); return (0); @@ -1934,6 +2130,7 @@ tcp_log_expandlogbuf(struct tcp_log_dev_queue *param) hdr->tlh_af = entry->tldl_af; getboottime(&hdr->tlh_offset); strlcpy(hdr->tlh_id, entry->tldl_id, TCP_LOG_ID_LEN); + strlcpy(hdr->tlh_tag, entry->tldl_tag, TCP_LOG_TAG_LEN); strlcpy(hdr->tlh_reason, entry->tldl_reason, TCP_LOG_REASON_LEN); return ((struct tcp_log_common_header *)hdr); } @@ -2026,10 +2223,13 @@ tcp_log_dump_tp_logbuf(struct tcpcb *tp, char *reason, } /* Fill in the unique parts of the queue entry. */ - if (tp->t_lib != NULL) + if (tp->t_lib != NULL) { strlcpy(entry->tldl_id, tp->t_lib->tlb_id, TCP_LOG_ID_LEN); - else + strlcpy(entry->tldl_tag, tp->t_lib->tlb_tag, TCP_LOG_TAG_LEN); + } else { strlcpy(entry->tldl_id, "UNKNOWN", TCP_LOG_ID_LEN); + strlcpy(entry->tldl_tag, "UNKNOWN", TCP_LOG_TAG_LEN); + } if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else @@ -2119,6 +2319,7 @@ tcp_log_dump_node_logbuf(struct tcp_log_id_node *tln, /* Fill in the unique parts of the queue entry. */ strlcpy(entry->tldl_id, tlb->tlb_id, TCP_LOG_ID_LEN); + strlcpy(entry->tldl_tag, tlb->tlb_tag, TCP_LOG_TAG_LEN); if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else Modified: head/sys/netinet/tcp_log_buf.h ============================================================================== --- head/sys/netinet/tcp_log_buf.h Mon Jan 6 10:52:13 2020 (r356413) +++ head/sys/netinet/tcp_log_buf.h Mon Jan 6 12:48:06 2020 (r356414) @@ -31,7 +31,8 @@ #define __tcp_log_buf_h__ #define TCP_LOG_REASON_LEN 32 -#define TCP_LOG_BUF_VER (6) +#define TCP_LOG_TAG_LEN 32 +#define TCP_LOG_BUF_VER (7) /* * Because the (struct tcp_log_buffer) includes 8-byte uint64_t's, it requires @@ -263,6 +264,7 @@ struct tcp_log_header { struct timeval tlh_offset; /* Uptime -> UTC offset */ char tlh_id[TCP_LOG_ID_LEN]; char tlh_reason[TCP_LOG_REASON_LEN]; + char tlh_tag[TCP_LOG_TAG_LEN]; uint8_t tlh_af; uint8_t _pad[7]; } ALIGN_TCP_LOG; @@ -272,6 +274,7 @@ struct tcp_log_dev_log_queue { struct tcp_log_dev_queue tldl_common; char tldl_id[TCP_LOG_ID_LEN]; char tldl_reason[TCP_LOG_REASON_LEN]; + char tldl_tag[TCP_LOG_TAG_LEN]; struct in_endpoints tldl_ie; struct tcp_log_stailq tldl_entries; int tldl_count; @@ -349,10 +352,12 @@ struct tcp_log_buffer *tcp_log_event_(struct tcpcb *tp union tcp_log_stackspecific *stackinfo, int th_hostorder, const char *output_caller, const char *func, int line, const struct timeval *tv); size_t tcp_log_get_id(struct tcpcb *tp, char *buf); +size_t tcp_log_get_tag(struct tcpcb *tp, char *buf); u_int tcp_log_get_id_cnt(struct tcpcb *tp); int tcp_log_getlogbuf(struct sockopt *sopt, struct tcpcb *tp); void tcp_log_init(void); int tcp_log_set_id(struct tcpcb *tp, char *id); +int tcp_log_set_tag(struct tcpcb *tp, char *tag); int tcp_log_state_change(struct tcpcb *tp, int state); void tcp_log_tcpcbinit(struct tcpcb *tp); void tcp_log_tcpcbfini(struct tcpcb *tp); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Jan 6 10:52:13 2020 (r356413) +++ head/sys/netinet/tcp_var.h Mon Jan 6 12:48:06 2020 (r356414) @@ -103,7 +103,8 @@ struct tcpcb { t_idle_reduce : 1, t_delayed_ack: 7, /* Delayed ack variable */ t_fin_is_rst: 1, /* Are fin's treated as resets */ - bits_spare : 3; + t_log_state_set: 1, + bits_spare : 2; u_int t_flags; tcp_seq snd_una; /* sent but unacknowledged */ tcp_seq snd_max; /* highest sequence number sent; @@ -206,6 +207,7 @@ struct tcpcb { u_int t_keepcnt; /* number of keepalives before close */ int t_dupacks; /* consecutive dup acks recd */ int t_lognum; /* Number of log entries */ + int t_loglimit; /* Maximum number of log entries */ struct tcp_log_stailq t_logs; /* Log buffer */ struct tcp_log_id_node *t_lin; struct tcp_log_id_bucket *t_lib; From owner-svn-src-head@freebsd.org Mon Jan 6 13:21:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 115761DDEFB; Mon, 6 Jan 2020 13:21:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rx3W6lmDz3D8S; Mon, 6 Jan 2020 13:21:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA4F8EFAA; Mon, 6 Jan 2020 13:21:11 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006DLBbw055286; Mon, 6 Jan 2020 13:21:11 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006DLBFY055284; Mon, 6 Jan 2020 13:21:11 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202001061321.006DLBFY055284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 6 Jan 2020 13:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356416 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 356416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 13:21:12 -0000 Author: mm Date: Mon Jan 6 13:21:10 2020 New Revision: 356416 URL: https://svnweb.freebsd.org/changeset/base/356416 Log: MFV r356415 Sync libarchive with vendor Relevant vendor changes: Issue #1302: Re-do fix for archive_write_client_open() X-MFC-With: r356212,r356365 MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_cryptor.c head/contrib/libarchive/libarchive/archive_hmac.c head/contrib/libarchive/libarchive/archive_write.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_cryptor.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_cryptor.c Mon Jan 6 13:13:58 2020 (r356415) +++ head/contrib/libarchive/libarchive/archive_cryptor.c Mon Jan 6 13:21:10 2020 (r356416) @@ -299,6 +299,7 @@ aes_ctr_release(archive_crypto_ctx *ctx) } #elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H) + static int aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) { Modified: head/contrib/libarchive/libarchive/archive_hmac.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_hmac.c Mon Jan 6 13:13:58 2020 (r356415) +++ head/contrib/libarchive/libarchive/archive_hmac.c Mon Jan 6 13:21:10 2020 (r356416) @@ -151,6 +151,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) } #elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_MD_H) + static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { Modified: head/contrib/libarchive/libarchive/archive_write.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write.c Mon Jan 6 13:13:58 2020 (r356415) +++ head/contrib/libarchive/libarchive/archive_write.c Mon Jan 6 13:21:10 2020 (r356416) @@ -339,6 +339,7 @@ archive_write_client_open(struct archive_write_filter struct archive_none *state; void *buffer; size_t buffer_size; + int ret; f->bytes_per_block = archive_write_get_bytes_per_block(f->archive); f->bytes_in_last_block = @@ -363,7 +364,13 @@ archive_write_client_open(struct archive_write_filter if (a->client_opener == NULL) return (ARCHIVE_OK); - return (a->client_opener(f->archive, a->client_data)); + ret = a->client_opener(f->archive, a->client_data); + if (ret != ARCHIVE_OK) { + free(state->buffer); + free(state); + f->data = NULL; + } + return (ret); } static int @@ -449,30 +456,6 @@ archive_write_client_write(struct archive_write_filter } static int -archive_write_client_free(struct archive_write_filter *f) -{ - struct archive_write *a = (struct archive_write *)f->archive; - struct archive_none *state = (struct archive_none *)f->data; - - if (state != NULL) { - free(state->buffer); - free(state); - state = NULL; - } - - a->client_data = NULL; - /* Clear passphrase. */ - if (a->passphrase != NULL) { - memset(a->passphrase, 0, strlen(a->passphrase)); - free(a->passphrase); - a->passphrase = NULL; - } - - return (ARCHIVE_OK); -} - - -static int archive_write_client_close(struct archive_write_filter *f) { struct archive_write *a = (struct archive_write *)f->archive; @@ -508,7 +491,15 @@ archive_write_client_close(struct archive_write_filter } if (a->client_closer) (*a->client_closer)(&a->archive, a->client_data); - + free(state->buffer); + free(state); + a->client_data = NULL; + /* Clear passphrase. */ + if (a->passphrase != NULL) { + memset(a->passphrase, 0, strlen(a->passphrase)); + free(a->passphrase); + a->passphrase = NULL; + } /* Clear the close handler myself not to be called again. */ f->state = ARCHIVE_WRITE_FILTER_STATE_CLOSED; return (ret); @@ -539,7 +530,6 @@ archive_write_open(struct archive *_a, void *client_da client_filter->open = archive_write_client_open; client_filter->write = archive_write_client_write; client_filter->close = archive_write_client_close; - client_filter->free = archive_write_client_free; ret = __archive_write_filters_open(a); if (ret < ARCHIVE_WARN) { From owner-svn-src-head@freebsd.org Mon Jan 6 14:35:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C16B91E5FDC; Mon, 6 Jan 2020 14:35:20 +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 47ryj35kmZz3JR9; Mon, 6 Jan 2020 14:35:19 +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 5F7E5260189; Mon, 6 Jan 2020 15:35:17 +0100 (CET) Subject: Re: svn commit: r356097 - in head: share/man/man9 sys/compat/ndis sys/dev/oce sys/kern sys/libkern sys/sys To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912261941.xBQJf9mL053706@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 6 Jan 2020 15:34:07 +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: <201912261941.xBQJf9mL053706@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47ryj35kmZz3JR9 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.33), ipnet: 88.99.0.0/16(-4.72), asn: 24940(-1.51), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 14:35:20 -0000 On 2019-12-26 20:41, Conrad Meyer wrote: > Author: cem > Date: Thu Dec 26 19:41:09 2019 > New Revision: 356097 > URL: https://svnweb.freebsd.org/changeset/base/356097 > > Log: > random(9): Deprecate random(9), remove meaningless srandom(9) > > srandom(9) is meaningless on SMP systems or any system with, say, > interrupts. One could never rely on random(9) to produce a reproducible > sequence of outputs on the basis of a specific srandom() seed because the > global state was shared by all kernel contexts. As such, removing it is > literally indistinguishable to random(9) consumers (as compared with > retaining it). > > Mark random(9) as deprecated and slated for quick removal. This is not to > say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. > It/they just won't be random(9), as it exists today, in either name or > implementation. > > Before random(9) is removed, a replacement will be provided and in-tree > consumers will be converted. > > Note that despite the name, the random(9) interface does not bear any > resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller > LCG used in libc rand(3). > Hi, Having some kind of replacment for this using atomics(), might be useful for system testing. Sometimes you need a white-noise function for initializing test parameters and you also need srandom to reproducue failing tests. --HPS From owner-svn-src-head@freebsd.org Mon Jan 6 15:29:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C581EBEFC; Mon, 6 Jan 2020 15:29:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rzvH5Rh5z3MtG; Mon, 6 Jan 2020 15:29:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B632C1862A; Mon, 6 Jan 2020 15:29:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006FTFU3040873; Mon, 6 Jan 2020 15:29:15 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006FTFwN040870; Mon, 6 Jan 2020 15:29:15 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202001061529.006FTFwN040870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 6 Jan 2020 15:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356417 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 356417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 15:29:15 -0000 Author: rrs Date: Mon Jan 6 15:29:14 2020 New Revision: 356417 URL: https://svnweb.freebsd.org/changeset/base/356417 Log: This catches rack up in the recent changes to ECN and also commonizes the functions that both the freebsd and rack stack uses. Sponsored by:Netflix Inc Differential Revision: https://reviews.freebsd.org/D23052 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Jan 6 13:21:10 2020 (r356416) +++ head/sys/netinet/tcp_input.c Mon Jan 6 15:29:14 2020 (r356417) @@ -514,7 +514,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) (tlen <= tp->t_maxseg) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) -static void inline +void inline cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) { INP_WLOCK_ASSERT(tp->t_inpcb); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Jan 6 13:21:10 2020 (r356416) +++ head/sys/netinet/tcp_stacks/rack.c Mon Jan 6 15:29:14 2020 (r356417) @@ -7715,6 +7715,10 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr TCPSTAT_INC(tcps_ecn_ect1); break; } + + /* Process a packet differently from RFC3168. */ + cc_ecnpkt_handler(tp, th, iptos); + /* Congestion experienced. */ if (thflags & TH_ECE) { rack_cong_signal(tp, th, CC_ECN); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Jan 6 13:21:10 2020 (r356416) +++ head/sys/netinet/tcp_var.h Mon Jan 6 15:29:14 2020 (r356417) @@ -891,6 +891,7 @@ void cc_ack_received(struct tcpcb *tp, struct tcphdr * uint16_t nsegs, uint16_t type); void cc_conn_init(struct tcpcb *tp); void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); +void cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); #ifdef TCP_HHOOK void hhook_run_tcp_est_in(struct tcpcb *tp, From owner-svn-src-head@freebsd.org Mon Jan 6 17:34:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5E3C1F77FD; Mon, 6 Jan 2020 17:34:18 +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 47s2gZ2lV8z40D3; Mon, 6 Jan 2020 17:34:18 +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 59AA719E51; Mon, 6 Jan 2020 17:34:18 +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 006HYIg0031423; Mon, 6 Jan 2020 17:34:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006HYIvd031422; Mon, 6 Jan 2020 17:34:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001061734.006HYIvd031422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Jan 2020 17:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356418 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 17:34:18 -0000 Author: jhb Date: Mon Jan 6 17:34:17 2020 New Revision: 356418 URL: https://svnweb.freebsd.org/changeset/base/356418 Log: Only build kernels for enabled TARGET_ARCHes in make universe/tinderbox. Previously, all of the kernels for a given TARGET were built if that target was enabled. This was implemented by having each kernel built via a universe_kernconf_ target that was depended on by a universe_kernconfs target. However, this meant that if one did a build with a limited set of TARGET_ARCH values for a given TARGET, kernels could be built for which we hadn't built a world or toolchain. For example, 'make TARGETS=mips TARGET_ARCHES_mips=mips64' would build mips32 kernels. Fix this by adding an extra layer of indirection in the kernel make targets. universe_kernconf_ is now a dependency of a new universe_kernconfs_. universe_kernconfs in turn depends on a list of universe_kernconfs_ values, but only the values enabled in TARGET_ARCHES_. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D23031 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Jan 6 15:29:14 2020 (r356417) +++ head/Makefile Mon Jan 6 17:34:17 2020 (r356418) @@ -724,7 +724,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/con .if empty(TARGET_ARCH_${kernel}) .error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." .endif -universe_kernconfs: universe_kernconf_${TARGET}_${kernel} +universe_kernconfs_${TARGET_ARCH_${kernel}}: universe_kernconf_${TARGET}_${kernel} universe_kernconf_${TARGET}_${kernel}: .MAKE @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ @@ -737,6 +737,9 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE (echo "${TARGET} ${kernel} kernel failed," \ "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel completed on `LC_ALL=C date`" +.endfor +.for target_arch in ${TARGET_ARCHES_${TARGET}} +universe_kernconfs: universe_kernconfs_${target_arch} .PHONY .endfor .endif # make(universe_kernels) universe: universe_epilogue From owner-svn-src-head@freebsd.org Mon Jan 6 17:36:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91D141F7A6C; Mon, 6 Jan 2020 17:36:29 +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 47s2k53JpWz40MN; Mon, 6 Jan 2020 17:36:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680ED19E57; Mon, 6 Jan 2020 17:36:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006HaTTu031830; Mon, 6 Jan 2020 17:36:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006HaTJe031829; Mon, 6 Jan 2020 17:36:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001061736.006HaTJe031829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Jan 2020 17:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356419 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 17:36:29 -0000 Author: jhb Date: Mon Jan 6 17:36:28 2020 New Revision: 356419 URL: https://svnweb.freebsd.org/changeset/base/356419 Log: Enable powerpc in make tinderbox using clang instead of GCC. powerpcspe is disabled for now until clang/llvm issues with spe have been fixed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23031 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Jan 6 17:34:17 2020 (r356418) +++ head/Makefile Mon Jan 6 17:36:28 2020 (r356419) @@ -491,15 +491,13 @@ worlds: .PHONY # honor that most of all. # _OBSOLETE_GCC_TARGETS=mips sparc64 -.if defined(MAKE_OBSOLETE_GCC) -_OBSOLETE_GCC_TARGETS+=powerpc -.endif -TARGETS?=amd64 arm arm64 i386 riscv ${_OBSOLETE_GCC_TARGETS} +TARGETS?=amd64 arm arm64 i386 powerpc riscv ${_OBSOLETE_GCC_TARGETS} _UNIVERSE_TARGETS= ${TARGETS} TARGET_ARCHES_arm?= armv6 armv7 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf -TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe +# powerpcspe excluded until clang fixed +TARGET_ARCHES_powerpc?= powerpc powerpc64 # riscv64sf excluded due to PR 232085 TARGET_ARCHES_riscv?= riscv64 .for target in ${TARGETS} @@ -510,12 +508,10 @@ MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc .if !defined(MAKE_OBSOLETE_GCC) OBSOLETE_GCC_TARGETS=${_OBSOLETE_GCC_TARGETS} MAKE_PARAMS_mips?= CROSS_TOOLCHAIN=mips-gcc6 -MAKE_PARAMS_powerpc?= CROSS_TOOLCHAIN=powerpc64-gcc6 MAKE_PARAMS_sparc64?= CROSS_TOOLCHAIN=sparc64-gcc6 .endif TOOLCHAINS_mips= mips-gcc6 -TOOLCHAINS_powerpc= powerpc64-gcc6 TOOLCHAINS_riscv= riscv64-gcc TOOLCHAINS_sparc64= sparc64-gcc6 From owner-svn-src-head@freebsd.org Mon Jan 6 18:02:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEB291DA776; Mon, 6 Jan 2020 18:02:02 +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 47s3HZ4jSHz41n5; Mon, 6 Jan 2020 18:02:02 +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 9CE171A3CA; Mon, 6 Jan 2020 18:02:02 +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 006I227u050704; Mon, 6 Jan 2020 18:02:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006I22gn050703; Mon, 6 Jan 2020 18:02:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001061802.006I22gn050703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Jan 2020 18:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356420 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 356420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 18:02:02 -0000 Author: jhb Date: Mon Jan 6 18:02:02 2020 New Revision: 356420 URL: https://svnweb.freebsd.org/changeset/base/356420 Log: Simplify arguments to signal handlers on mips. - Use ksi_addr directly as si_addr in the siginfo instead of the 'badvaddr' register. - Remove a duplicate assignment of si_code. - Use ksi_addr as the 4th argument to the old-style handler instead of 'badvaddr'. Reviewed by: brooks, kevans Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23013 Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Mon Jan 6 17:36:28 2020 (r356419) +++ head/sys/mips/mips/pm_machdep.c Mon Jan 6 18:02:02 2020 (r356420) @@ -147,12 +147,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask /* fill siginfo structure */ sf.sf_si = ksi->ksi_info; sf.sf_si.si_signo = sig; - sf.sf_si.si_code = ksi->ksi_code; - sf.sf_si.si_addr = (void*)(intptr_t)regs->badvaddr; } else { /* Old FreeBSD-style arguments. */ regs->a1 = ksi->ksi_code; - regs->a3 = regs->badvaddr; + regs->a3 = (uintptr_t)ksi->ksi_addr; /* sf.sf_ahu.sf_handler = catcher; */ } From owner-svn-src-head@freebsd.org Mon Jan 6 18:07:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98BBF1DAFB8; Mon, 6 Jan 2020 18:07:54 +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 47s3QL414dz422b; Mon, 6 Jan 2020 18:07:54 +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 804E51A3FA; Mon, 6 Jan 2020 18:07:54 +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 006I7sB0052609; Mon, 6 Jan 2020 18:07:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006I7sXP052608; Mon, 6 Jan 2020 18:07:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001061807.006I7sXP052608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 6 Jan 2020 18:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356421 - 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: 356421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 18:07:54 -0000 Author: emaste Date: Mon Jan 6 18:07:54 2020 New Revision: 356421 URL: https://svnweb.freebsd.org/changeset/base/356421 Log: src.conf.5: regen after r356419, reenabling powerpc in universe Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jan 6 18:02:02 2020 (r356420) +++ head/share/man/man5/src.conf.5 Mon Jan 6 18:07:54 2020 (r356421) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 5, 2020 +.Dd January 6, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -197,7 +197,7 @@ as part of the normal system build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP Set to not build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -213,7 +213,7 @@ Set build binutils (as, ld, and objdump) as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 @@ -268,7 +268,7 @@ and .Pa crtend.o . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP @@ -380,7 +380,7 @@ When set, it enforces these options: Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITHOUT_CLANG_BOOTSTRAP Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -393,7 +393,7 @@ riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint and clang-format. @@ -408,7 +408,7 @@ Set to build the ARCMigrate, Rewriter and StaticAnalyz Clang C/C++ compiler. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITHOUT_CLANG_IS_CC Set to install the GCC compiler as .Pa /usr/bin/cc , @@ -426,7 +426,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CPP Set to not build .Xr cpp 1 . @@ -495,13 +495,13 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_CXX Set to not build .Xr c++ 1 @@ -658,7 +658,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -749,7 +749,7 @@ Set to build .Xr gdb 1 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITHOUT_GDB_LIBEXEC Set to install .Xr gdb 1 @@ -770,7 +770,7 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). This option is deprecated and will be removed before @@ -802,7 +802,7 @@ Set to build and install and dependent tests. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 @@ -826,7 +826,7 @@ Set to build and install simple_httpd Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -980,7 +980,7 @@ On 64-bit platforms, set to not build 32-bit library s runtime linker. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. .It Va WITHOUT_LIBCPLUSPLUS Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD @@ -1011,12 +1011,12 @@ sparc64/sparc64. Set to build LLVM's lld linker. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITHOUT_LLDB Set to not build the LLDB debugger. .Pp This is a default setting on -arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1029,23 +1029,23 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build, and use it during buildworld and buildkernel. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_LLVM_COV Set to not build the .Xr llvm-cov 1 @@ -1059,7 +1059,7 @@ Set to build the tool. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1069,7 +1069,7 @@ arm/armv6, arm/armv7 and sparc64/sparc64. Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1156,7 +1156,7 @@ endian mode. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LOADER_GELI Set to build GELI bootloader support. .Pp @@ -1166,7 +1166,7 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to not build LUA bindings for the boot loader. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp @@ -1181,7 +1181,7 @@ amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386 Set to build openfirmware bootloader components. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_LOADER_UBOOT Disable building of ubldr. .Pp @@ -1191,7 +1191,7 @@ amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 a Set to build ubldr. .Pp This is a default setting on -arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_LOADER_VERBOSE Set to build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. @@ -1351,13 +1351,13 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_NDIS Set to not build programs and libraries related to NDIS emulation support. @@ -1422,13 +1422,13 @@ and related programs. Set to not build nvme related tools and kernel modules. .Pp This is a default setting on -arm/armv6, arm/armv7, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_NVME Set to build nvme related tools and kernel modules. .Pp This is a default setting on -amd64/amd64, arm64/aarch64 and i386/i386. +amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITH_OFED Set to build the .Dq "OpenFabrics Enterprise Distribution" @@ -1443,12 +1443,12 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp This is a default setting on -amd64/amd64 and i386/i386. +amd64/amd64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1538,7 +1538,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1628,7 +1628,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-head@freebsd.org Mon Jan 6 18:15:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CF7F1DC37D; Mon, 6 Jan 2020 18:15: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 47s3bc1Wd5z42j8; Mon, 6 Jan 2020 18:15: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 27FD01A5C8; Mon, 6 Jan 2020 18:15: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 006IFtLP059160; Mon, 6 Jan 2020 18:15:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006IFt3W059156; Mon, 6 Jan 2020 18:15:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001061815.006IFt3W059156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Jan 2020 18:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356422 - in head: lib/libc lib/libsysdecode targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc lib/libsysdecode targets/pseudo/userland/gnu X-SVN-Commit-Revision: 356422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 18:15:56 -0000 Author: kevans Date: Mon Jan 6 18:15:55 2020 New Revision: 356422 URL: https://svnweb.freebsd.org/changeset/base/356422 Log: Update libssp paths in various Makefile.depend* files I've been advised that the model that uses these are fairly resilient, but we do know the proper path to use (or remove, in the case of ^/targets/...), so go ahead and update them to reflect that. Modified: head/lib/libc/Makefile.depend.options head/lib/libsysdecode/Makefile.depend head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/lib/libc/Makefile.depend.options ============================================================================== --- head/lib/libc/Makefile.depend.options Mon Jan 6 18:07:54 2020 (r356421) +++ head/lib/libc/Makefile.depend.options Mon Jan 6 18:15:55 2020 (r356422) @@ -3,6 +3,6 @@ DIRDEPS_OPTIONS= SSP -DIRDEPS.SSP.yes= gnu/lib/libssp/libssp_nonshared +DIRDEPS.SSP.yes= lib/libssp_nonshared .include Modified: head/lib/libsysdecode/Makefile.depend ============================================================================== --- head/lib/libsysdecode/Makefile.depend Mon Jan 6 18:07:54 2020 (r356421) +++ head/lib/libsysdecode/Makefile.depend Mon Jan 6 18:15:55 2020 (r356422) @@ -7,7 +7,6 @@ DIRDEPS = \ gnu/lib/libdialog \ gnu/lib/libgomp \ gnu/lib/libregex \ - gnu/lib/libssp \ gnu/lib/libstdc++ \ gnu/lib/libsupc++ \ include \ @@ -100,6 +99,7 @@ DIRDEPS = \ lib/libsdp \ lib/libsecureboot \ lib/libsqlite3 \ + lib/libssp \ lib/libstand \ lib/libstdthreads \ lib/libtacplus \ Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Mon Jan 6 18:07:54 2020 (r356421) +++ head/targets/pseudo/userland/gnu/Makefile.depend Mon Jan 6 18:15:55 2020 (r356422) @@ -12,8 +12,6 @@ DIRDEPS = \ gnu/lib/libgcov \ gnu/lib/libgomp \ gnu/lib/libregex/doc \ - gnu/lib/libssp \ - gnu/lib/libssp/libssp_nonshared \ gnu/lib/libstdc++ \ gnu/lib/libsupc++ \ gnu/usr.bin/binutils/ar \ From owner-svn-src-head@freebsd.org Mon Jan 6 18:25:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 445AF1DD58E; Mon, 6 Jan 2020 18:25:59 +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 47s3qC18FKz43FZ; Mon, 6 Jan 2020 18:25:59 +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 227D31A78D; Mon, 6 Jan 2020 18:25:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006IPxrA066285; Mon, 6 Jan 2020 18:25:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006IPwrP066283; Mon, 6 Jan 2020 18:25:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001061825.006IPwrP066283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Jan 2020 18:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356423 - in head: share/mk tests/sys/fs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/mk tests/sys/fs X-SVN-Commit-Revision: 356423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 18:25:59 -0000 Author: kevans Date: Mon Jan 6 18:25:58 2020 New Revision: 356423 URL: https://svnweb.freebsd.org/changeset/base/356423 Log: Refine fusefs test workaround for mips+llvm This re-enables building the googletest suite by default on mips and instead specifically doesn't build fusefs tests for mips+clang builds. clang will easily spent >= 1.5 hours compiling a single file due to a bug in optimization (see LLVM PR 43263), so turn these off for now while that's hashed out. GCC builds are unaffected and build the fusefs tests as-is. Clang builds only happen by early adopters attempting to hash out the remaining issues. The comment has been updated to reflect its new position and use less strong wording about imposing on people. Discussed with: ngie, asomers Reviewed by: ngie Modified: head/share/mk/src.opts.mk head/tests/sys/fs/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Jan 6 18:15:55 2020 (r356422) +++ head/share/mk/src.opts.mk Mon Jan 6 18:25:58 2020 (r356423) @@ -108,6 +108,7 @@ __DEFAULT_YES_OPTIONS = \ GDB \ GNU_DIFF \ GNU_GREP \ + GOOGLETEST \ GPIO \ HAST \ HTML \ @@ -263,15 +264,6 @@ __T=${MACHINE_ARCH} __TT=${TARGET} .else __TT=${MACHINE} -.endif - -# Default GOOGLETEST to off for MIPS while LLVM PR 43263 is active. Part -# of the fusefs tests trigger excessively long compile times. It does -# eventually succeed, but this shouldn't be forced on those building by default. -.if ${__TT} == "mips" -__DEFAULT_NO_OPTIONS+= GOOGLETEST -.else -__DEFAULT_YES_OPTIONS+= GOOGLETEST .endif # All supported backends for LLVM_TARGET_XXX Modified: head/tests/sys/fs/Makefile ============================================================================== --- head/tests/sys/fs/Makefile Mon Jan 6 18:15:55 2020 (r356422) +++ head/tests/sys/fs/Makefile Mon Jan 6 18:25:58 2020 (r356423) @@ -12,7 +12,12 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs #TESTS_SUBDIRS+= nullfs # XXX: needs rump # fusefs tests cannot be compiled/used without the googletest infrastructure. .if ${COMPILER_FEATURES:Mc++14} && ${MK_GOOGLETEST} != "no" +# Don't build fusefs tests for MIPS while LLVM PR 43263 is active, as part +# of the fusefs tests trigger excessively long compile time. The build does +# eventually succeed, but it's perhaps better to not do so by default for now. +.if ${MACHINE_CPUARCH} != "mips" || ${COMPILER_TYPE} != "clang" TESTS_SUBDIRS+= fusefs +.endif .endif TESTS_SUBDIRS+= tmpfs From owner-svn-src-head@freebsd.org Mon Jan 6 19:35:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C47F81E50D3; Mon, 6 Jan 2020 19:35:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47s5MH3K0Hz46lS; Mon, 6 Jan 2020 19:35:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68CBB1B46C; Mon, 6 Jan 2020 19:35:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006JZNwR009288; Mon, 6 Jan 2020 19:35:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006JZNQG009287; Mon, 6 Jan 2020 19:35:23 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202001061935.006JZNQG009287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 6 Jan 2020 19:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356424 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 356424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 19:35:23 -0000 Author: tsoome Date: Mon Jan 6 19:35:22 2020 New Revision: 356424 URL: https://svnweb.freebsd.org/changeset/base/356424 Log: loader: update zfsimpl.c from illumos review suggestions Add extra comments and update error handling. MFH: 1 week Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Mon Jan 6 18:25:58 2020 (r356423) +++ head/stand/libsa/zfs/zfsimpl.c Mon Jan 6 19:35:22 2020 (r356424) @@ -1097,7 +1097,8 @@ vdev_create(uint64_t guid, vdev_read_t *_read) vdev->v_read = _read; /* - * root vdev has no read function. + * root vdev has no read function, we use this fact to + * skip setting up data we do not need for root vdev. * We only point root vdev from spa. */ if (_read != NULL) { @@ -1142,7 +1143,7 @@ vdev_set_initial_state(vdev_t *vdev, const unsigned ch else if (isnt_present != 0) vdev->v_state = VDEV_STATE_CANT_OPEN; - vdev->v_islog = is_log == 1; + vdev->v_islog = is_log != 0; } static int @@ -1234,9 +1235,8 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, if (strcmp(type, "raidz") == 0) { if (vdev->v_nparity < 1 || vdev->v_nparity > 3) { - printf("ZFS: can only boot from disk, " - "mirror, raidz1, raidz2 and raidz3 " - "vdevs\n"); + printf("ZFS: invalid raidz parity: %d\n", + vdev->v_nparity); return (EIO); } (void) asprintf(&name, "%s%d-%" PRIu64, type, @@ -1310,16 +1310,17 @@ vdev_insert(vdev_t *top_vdev, vdev_t *vdev) if (previous == NULL) { STAILQ_INSERT_HEAD(&top_vdev->v_children, vdev, v_childlink); - count = vdev_child_count(top_vdev); - if (top_vdev->v_nchildren < count) - top_vdev->v_nchildren = count; + } else if (previous->v_id == vdev->v_id) { + /* + * This vdev was configured from label config, + * do not insert duplicate. + */ return; + } else { + STAILQ_INSERT_AFTER(&top_vdev->v_children, previous, vdev, + v_childlink); } - if (previous->v_id == vdev->v_id) - return; - - STAILQ_INSERT_AFTER(&top_vdev->v_children, previous, vdev, v_childlink); count = vdev_child_count(top_vdev); if (top_vdev->v_nchildren < count) top_vdev->v_nchildren = count; @@ -1365,6 +1366,10 @@ vdev_from_nvlist(spa_t *spa, uint64_t top_guid, const kids = nvlist_next(kids); } } else { + /* + * When there are no children, nvlist_find() does return + * error, reset it because leaf devices have no children. + */ rc = 0; } @@ -1491,7 +1496,7 @@ vdev_init_from_nvlist(spa_t *spa, const unsigned char /* Wrong guid?! */ if (spa->spa_guid != pool_guid) - return (EIO); + return (EINVAL); spa->spa_root_vdev->v_nchildren = vdev_children; @@ -1502,7 +1507,7 @@ vdev_init_from_nvlist(spa_t *spa, const unsigned char * MOS config has at least one child for root vdev. */ if (rc != 0) - return (EIO); + return (rc); for (int i = 0; i < nkids; i++) { uint64_t guid; @@ -3266,7 +3271,10 @@ zfs_spa_init(spa_t *spa) if (rc != 0) return (rc); - /* Update vdevs from MOS config. */ + /* + * Update vdevs from MOS config. Note, we do skip encoding bytes + * here. See also vdev_label_read_config(). + */ rc = vdev_init_from_nvlist(spa, nvlist + 4); free(nvlist); return (rc); From owner-svn-src-head@freebsd.org Mon Jan 6 19:47:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E94EB1E6A52; Mon, 6 Jan 2020 19:47:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47s5dq5wByz47Pl; Mon, 6 Jan 2020 19:47:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1E8C1B63F; Mon, 6 Jan 2020 19:47:59 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 006Jlx0j015635; Mon, 6 Jan 2020 19:47:59 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006Jlxq4015634; Mon, 6 Jan 2020 19:47:59 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202001061947.006Jlxq4015634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Mon, 6 Jan 2020 19:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356425 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 19:48:00 -0000 Author: kaktus Date: Mon Jan 6 19:47:59 2020 New Revision: 356425 URL: https://svnweb.freebsd.org/changeset/base/356425 Log: kern_sysctl: make sysctl.debug work as intended r136999 introduced SYSTCL_DEBUG but apparently "opt_sysctl.h" was never included making the option ignored. r322954 introduced sysctl.reuse_test with OID number equal to 0, effectively shadowing the very special sysctl.debug one. Use OID_AUTO as it doesn't need any special treatment. Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23056 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Jan 6 19:35:22 2020 (r356424) +++ head/sys/kern/kern_sysctl.c Mon Jan 6 19:47:59 2020 (r356425) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include "opt_ddb.h" #include "opt_ktrace.h" +#include "opt_sysctl.h" #include #include @@ -404,8 +405,9 @@ sysctl_reuse_test(SYSCTL_HANDLER_ARGS) SYSCTL_RUNLOCK(&tracker); return (0); } -SYSCTL_PROC(_sysctl, 0, reuse_test, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, - 0, 0, sysctl_reuse_test, "-", ""); +SYSCTL_PROC(_sysctl, OID_AUTO, reuse_test, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, sysctl_reuse_test, "-", + ""); #endif void From owner-svn-src-head@freebsd.org Mon Jan 6 20:58:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 185B41EDE03; Mon, 6 Jan 2020 20:58:00 +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 47s7Bb6zRHz4CRB; Mon, 6 Jan 2020 20:57:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAC1C1C305; Mon, 6 Jan 2020 20:57:59 +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 006KvxWi058190; Mon, 6 Jan 2020 20:57:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 006KvxZC058188; Mon, 6 Jan 2020 20:57:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001062057.006KvxZC058188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 6 Jan 2020 20:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356426 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 356426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 20:58:00 -0000 Author: andrew Date: Mon Jan 6 20:57:59 2020 New Revision: 356426 URL: https://svnweb.freebsd.org/changeset/base/356426 Log: Add more Arm arm64 CPU identification values - Add all the Cortex-A CPU ID register values I can find. - Add the Neoverse-N1 ID regiser value [1] - Sort macros by register value. PR: 243065 Submitted by: Ali Saidi [1] Sponsored by: DARPA, AFRL (other than [1]) Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpu.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Jan 6 19:47:59 2020 (r356425) +++ head/sys/arm64/arm64/identcpu.c Mon Jan 6 20:57:59 2020 (r356426) @@ -156,9 +156,14 @@ static const struct cpu_parts cpu_parts_arm[] = { { CPU_PART_CORTEX_A53, "Cortex-A53" }, { CPU_PART_CORTEX_A55, "Cortex-A55" }, { CPU_PART_CORTEX_A57, "Cortex-A57" }, + { CPU_PART_CORTEX_A65, "Cortex-A65" }, { CPU_PART_CORTEX_A72, "Cortex-A72" }, { CPU_PART_CORTEX_A73, "Cortex-A73" }, { CPU_PART_CORTEX_A75, "Cortex-A75" }, + { CPU_PART_CORTEX_A76, "Cortex-A76" }, + { CPU_PART_CORTEX_A76AE, "Cortex-A76AE" }, + { CPU_PART_CORTEX_A77, "Cortex-A77" }, + { CPU_PART_NEOVERSE_N1, "Neoverse-N1" }, CPU_PART_NONE, }; /* Cavium */ Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Mon Jan 6 19:47:59 2020 (r356425) +++ head/sys/arm64/include/cpu.h Mon Jan 6 20:57:59 2020 (r356426) @@ -81,13 +81,18 @@ /* ARM Part numbers */ #define CPU_PART_FOUNDATION 0xD00 -#define CPU_PART_CORTEX_A35 0xD04 #define CPU_PART_CORTEX_A53 0xD03 +#define CPU_PART_CORTEX_A35 0xD04 #define CPU_PART_CORTEX_A55 0xD05 +#define CPU_PART_CORTEX_A65 0xD06 #define CPU_PART_CORTEX_A57 0xD07 #define CPU_PART_CORTEX_A72 0xD08 #define CPU_PART_CORTEX_A73 0xD09 #define CPU_PART_CORTEX_A75 0xD0A +#define CPU_PART_CORTEX_A76 0xD0B +#define CPU_PART_NEOVERSE_N1 0xD0C +#define CPU_PART_CORTEX_A77 0xD0D +#define CPU_PART_CORTEX_A76AE 0xD0E /* Cavium Part numbers */ #define CPU_PART_THUNDERX 0x0A1 From owner-svn-src-head@freebsd.org Mon Jan 6 22:08:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91E5D1F5135; Mon, 6 Jan 2020 22:08:11 +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 47s8lb2XZ8z4JF9; Mon, 6 Jan 2020 22:08:10 +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 006M82QG034310 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 14:08:03 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 006M8219034309; Mon, 6 Jan 2020 14:08:02 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 6 Jan 2020 14:08:02 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356389 - head/sys/vm Message-ID: <20200106220802.GI3339@FreeBSD.org> References: <202001052254.005MsQsH027909@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001052254.005MsQsH027909@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47s8lb2XZ8z4JF9 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 22:08:11 -0000 Jeff, On Sun, Jan 05, 2020 at 10:54:26PM +0000, Jeff Roberson wrote: J> Author: jeff J> Date: Sun Jan 5 22:54:25 2020 J> New Revision: 356389 J> URL: https://svnweb.freebsd.org/changeset/base/356389 J> J> Log: J> The fix in r356353 was insufficient. Not every architecture returns 0 for J> EARLY_COUNTER. Only amd64 seems to. J> J> Suggested by: markj J> Reported by: lwhsu J> Reviewed by: markj J> PR: 243117 J> J> Modified: J> head/sys/vm/uma_core.c J> J> Modified: head/sys/vm/uma_core.c J> ============================================================================== J> --- head/sys/vm/uma_core.c Sun Jan 5 21:35:02 2020 (r356388) J> +++ head/sys/vm/uma_core.c Sun Jan 5 22:54:25 2020 (r356389) J> @@ -4153,8 +4153,10 @@ uma_zone_get_cur(uma_zone_t zone) J> int64_t nitems; J> u_int i; J> J> - nitems = counter_u64_fetch(zone->uz_allocs) - J> - counter_u64_fetch(zone->uz_frees); J> + nitems = 0; J> + if (zone->uz_allocs != EARLY_COUNTER && zone->uz_frees != EARLY_COUNTER) J> + nitems = counter_u64_fetch(zone->uz_allocs) - J> + counter_u64_fetch(zone->uz_frees); J> CPU_FOREACH(i) J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs) - J> atomic_load_64(&zone->uz_cpu[i].uc_frees); J> @@ -4168,7 +4170,9 @@ uma_zone_get_allocs(uma_zone_t zone) J> uint64_t nitems; J> u_int i; J> J> - nitems = counter_u64_fetch(zone->uz_allocs); J> + nitems = 0; J> + if (zone->uz_allocs != EARLY_COUNTER) J> + nitems = counter_u64_fetch(zone->uz_allocs); J> CPU_FOREACH(i) J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs); J> J> @@ -4181,7 +4185,9 @@ uma_zone_get_frees(uma_zone_t zone) J> uint64_t nitems; J> u_int i; J> J> - nitems = counter_u64_fetch(zone->uz_frees); J> + nitems = 0; J> + if (zone->uz_frees != EARLY_COUNTER) J> + nitems = counter_u64_fetch(zone->uz_frees); J> CPU_FOREACH(i) J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_frees); IMHO, tidier code would be not to check the pointers, but check UMA booted status: if (__predict_true(booted == BOOT_RUNNING)) nitems = counter_u64_fetch(zone->uz_frees); -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Mon Jan 6 22:28:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AB121F6F15 for ; Mon, 6 Jan 2020 22:28:14 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 47s9Bj3Q7yz4KKp for ; Mon, 6 Jan 2020 22:28:13 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pl1-x62d.google.com with SMTP id b22so22362149pls.12 for ; Mon, 06 Jan 2020 14:28:13 -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=y/OjVOrLRG+qDxMHYAUWxp6z0Pgxw0cYHgQ9X2GY2BA=; b=iDcSCZ+7HXkkutpiS/Ofg1QmH7vQl4q+jUcCXZT60kDORAJxiy83JKXOjWdHhdbaBf D3UxDhlEW8VOHdYi/UXjQGpt4WznmeuaSM9xkjfmLydPeLUScIyt1UEZ9APLINrgMMGM OdzFmKyQwLxT6uI4QyrRTu9TS97lYg+g71EhJMmW8eOPI//pP/R+jI/oZehL3MrTL7rn 5O1QWDFVTuKJkZUSLdQ8kW9JX60cYrRxl6ubzAbDUaaaa0bq5lDnAP2gdXZC3ZyOZPPd 4H84LBtHp1enKW1Pqt58Z9yaJ4u6T88X44Ihl37Haa1AZI1WvtVvXsCbRaWr1oonAfNk m9JA== 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=y/OjVOrLRG+qDxMHYAUWxp6z0Pgxw0cYHgQ9X2GY2BA=; b=p8ObPhtv9+o46O3aU7y3kR37i3n0/bz86wa5nwqFbT+QgK6cIvi+K/TgVgjJTfeCWE Vi5arH9ZE1z3G2Yh+bnaytiQdV20fRyUH0zFp3+IBAl42aFDZOY+3Az24XWIZrkK+sC6 1mRUfSj69k0UI+ilInz2NgxVOkotkcXfdJC9SapYf729vkF5hnamL0OhtCTYRTDYzE6v 9X1Ui0r3ukpHC9PCDpPk+rSiHcNDNjUEyScegn1Rg7xDOfu8QRIC0aXXbEM0o2c0ZdQX akh1sMtE3Bmf4xrk/YbD7qt65d8RM69uQEAQq2AcURugrk8pYa9+ZkuUDJb2gsshO63k coHA== X-Gm-Message-State: APjAAAXlSxwIaY7Oe2ozpqUo5RErGdmagALWdWrzMhvjyP1aAzR9PRVD F+h+/NxJAklRXbCGWrGOyeNz5Q== X-Google-Smtp-Source: APXvYqxVM8hrZMrVrN0PJJj+jvT0Ce4rQQgDXZKYwAk3Lheaytw4jaSMCSqQOni3tOHlxy+CY17HZw== X-Received: by 2002:a17:902:b08d:: with SMTP id p13mr108906635plr.109.1578349691709; Mon, 06 Jan 2020 14:28:11 -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 q7sm25607665pjd.3.2020.01.06.14.28.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jan 2020 14:28:11 -0800 (PST) Date: Mon, 6 Jan 2020 12:28:08 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356389 - head/sys/vm In-Reply-To: <20200106220802.GI3339@FreeBSD.org> Message-ID: References: <202001052254.005MsQsH027909@repo.freebsd.org> <20200106220802.GI3339@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: 47s9Bj3Q7yz4KKp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=iDcSCZ+7; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::62d) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-4.35 / 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-head@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)[d.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.55)[ip: (-8.71), ipnet: 2607:f8b0::/32(-2.13), asn: 15169(-1.85), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 22:28:14 -0000 On Mon, 6 Jan 2020, Gleb Smirnoff wrote: > Jeff, > > On Sun, Jan 05, 2020 at 10:54:26PM +0000, Jeff Roberson wrote: > J> Author: jeff > J> Date: Sun Jan 5 22:54:25 2020 > J> New Revision: 356389 > J> URL: https://svnweb.freebsd.org/changeset/base/356389 > J> > J> Log: > J> The fix in r356353 was insufficient. Not every architecture returns 0 for > J> EARLY_COUNTER. Only amd64 seems to. > J> > J> Suggested by: markj > J> Reported by: lwhsu > J> Reviewed by: markj > J> PR: 243117 > J> > J> Modified: > J> head/sys/vm/uma_core.c > J> > J> Modified: head/sys/vm/uma_core.c > J> ============================================================================== > J> --- head/sys/vm/uma_core.c Sun Jan 5 21:35:02 2020 (r356388) > J> +++ head/sys/vm/uma_core.c Sun Jan 5 22:54:25 2020 (r356389) > J> @@ -4153,8 +4153,10 @@ uma_zone_get_cur(uma_zone_t zone) > J> int64_t nitems; > J> u_int i; > J> > J> - nitems = counter_u64_fetch(zone->uz_allocs) - > J> - counter_u64_fetch(zone->uz_frees); > J> + nitems = 0; > J> + if (zone->uz_allocs != EARLY_COUNTER && zone->uz_frees != EARLY_COUNTER) > J> + nitems = counter_u64_fetch(zone->uz_allocs) - > J> + counter_u64_fetch(zone->uz_frees); > J> CPU_FOREACH(i) > J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs) - > J> atomic_load_64(&zone->uz_cpu[i].uc_frees); > J> @@ -4168,7 +4170,9 @@ uma_zone_get_allocs(uma_zone_t zone) > J> uint64_t nitems; > J> u_int i; > J> > J> - nitems = counter_u64_fetch(zone->uz_allocs); > J> + nitems = 0; > J> + if (zone->uz_allocs != EARLY_COUNTER) > J> + nitems = counter_u64_fetch(zone->uz_allocs); > J> CPU_FOREACH(i) > J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_allocs); > J> > J> @@ -4181,7 +4185,9 @@ uma_zone_get_frees(uma_zone_t zone) > J> uint64_t nitems; > J> u_int i; > J> > J> - nitems = counter_u64_fetch(zone->uz_frees); > J> + nitems = 0; > J> + if (zone->uz_frees != EARLY_COUNTER) > J> + nitems = counter_u64_fetch(zone->uz_frees); > J> CPU_FOREACH(i) > J> nitems += atomic_load_64(&zone->uz_cpu[i].uc_frees); > > IMHO, tidier code would be not to check the pointers, but check UMA booted status: > > if (__predict_true(booted == BOOT_RUNNING)) > nitems = counter_u64_fetch(zone->uz_frees); That seems fine. I have drained my UMA patch queue for now but if I come back around I will include this. Thanks, Jeff > > -- > Gleb Smirnoff > From owner-svn-src-head@freebsd.org Mon Jan 6 22:48:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BCF51F8E14; Mon, 6 Jan 2020 22:48:53 +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 47s9fX6WbPz4MBv; Mon, 6 Jan 2020 22:48:52 +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 006MmoR0034496 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 14:48:50 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 006MmoBt034495; Mon, 6 Jan 2020 14:48:50 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 6 Jan 2020 14:48:50 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356393 - head/sys/vm Message-ID: <20200106224850.GJ3339@FreeBSD.org> References: <202001060251.0062pJe9067924@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001060251.0062pJe9067924@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47s9fX6WbPz4MBv 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)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 22:48:53 -0000 Jeff, On Mon, Jan 06, 2020 at 02:51:19AM +0000, Jeff Roberson wrote: J> Modified: head/sys/vm/vm_page.c J> ============================================================================== J> --- head/sys/vm/vm_page.c Mon Jan 6 01:51:23 2020 (r356392) J> +++ head/sys/vm/vm_page.c Mon Jan 6 02:51:19 2020 (r356393) J> @@ -613,10 +613,17 @@ vm_page_startup(vm_offset_t vaddr) J> slab_ipers(sizeof(struct vm_map), UMA_ALIGN_PTR)); J> J> /* J> - * Before going fully functional kmem_init() does allocation J> - * from "KMAP ENTRY" and vmem_create() does allocation from "vmem". J> + * Before we are fully boot strapped we need to account for the J> + * following allocations: J> + * J> + * "KMAP ENTRY" from kmem_init() J> + * "vmem btag" from vmem_startup() J> + * "vmem" from vmem_create() J> + * "KMAP" from vm_map_startup() J> + * J> + * Each needs at least one page per-domain. J> */ J> - boot_pages += 2; J> + boot_pages += 4 * vm_ndomains; J> #endif J> /* J> * CTFLAG_RDTUN doesn't work during the early boot process, so we must I think this chunk brings many extraneous pages per domain. Allocations for "vmem btag" from vmem_startup() are covered by vmem_startup_count(), and allocations for "KMAP" from vm_map_startup() are also counted just a few lines above: /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); /* vm_map_startup() calls uma_prealloc(). */ boot_pages += howmany(MAX_KMAP, slab_ipers(sizeof(struct vm_map), UMA_ALIGN_PTR)); The uma_prealloc() allocates as much memory as asked, it may not populate all domains. So, on NUMA it will allocate same amount of pages. Not sure if this is a right decision, but at lease the counting is correct. So, change from 2 pages to 4 isn't needed. The vm_ndomains multiplicator also seems incorrect, since at early stage we run with buckets disabled, and this single allocation will end with calling zone_alloc_item() calling zone_import() with count of 1, which will short-circuit into keg_fetch_slab() before entering domain aware code. Then keg_fetch_slab() will short circuit into startup_alloc(). Do machines with NUMA and lack of UMA_MD_SMALL_ALLOC exist? Interesting to see dmesg with DIAGNOSTIC and this change. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Jan 7 04:27:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A6EA1FA9C0; Tue, 7 Jan 2020 04:27:41 +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 47sK9T1Khnz4f8Q; Tue, 7 Jan 2020 04:27:41 +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 0C22B215EF; Tue, 7 Jan 2020 04:27:41 +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 0074Re3G032297; Tue, 7 Jan 2020 04:27:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074Refi032296; Tue, 7 Jan 2020 04:27:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070427.0074Refi032296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 04:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356431 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:27:41 -0000 Author: mjg Date: Tue Jan 7 04:27:40 2020 New Revision: 356431 URL: https://svnweb.freebsd.org/changeset/base/356431 Log: vfs: add a helper for allocating marker vnodes Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 00:54:45 2020 (r356430) +++ head/sys/kern/vfs_subr.c Tue Jan 7 04:27:40 2020 (r356431) @@ -459,6 +459,28 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_ #define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */ #endif +static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); + +static struct vnode * +vn_alloc_marker(struct mount *mp) +{ + struct vnode *vp; + + vp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); + vp->v_type = VMARKER; + vp->v_mount = mp; + + return (vp); +} + +static void +vn_free_marker(struct vnode *vp) +{ + + MPASS(vp->v_type == VMARKER); + free(vp, M_VNODE_MARKER); +} + /* * Initialize a vnode as it first enters the zone. */ @@ -5785,7 +5807,6 @@ vfs_cache_root_set(struct mount *mp, struct vnode *vp) * This interface replaces MNT_VNODE_FOREACH. */ -MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); struct vnode * __mnt_vnode_next_all(struct vnode **mvp, struct mount *mp) @@ -5825,11 +5846,9 @@ __mnt_vnode_first_all(struct vnode **mvp, struct mount { struct vnode *vp; - *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); + *mvp = vn_alloc_marker(mp); MNT_ILOCK(mp); MNT_REF(mp); - (*mvp)->v_mount = mp; - (*mvp)->v_type = VMARKER; TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { /* Allow a racy peek at VIRF_DOOMED to save a lock acquisition. */ @@ -5845,7 +5864,7 @@ __mnt_vnode_first_all(struct vnode **mvp, struct mount if (vp == NULL) { MNT_REL(mp); MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); + vn_free_marker(*mvp); *mvp = NULL; return (NULL); } @@ -5869,7 +5888,7 @@ __mnt_vnode_markerfree_all(struct vnode **mvp, struct TAILQ_REMOVE(&mp->mnt_nvnodelist, *mvp, v_nmntvnodes); MNT_REL(mp); MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); + vn_free_marker(*mvp); *mvp = NULL; } @@ -5886,7 +5905,7 @@ mnt_vnode_markerfree_active(struct vnode **mvp, struct MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); + vn_free_marker(*mvp); *mvp = NULL; } @@ -6029,12 +6048,10 @@ __mnt_vnode_first_active(struct vnode **mvp, struct mo { struct vnode *vp; - *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); + *mvp = vn_alloc_marker(mp); MNT_ILOCK(mp); MNT_REF(mp); MNT_IUNLOCK(mp); - (*mvp)->v_type = VMARKER; - (*mvp)->v_mount = mp; mtx_lock(&mp->mnt_listmtx); vp = TAILQ_FIRST(&mp->mnt_activevnodelist); From owner-svn-src-head@freebsd.org Tue Jan 7 04:29:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F2A01FAC00; Tue, 7 Jan 2020 04:29: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 47sKCg3nBFz4fHR; Tue, 7 Jan 2020 04:29: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 6477F215F9; Tue, 7 Jan 2020 04:29: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 0074TZmf032434; Tue, 7 Jan 2020 04:29:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074TYbQ032431; Tue, 7 Jan 2020 04:29:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070429.0074TYbQ032431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 04:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356432 - in head/sys: kern security/mac_veriexec sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern security/mac_veriexec sys X-SVN-Commit-Revision: 356432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:29:35 -0000 Author: mjg Date: Tue Jan 7 04:29:34 2020 New Revision: 356432 URL: https://svnweb.freebsd.org/changeset/base/356432 Log: vfs: eliminate v_tag from struct vnode There was only one consumer and it was using it incorrectly. It is given an equivalent hack. Reviewed by: jeff Differential Revision: https://reviews.freebsd.org/D23037 Modified: head/sys/kern/vfs_subr.c head/sys/security/mac_veriexec/mac_veriexec.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 04:27:40 2020 (r356431) +++ head/sys/kern/vfs_subr.c Tue Jan 7 04:29:34 2020 (r356432) @@ -1657,7 +1657,6 @@ alloc: KASSERT(vp->v_lockf == NULL, ("stale v_lockf %p", vp)); KASSERT(vp->v_pollinfo == NULL, ("stale v_pollinfo %p", vp)); vp->v_type = VNON; - vp->v_tag = tag; vp->v_op = vops; v_init_counters(vp); vp->v_bufobj.bo_ops = &buf_ops_bio; @@ -3679,7 +3678,7 @@ vgonel(struct vnode *vp) if (mp != NULL) vn_finished_secondary_write(mp); VNASSERT(vp->v_object == NULL, vp, - ("vop_reclaim left v_object vp=%p, tag=%s", vp, vp->v_tag)); + ("vop_reclaim left v_object vp=%p", vp)); /* * Clear the advisory locks and wake up waiting threads. */ @@ -3697,7 +3696,6 @@ vgonel(struct vnode *vp) VI_LOCK(vp); vp->v_vnlock = &vp->v_lock; vp->v_op = &dead_vnodeops; - vp->v_tag = "none"; vp->v_type = VBAD; } @@ -3733,7 +3731,7 @@ vn_printf(struct vnode *vp, const char *fmt, ...) vprintf(fmt, ap); va_end(ap); printf("%p: ", (void *)vp); - printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); + printf("type %s\n", typename[vp->v_type]); printf(" usecount %d, writecount %d, refcount %d", vp->v_usecount, vp->v_writecount, vp->v_holdcnt); switch (vp->v_type) { Modified: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.c Tue Jan 7 04:27:40 2020 (r356431) +++ head/sys/security/mac_veriexec/mac_veriexec.c Tue Jan 7 04:29:34 2020 (r356432) @@ -737,6 +737,22 @@ MAC_POLICY_SET(&mac_veriexec_ops, mac_veriexec, MAC_VE MPC_LOADTIME_FLAG_NOTLATE, &mac_veriexec_slot); MODULE_VERSION(mac_veriexec, 1); +static struct vnode * +mac_veriexec_bottom_vnode(struct vnode *vp) +{ + struct vnode *ldvp = NULL; + + /* + * XXX This code is bogus. nullfs is not the only stacking + * filesystem. Less bogus code would add a VOP to reach bottom + * vnode and would not make assumptions how to get there. + */ + if (vp->v_mount != NULL && + strcmp(vp->v_mount->mnt_vfc->vfc_name, "nullfs") == 0) + ldvp = NULLVPTOLOWERVP(vp); + return (ldvp); +} + /** * @brief Get the fingerprint status set on a vnode. * @@ -748,6 +764,7 @@ fingerprint_status_t mac_veriexec_get_fingerprint_status(struct vnode *vp) { fingerprint_status_t fps; + struct vnode *ldvp; fps = SLOT(vp->v_label); switch (fps) { @@ -757,12 +774,9 @@ mac_veriexec_get_fingerprint_status(struct vnode *vp) break; default: /* we may need to recurse */ - if (strcmp(vp->v_tag, "null") == 0) { - struct vnode *ldvp; - - ldvp = NULLVPTOLOWERVP(vp); + ldvp = mac_veriexec_bottom_vnode(vp); + if (ldvp != NULL) return mac_veriexec_get_fingerprint_status(ldvp); - } break; } return fps; @@ -808,12 +822,11 @@ void mac_veriexec_set_fingerprint_status(struct vnode *vp, fingerprint_status_t fp_status) { + struct vnode *ldvp; /* recurse until we find the real storage */ - if (strcmp(vp->v_tag, "null") == 0) { - struct vnode *ldvp; - - ldvp = NULLVPTOLOWERVP(vp); + ldvp = mac_veriexec_bottom_vnode(vp); + if (ldvp != NULL) { mac_veriexec_set_fingerprint_status(ldvp, fp_status); return; } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Jan 7 04:27:40 2020 (r356431) +++ head/sys/sys/vnode.h Tue Jan 7 04:29:34 2020 (r356432) @@ -174,7 +174,6 @@ struct vnode { int v_writecount; /* I ref count of writers or (negative) text users */ u_int v_hash; - const char *v_tag; /* u type of underlying data */ }; #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ From owner-svn-src-head@freebsd.org Tue Jan 7 04:30:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B9E21FAE6B; Tue, 7 Jan 2020 04:30: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 47sKF62m09z4fRB; Tue, 7 Jan 2020 04:30: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 5A0962161A; Tue, 7 Jan 2020 04:30: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 0074UoND033297; Tue, 7 Jan 2020 04:30:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074UoEY033296; Tue, 7 Jan 2020 04:30:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070430.0074UoEY033296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 04:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356433 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:30:50 -0000 Author: mjg Date: Tue Jan 7 04:30:49 2020 New Revision: 356433 URL: https://svnweb.freebsd.org/changeset/base/356433 Log: vfs: annotate numvnodes and vnode_free_list_mtx with __exclusive_cache_line Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 04:29:34 2020 (r356432) +++ head/sys/kern/vfs_subr.c Tue Jan 7 04:30:49 2020 (r356433) @@ -139,7 +139,7 @@ static int v_inval_buf_range_locked(struct vnode *vp, * Number of vnodes in existence. Increased whenever getnewvnode() * allocates a new vnode, decreased in vdropl() for VIRF_DOOMED vnode. */ -static unsigned long numvnodes; +static u_long __exclusive_cache_line numvnodes; SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, "Number of vnodes in existence"); @@ -227,7 +227,7 @@ static struct mtx mntid_mtx; * numvnodes * freevnodes */ -static struct mtx vnode_free_list_mtx; +static struct mtx __exclusive_cache_line vnode_free_list_mtx; /* Publicly exported FS */ struct nfs_public nfs_pub; From owner-svn-src-head@freebsd.org Tue Jan 7 04:33:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60D271FB370; Tue, 7 Jan 2020 04:33:15 +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 47sKHv20ZKz4fnH; Tue, 7 Jan 2020 04:33:15 +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 3FEAE217BD; Tue, 7 Jan 2020 04:33:15 +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 0074XFmZ038366; Tue, 7 Jan 2020 04:33:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074XF0f038365; Tue, 7 Jan 2020 04:33:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001070433.0074XF0f038365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 7 Jan 2020 04:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356434 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 356434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:33:15 -0000 Author: delphij Date: Tue Jan 7 04:33:14 2020 New Revision: 356434 URL: https://svnweb.freebsd.org/changeset/base/356434 Log: fsck_msdosfs.8: document -M. Reported by: mckusick Reviewed by: mckusick, emaste, bcr MFC after: 28 days X-MFC-with: r356313 Differential Revision: https://reviews.freebsd.org/D23049 Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8 Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8 ============================================================================== --- head/sbin/fsck_msdosfs/fsck_msdosfs.8 Tue Jan 7 04:30:49 2020 (r356433) +++ head/sbin/fsck_msdosfs/fsck_msdosfs.8 Tue Jan 7 04:33:14 2020 (r356434) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd January 6, 2020 .Dt FSCK_MSDOSFS 8 .Os .Sh NAME @@ -37,7 +37,7 @@ .Op Fl Cf .Ar filesystem ... .Nm -.Op Fl Cny +.Op Fl CMny .Ar filesystem ... .Sh DESCRIPTION The @@ -84,6 +84,21 @@ which seeks to determine whether the file system needs immediately in foreground, or if its cleaning can be deferred to background. FAT (MS-DOS) file systems must always be cleaned in the foreground. A non-zero exit code is always returned for this option. +.It Fl M +Causes +.Nm +to not use +.Xr mmap 2 +when checking a FAT32 file system. +This option is mainly for debugging purposes and is not normally necessary. +The +.Nm +utility will automatically fall back to use a simple LRU cache of 4 MiB +when it failed to perform +.Xr mmap 2 , +or when +.Fl M +is specified. .It Fl f Force .Nm From owner-svn-src-head@freebsd.org Tue Jan 7 04:34:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C2D31FB41B; Tue, 7 Jan 2020 04:34:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sKJr1pbnz4fwS; Tue, 7 Jan 2020 04:34:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39382217CD; Tue, 7 Jan 2020 04:34:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0074Y4Dv038450; Tue, 7 Jan 2020 04:34:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074Y4Wn038449; Tue, 7 Jan 2020 04:34:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070434.0074Y4Wn038449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 04:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356435 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:34:04 -0000 Author: mjg Date: Tue Jan 7 04:34:03 2020 New Revision: 356435 URL: https://svnweb.freebsd.org/changeset/base/356435 Log: vfs: prevent numvnodes and freevnodes re-reads when appropriate Otherwise in code like this: if (numvnodes > desiredvnodes) vnlru_free_locked(numvnodes - desiredvnodes, NULL); numvnodes can drop below desiredvnodes prior to the call and if the compiler generated another read the subtraction would get a negative value. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 04:33:14 2020 (r356434) +++ head/sys/kern/vfs_subr.c Tue Jan 7 04:34:03 2020 (r356435) @@ -1211,16 +1211,19 @@ vnlru_free(int count, struct vfsops *mnt_op) static int vspace(void) { + u_long rnumvnodes, rfreevnodes; int space; gapvnodes = imax(desiredvnodes - wantfreevnodes, 100); vhiwat = gapvnodes / 11; /* 9% -- just under the 10% in vlrureclaim() */ vlowat = vhiwat / 2; - if (numvnodes > desiredvnodes) + rnumvnodes = atomic_load_long(&numvnodes); + rfreevnodes = atomic_load_long(&freevnodes); + if (rnumvnodes > desiredvnodes) return (0); - space = desiredvnodes - numvnodes; + space = desiredvnodes - rnumvnodes; if (freevnodes > wantfreevnodes) - space += freevnodes - wantfreevnodes; + space += rfreevnodes - wantfreevnodes; return (space); } @@ -1292,6 +1295,7 @@ static int vnlruproc_sig; static void vnlru_proc(void) { + u_long rnumvnodes, rfreevnodes; struct mount *mp, *nmp; unsigned long onumvnodes; int done, force, trigger, usevnodes, vsp; @@ -1304,13 +1308,14 @@ vnlru_proc(void) for (;;) { kproc_suspend_check(vnlruproc); mtx_lock(&vnode_free_list_mtx); + rnumvnodes = atomic_load_long(&numvnodes); /* * If numvnodes is too large (due to desiredvnodes being * adjusted using its sysctl, or emergency growth), first * try to reduce it by discarding from the free list. */ - if (numvnodes > desiredvnodes) - vnlru_free_locked(numvnodes - desiredvnodes, NULL); + if (rnumvnodes > desiredvnodes) + vnlru_free_locked(rnumvnodes - desiredvnodes, NULL); /* * Sleep if the vnode cache is in a good state. This is * when it is not over-full and has space for about a 4% @@ -1332,7 +1337,10 @@ vnlru_proc(void) } mtx_unlock(&vnode_free_list_mtx); done = 0; - onumvnodes = numvnodes; + rnumvnodes = atomic_load_long(&numvnodes); + rfreevnodes = atomic_load_long(&freevnodes); + + onumvnodes = rnumvnodes; /* * Calculate parameters for recycling. These are the same * throughout the loop to give some semblance of fairness. @@ -1340,10 +1348,10 @@ vnlru_proc(void) * of resident pages. We aren't trying to free memory; we * are trying to recycle or at least free vnodes. */ - if (numvnodes <= desiredvnodes) - usevnodes = numvnodes - freevnodes; + if (rnumvnodes <= desiredvnodes) + usevnodes = rnumvnodes - rfreevnodes; else - usevnodes = numvnodes; + usevnodes = rnumvnodes; if (usevnodes <= 0) usevnodes = 1; /* @@ -1516,14 +1524,17 @@ getnewvnode_wait(int suspended) void getnewvnode_reserve(u_int count) { + u_long rnumvnodes, rfreevnodes; struct thread *td; /* Pre-adjust like the pre-adjust in getnewvnode(), with any count. */ /* XXX no longer so quick, but this part is not racy. */ mtx_lock(&vnode_free_list_mtx); - if (numvnodes + count > desiredvnodes && freevnodes > wantfreevnodes) - vnlru_free_locked(ulmin(numvnodes + count - desiredvnodes, - freevnodes - wantfreevnodes), NULL); + rnumvnodes = atomic_load_long(&numvnodes); + rfreevnodes = atomic_load_long(&freevnodes); + if (rnumvnodes + count > desiredvnodes && rfreevnodes > wantfreevnodes) + vnlru_free_locked(ulmin(rnumvnodes + count - desiredvnodes, + rfreevnodes - wantfreevnodes), NULL); mtx_unlock(&vnode_free_list_mtx); td = curthread; From owner-svn-src-head@freebsd.org Tue Jan 7 04:34:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56D991FB4A9; Tue, 7 Jan 2020 04:34:30 +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 47sKKL1Nhmz4g7t; Tue, 7 Jan 2020 04:34:30 +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 2AC97217CF; Tue, 7 Jan 2020 04:34:30 +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 0074YUqD038620; Tue, 7 Jan 2020 04:34:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0074YUs6038619; Tue, 7 Jan 2020 04:34:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070434.0074YUs6038619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 04:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356436 - 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: 356436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 04:34:30 -0000 Author: mjg Date: Tue Jan 7 04:34:29 2020 New Revision: 356436 URL: https://svnweb.freebsd.org/changeset/base/356436 Log: zfs: plug a vnode reserve leak in zfs_make_xattrdir Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Jan 7 04:34:03 2020 (r356435) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Jan 7 04:34:29 2020 (r356436) @@ -829,6 +829,7 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *vap, vnode_t * if (error) { zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); return (error); } zfs_mknode(zp, vap, tx, cr, IS_XATTR, &xzp, &acl_ids); From owner-svn-src-head@freebsd.org Tue Jan 7 05:33:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E94781E0670; Tue, 7 Jan 2020 05:33:33 +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 47sLdT5xDsz3Dq2; Tue, 7 Jan 2020 05:33:33 +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 C692C2229A; Tue, 7 Jan 2020 05:33:33 +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 0075XXEW076101; Tue, 7 Jan 2020 05:33:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0075XX7D076100; Tue, 7 Jan 2020 05:33:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001070533.0075XX7D076100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 05:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356437 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 356437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 05:33:34 -0000 Author: mjg Date: Tue Jan 7 05:33:33 2020 New Revision: 356437 URL: https://svnweb.freebsd.org/changeset/base/356437 Log: procstat: read lo_name instead of now removed v_tag Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Tue Jan 7 04:34:29 2020 (r356436) +++ head/lib/libprocstat/libprocstat.c Tue Jan 7 05:33:33 2020 (r356437) @@ -1278,10 +1278,10 @@ procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat vn->vn_type = vntype2psfsttype(vnode.v_type); if (vnode.v_type == VNON || vnode.v_type == VBAD) return (0); - error = kvm_read_all(kd, (unsigned long)vnode.v_tag, tagstr, - sizeof(tagstr)); + error = kvm_read_all(kd, (unsigned long)vnode.v_lock.lock_object.lo_name, + tagstr, sizeof(tagstr)); if (error == 0) { - warnx("can't read v_tag at %p", (void *)vp); + warnx("can't read lo_name at %p", (void *)vp); goto fail; } tagstr[sizeof(tagstr) - 1] = '\0'; From owner-svn-src-head@freebsd.org Tue Jan 7 05:43:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B5291E1672; Tue, 7 Jan 2020 05:43:15 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sLrf4tGqz3FF6; Tue, 7 Jan 2020 05:43:14 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1578375789; bh=EfEvNCPwMIYzOFfQTWNYyi6OOuRohk523XMo1YJBkBw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=H00uorCO8/ZWRP/VUV5UUD5APBTP9hBtVGSwCmonGs6uqWSKg0H9CwOUw0Xz8RLE+ HJiVPLKakgVWprP0zuvgGLGR/7mh9ayGGIg+Sb9BCYaaulImOd4ajDo/Pj1W+nhee7 OsdZCfqqkTTSPzeBkwA3hD+ea6to6oHSTX/Gm/do= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from freyja ([79.192.173.245]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MD9T1-1ixoRo1rM1-0099S8; Tue, 07 Jan 2020 06:43:09 +0100 Date: Tue, 7 Jan 2020 06:43:02 +0100 From: "O. Hartmann" To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356437 - head/lib/libprocstat Message-ID: <20200107064255.18dad9d2@freyja> In-Reply-To: <202001070533.0075XX7D076100@repo.freebsd.org> References: <202001070533.0075XX7D076100@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qahe+CePIZL9HvBMFdp7eSN7AmBs7GCiK3YNQyt56cyF08rMCnX In9IMGFkyx+T31By8wc9cObGWKlleHoIf/nuLt6Da79XqkigVo7ArpdHuvSUXSVOSJ7yiAr w4t++UyPI37ldyj0rpR9Vi5SAZ04TEN8kcb9koFJpgeu8uu0d0yhdXQUF7vu2ntlBDbuFFZ we8CFoTDQvnT/n5tOsTiA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:EOjUw3mA3Dg=:mvck+LlKC3MiuZWByZsj9v 5Zc/dGL0nyVOurUOp+wd57uVXUuDEQ/WV+Cos+eNj9oxk5gkdcJeOISXcE+IRTAbuTjb3pLPc IKe0MQa16Lped9GluvDpbwul+y+cpM2CDXstKA1tN6Zus5R2TXBFTlUnkv1Fx/22KN51PRofU ffyr9M+uzJ0FOE4QQqK81o/sJfc5XzJzZef5qQaFXWmwTuIt8pGRHpUW+SQJ55oksnt0Vl6qF oRVYhLSioO1PJgmgf4dJKGIEpW6Ios/n01S8nHmysgDXzoY4bEQtfNl4uct9WQGyY4XtOsgCM FgdGbA4wg4ugR4S849pEkgtW9rqnj8x7d5Zy/yH8UJ/JO4xZXfeHOhpf7pASdddpQ+lkn7kAW Tfkv9dxF4tRLDUdD/Gb7R0MH3OD1aWfTqpzX/6RuKQ46ojFhh0HIZp7bqJvz+f1X1DwLRiFu4 4FEvGQYjJfXR/L410JCkscSdc/xvNAgRBxGsSAEsBKPVo9YOr0mO9yeHqIShqbMyFyk9IDU9D 3F8ISOoVerbaDvZmSHA7jW9JWxAyRJde2sGhtUcA8RbfXTD+fylKAy+SZJGoXBfsR5ofebALx d9BA6Db5bDk+TRzKR6OyTe4BtVO6pQxffgMwypy2GPgYjNOiDWSzyC837WJ/rdX2ByWtUniSc oqV/Avqa3IEHYwVYPDk051uAMpggnDhskftpqgqgYf7XJ4M+4dfFMcIeT3wzqtel9jWEqAuEp PxSiYbV4ueXwcLXt+eDIqABF17/HLUbybbnFRhQC/TB1E42NkoHX3ETbHAvTnUmKbgjroT5O7 GdIzU6PS3WhTw0DrMw3R9+fPqa0L9pmFFO7fxQ/oqcJLZ/58drVEvSnN0x4SdcvipK6mP2/Go RLmWNqWk3ONbEHczNa5IbXGc1AsOK5lUgp6Z5DHV4Xj2psCvhAIiOQwvO1ohccxmBhY9YPLCR uaGmoOclJ1bJgOP6rrtjKLx1gcVRqenFxfSp8aqJsKxjo3B1V05R0ggiyaiw+HxyEWh64YMvb +wDULegsBFPk8rn2G90FqGesd1kwOvJ067UQDh10VRRr6XL4uN/ujisWA6EOFKB6QMGg3s6HU o4wotxGxhObwU9G/oZZOUXp7ZO+28oftxKyPWbdx0Kb0ATGgR1+toZn+jw09K1zNVuD73vEVd ZotgpX3ecVt3zLi80U2bDdTMJF3Io/88A250ScZkkzuOSmPVVvDphBwTO7QQVPmZeYqNynO9n kNBBU82PNVD/Xk0D2UUdKcRKBJZ+z3Os5xluJImpX20nVK+kQPOprGr4IsBQ= X-Rspamd-Queue-Id: 47sLrf4tGqz3FF6 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 05:43:15 -0000 On Tue, 7 Jan 2020 05:33:33 +0000 (UTC) Mateusz Guzik wrote: > Author: mjg > Date: Tue Jan 7 05:33:33 2020 > New Revision: 356437 > URL: https://svnweb.freebsd.org/changeset/base/356437 > > Log: > procstat: read lo_name instead of now removed v_tag > > Modified: > head/lib/libprocstat/libprocstat.c > > Modified: head/lib/libprocstat/libprocstat.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/libprocstat/libprocstat.c Tue Jan 7 04:34:29 2020 > (r356436) +++ head/lib/libprocstat/libprocstat.c Tue Jan 7 05:33:33 > 2020 (r356437) @@ -1278,10 +1278,10 @@ > procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat vn->vn_type =3D > vntype2psfsttype(vnode.v_type); if (vnode.v_type =3D=3D VNON || vnode.v_= type =3D=3D > VBAD) return (0); > - error =3D kvm_read_all(kd, (unsigned long)vnode.v_tag, tagstr, > - sizeof(tagstr)); > + error =3D kvm_read_all(kd, (unsigned > long)vnode.v_lock.lock_object.lo_name, > + tagstr, sizeof(tagstr)); > if (error =3D=3D 0) { > - warnx("can't read v_tag at %p", (void *)vp); > + warnx("can't read lo_name at %p", (void *)vp); > goto fail; > } > tagstr[sizeof(tagstr) - 1] =3D '\0'; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" This commit makes buildworld to fail: [...] =2D-- lib/libprocstat__L --- /usr/src/lib/libprocstat/libprocstat.c:848:2: warning: variable 'files' is= used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ /usr/src/lib/libprocstat/libprocstat.c:851:6: note: uninitialized use occu= rs here if (files =3D=3D NULL && errno !=3D EPERM) { ^~~~~ /usr/src/lib/libprocstat/libprocstat.c:827:32: note: initialize the variab= le 'files' to silence this warning struct kinfo_file *kif, *files; ^ =3D NULL /usr/src/lib/libprocstat/libprocstat.c:1281:48: error: no member named 'v_= tag' in 'struct vnode' [...] Kind regards, oh From owner-svn-src-head@freebsd.org Tue Jan 7 06:43:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36FDA1E7ED5; Tue, 7 Jan 2020 06:43:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sN9g2YmMz3HHg; Tue, 7 Jan 2020 06:43:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id oiZuiIPzc17ZDoiZwiyKYV; Mon, 06 Jan 2020 23:43:01 -0700 X-Authority-Analysis: v=2.3 cv=ZsqT1OzG 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=ic_SNM59hN71-EiAzz4A: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 5871C1B1; Mon, 6 Jan 2020 22:42:58 -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 0076gwdn026498; Mon, 6 Jan 2020 22:42:58 -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 0076gvXR026495; Mon, 6 Jan 2020 22:42:57 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202001070642.0076gvXR026495@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: "O. Hartmann" cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356437 - head/lib/libprocstat In-reply-to: <20200107064255.18dad9d2@freyja> References: <202001070533.0075XX7D076100@repo.freebsd.org> <20200107064255.18dad9d2@freyja> Comments: In-reply-to "O. Hartmann" message dated "Tue, 07 Jan 2020 06:43:02 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 06 Jan 2020 22:42:57 -0800 X-CMAE-Envelope: MS4wfDcz/qUhnkRTyKL2Is1dfJ8I0UVCjAgXSAyjCO8ukCM3ZKj9KanSP1alQ46zeK6W35CVpnnImBdlt0kMrG5YTxPqhlqY2GdMNTLqqT2V7jZmVh8pV50Y YisQyVbX05awpTQj3rZmUxkNd0vUxDZPeQSVN3wEdaPEJTZyZ5HyXWgfmi13bwZAoFyg0XoIkmLCY+QPSa9DW9YtKxRutra8uA3gwtyBSnXDWH4zeRYbYTfw YVdfYQTxWy+1A0rBApdu90dhcxSyoNIinjpqkIt8lt5+iVoNFrhGOQtua+L7oVABBZQVYO7ySvIsSdAASN3/jCQkM+kt29PNcBOjkRTMpfA= X-Rspamd-Queue-Id: 47sN9g2YmMz3HHg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.30)[ip: (-5.83), ipnet: 64.59.128.0/20(-3.13), asn: 6327(-2.43), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 06:43:05 -0000 In message <20200107064255.18dad9d2@freyja>, "O. Hartmann" writes: > On Tue, 7 Jan 2020 05:33:33 +0000 (UTC) > Mateusz Guzik wrote: > > > Author: mjg > > Date: Tue Jan 7 05:33:33 2020 > > New Revision: 356437 > > URL: https://svnweb.freebsd.org/changeset/base/356437 > > > > Log: > > procstat: read lo_name instead of now removed v_tag > > > > Modified: > > head/lib/libprocstat/libprocstat.c > > > > Modified: head/lib/libprocstat/libprocstat.c > > =========================================================================== > === > > --- head/lib/libprocstat/libprocstat.c Tue Jan 7 04:34:29 2020 > > (r356436) +++ head/lib/libprocstat/libprocstat.c Tue Jan 7 05:33:33 > > 2020 (r356437) @@ -1278,10 +1278,10 @@ > > procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat vn->vn_type = > > vntype2psfsttype(vnode.v_type); if (vnode.v_type == VNON || vnode.v_type == > > VBAD) return (0); > > - error = kvm_read_all(kd, (unsigned long)vnode.v_tag, tagstr, > > - sizeof(tagstr)); > > + error = kvm_read_all(kd, (unsigned > > long)vnode.v_lock.lock_object.lo_name, > > + tagstr, sizeof(tagstr)); > > if (error == 0) { > > - warnx("can't read v_tag at %p", (void *)vp); > > + warnx("can't read lo_name at %p", (void *)vp); > > goto fail; > > } > > tagstr[sizeof(tagstr) - 1] = '\0'; > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > This commit makes buildworld to fail: > > [...] > --- lib/libprocstat__L --- > /usr/src/lib/libprocstat/libprocstat.c:848:2: warning: variable 'files' is us > ed > uninitialized whenever switch default is taken [-Wsometimes-uninitialized] > default: ^~~~~~~ > /usr/src/lib/libprocstat/libprocstat.c:851:6: note: uninitialized use occurs > here if (files == NULL && errno != EPERM) { > ^~~~~ > /usr/src/lib/libprocstat/libprocstat.c:827:32: note: initialize the variable > 'files' to silence this warning struct kinfo_file *kif, *files; > ^ > = NULL > /usr/src/lib/libprocstat/libprocstat.c:1281:48: error: no member named 'v_tag > ' > in 'struct vnode' > > [...] > > Kind regards, > > oh > > It would appear you don't have this commit in your tree. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Jan 7 08:39:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BB731F4A85 for ; Tue, 7 Jan 2020 08:39:46 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-21.consmr.mail.gq1.yahoo.com (sonic313-21.consmr.mail.gq1.yahoo.com [98.137.65.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47sQmK40pVz3NJ5 for ; Tue, 7 Jan 2020 08:39:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: domZ99IVM1m08hAogKNF1ZdP_DabPfnjfJxnIwUVh.6n4scDndvvGnLFk736B2i rGjKz_6UYxaQ5uB_cCvh5xe4e6oh3OW2fqUBg71qUc1cqhMyA8vZkzmvpTA4HXAyEOmALu03Ii_A .1pj6gPgyMSRmgrh3c5zANgVE.Njm6w86k1RA1GKt4UFrbX8ocKueBjnlCLeO90PjEQrl9U6FObZ N8n_lziRfpwHzCjwdFaQvEi79yHaus1JunocjmB3siVL3485yPqdiEv1JwHGVacxnECmqSj3PHH2 pkEn0dyqDjwk0hGk66Zx6TlWUqYhhEX3cx5_3BrLKbGVLRZjqLx1BxqRqA61FaDbtZKcCJhg0fvN m2RNay6yCDlUaunKnKBZsjaI1M5kK.lEnpIdTVN.4Zkp6jtPaTS1SHkhjAE8diHTD3vaC7f6Rr16 v2TjaNI44Bo3aIPAmaY3PiLquKVTWsnnHNTWCuCNUlHA94fPHSBLwICakBBISEOhdZoxkV6vG3HZ HWUhvTOHkENYPI9.SDOFKl.gWAHy0oroQpu2XGmEvSbo4b1ogkyXYF7vgxg8X09.3R8I91P0eKU7 6FwMguX5PMF8_UxYokQuXiGKxpfeKolOxgIhhtYr1spepFTLv0corDiEgU3sYAEtlLhlHW52gOaZ DrbCll01oSo3S0EAENJnNNfXS5PA1hroXo3tGizwk9P5Y2lBvgkO_knXQfFl.XqlMQxr88W3Ewr4 DMp.O_WE8X2X5PX0H.07YDgFshds4REQ3f9WNDo_DXKdioiqJCc4p9erbjUm7QwiLKYEzCgPIcsS sRZ_vrtfk8nPI7VtjqYPXEO.RKgalXSInmVAWF7RLFxtJYa3MELLBcQuuljVQj3t378YCGMc16iS w1S3I53xwGdtfE0uv8gZkf6iZrDSdYSYfA2MucxHS3YKsjNRwqtmNb8_Y_SQ.azHROrmdqdTPSkm Vw7DUs2MN.QCs6v6ZCkl8BIob8Z3OtxVNB.YStka5ONj.ILL5ZkpRg33taoRYBbW6XekiABp6x5L kfpIhtiKSf_5Mhoqxgv1PW9Ue.pPJRFlOkYjNtAE9PUyYqT.o7wNfpTEgJzFftmRvYh.r1YrrNdE 5ox8o2tAhpmR1vI0Qq3vMC5vCG3ehBFwhKJNvsgI5CIIlc8bjZNityFOXA1hBkgHmHDiDshPaEZf ICg511TfS.4VGQOT1v4ZdBTH.hkOqYWhN1HSrnAfKbdt91HyJm4CvXMLMRDjyN0_.ZBAgBxdnfL8 qa_fYWtHK40ZE6ZmOTrbvQU9v36wCEPcAQGpF5tT9eKhlqoZcsS8GSJocqUorOeRgMx4do1FzgWm AOclI4RShS2F_ygMgpoGCjFcVGtanTriqC_8_.UepSuVbW7h7CzBpN0YODY2I3hqb5RGicVnbw9a ETiIPv6RoCoiWvdEsR6kdM642JFX4B9I- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Tue, 7 Jan 2020 08:39:43 +0000 Received: by smtp429.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f38111a93bdf34884a650323ae2005c6; Tue, 07 Jan 2020 08:39:38 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r356437 - head/lib/libprocstat Message-Id: Date: Tue, 7 Jan 2020 00:39:36 -0800 To: "mjg@freebsd.org " , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3608.40.2.2.4) References: X-Rspamd-Queue-Id: 47sQmK40pVz3NJ5 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.34 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.862,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.976,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[84.65.137.98.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (1.13), ipnet: 98.137.64.0/21(0.88), asn: 36647(0.70), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 08:39:46 -0000 (Derived from O. Hartmann's report, despite his not having the same source version, . . .) In the code: 823 static struct filestat_list * 824 procstat_getfiles_sysctl(struct procstat *procstat, struct = kinfo_proc *kp, 825 int mmapped) 826 { 827 struct kinfo_file *kif, *files; . . . 841 switch(procstat->type) { 842 case PROCSTAT_SYSCTL: 843 files =3D kinfo_getfile(kp->ki_pid, &cnt); 844 break; 845 case PROCSTAT_CORE: 846 files =3D kinfo_getfile_core(procstat->core, = &cnt); 847 break; 848 default: 849 assert(!"invalid type"); 850 } 851 if (files =3D=3D NULL && errno !=3D EPERM) { 852 for the "default:" case, if assert is disabled to be a no-op via NDEBUG, then files would be tested in an uninitialized state. The compiler complaint seems valid for this. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Jan 7 09:02:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E25161F6B48; Tue, 7 Jan 2020 09:02:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sRGG5lTCz3PDm; Tue, 7 Jan 2020 09:02:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C08F0248C3; Tue, 7 Jan 2020 09:02:14 +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 00792EiU001135; Tue, 7 Jan 2020 09:02:14 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00792Exb001134; Tue, 7 Jan 2020 09:02:14 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001070902.00792Exb001134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 7 Jan 2020 09:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356438 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 356438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 09:02:14 -0000 Author: kp Date: Tue Jan 7 09:02:14 2020 New Revision: 356438 URL: https://svnweb.freebsd.org/changeset/base/356438 Log: sifive: Fix incorrect tx/rx ctrl defines Happily these were never used, but they should be correct anyway. Reported by: Nicholas O'Brien Sponsored by: Axiado Modified: head/sys/riscv/sifive/sifive_uart.c Modified: head/sys/riscv/sifive/sifive_uart.c ============================================================================== --- head/sys/riscv/sifive/sifive_uart.c Tue Jan 7 05:33:33 2020 (r356437) +++ head/sys/riscv/sifive/sifive_uart.c Tue Jan 7 09:02:14 2020 (r356438) @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); #define SFUART_TXCTRL 0x08 #define SFUART_TXCTRL_ENABLE 0x01 #define SFUART_TXCTRL_NSTOP 0x02 -#define SFUART_TXCTRL_TXCNT 0xb0000 +#define SFUART_TXCTRL_TXCNT 0x70000 #define SFUART_TXCTRL_TXCNT_SHIFT 16 #define SFUART_RXCTRL 0x0c #define SFUART_RXCTRL_ENABLE 0x01 -#define SFUART_RXCTRL_RXCNT 0xb0000 +#define SFUART_RXCTRL_RXCNT 0x70000 #define SFUART_RXCTRL_RXCNT_SHIFT 16 #define SFUART_IRQ_ENABLE 0x10 #define SFUART_IRQ_ENABLE_TXWM 0x01 From owner-svn-src-head@freebsd.org Tue Jan 7 10:38:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B2751FF52F; Tue, 7 Jan 2020 10:38:56 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from sc1.bsdpad.com (sc1.bsdpad.com [163.172.212.18]) (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 47sTPr2dHyz3ycX; Tue, 7 Jan 2020 10:38:56 +0000 (UTC) (envelope-from br@bsdpad.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bsdpad.com; s=20190317; h=Subject:To:From; bh=38bmMhNlFuOOSEhAza/ZHL0ByfbZwziWCJCHArQOf1M=; b=a+xuq/BjHhBC44tXYK3va1tEhs Hzn2Gd8WqdWPiiww5wEW+n2Kiz2pFxh8SoJXY1hNXE5Y1kBKGLQG+GDgwmVK1+xYJ7zAAPKU0aHiO iCsSHy+YozAZBpSUEsYJiAj6xQbQRSvMDpIn6iCJHYaQ7iQgo2gSlPLxCZ9LSGQJPcDt9A36ZCsc6 6KtZsfuShpK2lJ/3BUamKJ2mqaYtlYaQmBsXiP1psn/BqScj/DjQzTEPwymii9LeC0UYcc1z1B9qJ cr0J+PW6a88HmsdlU/B5NfViIG0zj72tKr+rhieeOlJrT0tHI/HmAu5puQm9zk2YXoaBwreNt/DL2 kX2oBVhg==; Received: from localhost ([127.0.0.1] helo=bsdpad.com) by sc1.bsdpad.com with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1iomB4-000AEb-FS; Tue, 07 Jan 2020 10:33:34 +0000 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Tue, 7 Jan 2020 10:33:34 +0000 (GMT) Date: Tue, 7 Jan 2020 10:33:34 +0000 From: Ruslan Bukin To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356438 - head/sys/riscv/sifive Message-ID: <20200107103334.GA39280@bsdpad.com> References: <202001070902.00792Exb001134@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202001070902.00792Exb001134@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 47sTPr2dHyz3ycX X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 10:38:56 -0000 On Tue, Jan 07, 2020 at 09:02:14AM +0000, Kristof Provost wrote: > Author: kp > Date: Tue Jan 7 09:02:14 2020 > New Revision: 356438 > URL: https://svnweb.freebsd.org/changeset/base/356438 > > Log: > sifive: Fix incorrect tx/rx ctrl defines > > Happily these were never used, but they should be correct anyway. > > Reported by: Nicholas O'Brien > Sponsored by: Axiado > > Modified: > head/sys/riscv/sifive/sifive_uart.c > > Modified: head/sys/riscv/sifive/sifive_uart.c > ============================================================================== > --- head/sys/riscv/sifive/sifive_uart.c Tue Jan 7 05:33:33 2020 (r356437) > +++ head/sys/riscv/sifive/sifive_uart.c Tue Jan 7 09:02:14 2020 (r356438) > @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); > #define SFUART_TXCTRL 0x08 > #define SFUART_TXCTRL_ENABLE 0x01 > #define SFUART_TXCTRL_NSTOP 0x02 > -#define SFUART_TXCTRL_TXCNT 0xb0000 > +#define SFUART_TXCTRL_TXCNT 0x70000 > #define SFUART_TXCTRL_TXCNT_SHIFT 16 > #define SFUART_RXCTRL 0x0c > #define SFUART_RXCTRL_ENABLE 0x01 > -#define SFUART_RXCTRL_RXCNT 0xb0000 > +#define SFUART_RXCTRL_RXCNT 0x70000 > #define SFUART_RXCTRL_RXCNT_SHIFT 16 > #define SFUART_IRQ_ENABLE 0x10 > #define SFUART_IRQ_ENABLE_TXWM 0x01 That could be #define SFUART_RXCTRL_RXCNT_SHIFT 16 #define SFUART_RXCTRL_RXCNT_MASK (0x7 << SFUART_RXCTRL_RXCNT_SHIFT) Ruslan From owner-svn-src-head@freebsd.org Tue Jan 7 15:42:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B96C1EB37D; Tue, 7 Jan 2020 15:42:02 +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 47sc7Z2GRBz4FtK; Tue, 7 Jan 2020 15:42:02 +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 490BC1255; Tue, 7 Jan 2020 15:42:02 +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 007Fg2sf043193; Tue, 7 Jan 2020 15:42:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007Fg24I043192; Tue, 7 Jan 2020 15:42:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001071542.007Fg24I043192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 15:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356439 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:42:02 -0000 Author: mjg Date: Tue Jan 7 15:42:01 2020 New Revision: 356439 URL: https://svnweb.freebsd.org/changeset/base/356439 Log: vfs: use a dedicated counter for free vnode recycling Otherwise vlrureclaim activitity is mixed in and it is hard to tell which vnodes got reclaimed. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 09:02:14 2020 (r356438) +++ head/sys/kern/vfs_subr.c Tue Jan 7 15:42:01 2020 (r356439) @@ -204,6 +204,10 @@ static counter_u64_t recycles_count; SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, "Number of vnodes recycled to meet vnode cache targets"); +static counter_u64_t recycles_free_count; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count, + "Number of free vnodes recycled to meet vnode cache targets"); + /* * Various variables used for debugging the new implementation of * reassignbuf(). @@ -603,6 +607,7 @@ vntblinit(void *dummy __unused) vnodes_created = counter_u64_alloc(M_WAITOK); recycles_count = counter_u64_alloc(M_WAITOK); + recycles_free_count = counter_u64_alloc(M_WAITOK); free_owe_inact = counter_u64_alloc(M_WAITOK); /* @@ -1466,7 +1471,7 @@ vtryrecycle(struct vnode *vp) return (EBUSY); } if (!VN_IS_DOOMED(vp)) { - counter_u64_add(recycles_count, 1); + counter_u64_add(recycles_free_count, 1); vgonel(vp); } VOP_UNLOCK(vp); From owner-svn-src-head@freebsd.org Tue Jan 7 15:44:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AD271EB438; Tue, 7 Jan 2020 15:44: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 47scBD2GRfz4GCM; Tue, 7 Jan 2020 15:44: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 492591298; Tue, 7 Jan 2020 15:44:20 +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 007FiKc3043391; Tue, 7 Jan 2020 15:44:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007FiK1r043390; Tue, 7 Jan 2020 15:44:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001071544.007FiK1r043390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 15:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356440 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:44:20 -0000 Author: mjg Date: Tue Jan 7 15:44:19 2020 New Revision: 356440 URL: https://svnweb.freebsd.org/changeset/base/356440 Log: vfs: trylock in vfs_msync and refactor the func - use LK_NOWAIT instead of calling VOP_ISLOCKED before deciding to lock - evaluate flags before looping over vnodes Reviewed by: kib Tested by: pho (in a larger patch, previous version) Differential Revision: https://reviews.freebsd.org/D23035 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 15:42:01 2020 (r356439) +++ head/sys/kern/vfs_subr.c Tue Jan 7 15:44:19 2020 (r356440) @@ -4390,36 +4390,39 @@ vfs_msync(struct mount *mp, int flags) { struct vnode *vp, *mvp; struct vm_object *obj; + struct thread *td; + int lkflags, objflags; CTR2(KTR_VFS, "%s: mp %p", __func__, mp); if ((mp->mnt_kern_flag & MNTK_NOMSYNC) != 0) return; + td = curthread; + + lkflags = LK_EXCLUSIVE | LK_INTERLOCK; + if (flags != MNT_WAIT) { + lkflags |= LK_NOWAIT; + objflags = OBJPC_NOSYNC; + } else { + objflags = OBJPC_SYNC; + } + MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { obj = vp->v_object; - if (obj != NULL && vm_object_mightbedirty(obj) && - (flags == MNT_WAIT || VOP_ISLOCKED(vp) == 0)) { - if (!vget(vp, - LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, - curthread)) { - if (vp->v_vflag & VV_NOSYNC) { /* unlinked */ - vput(vp); - continue; - } - - obj = vp->v_object; - if (obj != NULL) { - VM_OBJECT_WLOCK(obj); - vm_object_page_clean(obj, 0, 0, - flags == MNT_WAIT ? - OBJPC_SYNC : OBJPC_NOSYNC); - VM_OBJECT_WUNLOCK(obj); - } - vput(vp); - } - } else + if (obj == NULL || !vm_object_mightbedirty(obj)) { VI_UNLOCK(vp); + continue; + } + if (vget(vp, lkflags, td) == 0) { + obj = vp->v_object; + if (obj != NULL && (vp->v_vflag & VV_NOSYNC) == 0) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, objflags); + VM_OBJECT_WUNLOCK(obj); + } + vput(vp); + } } } From owner-svn-src-head@freebsd.org Tue Jan 7 15:56:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14A0B1EB7A2; Tue, 7 Jan 2020 15:56:27 +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 47scSB6dH8z4GhL; Tue, 7 Jan 2020 15:56:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1D331479; Tue, 7 Jan 2020 15:56:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007FuQrw049264; Tue, 7 Jan 2020 15:56:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007FuPCb049254; Tue, 7 Jan 2020 15:56:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001071556.007FuPCb049254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 15:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356441 - in head/sys: compat/linux geom/journal kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linux geom/journal kern sys X-SVN-Commit-Revision: 356441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:56:27 -0000 Author: mjg Date: Tue Jan 7 15:56:24 2020 New Revision: 356441 URL: https://svnweb.freebsd.org/changeset/base/356441 Log: vfs: reimplement deferred inactive to use a dedicated flag (VI_DEFINACT) The previous behavior of leaving VI_OWEINACT vnodes on the active list without a hold count is eliminated. Hold count is kept and inactive processing gets explicitly deferred by setting the VI_DEFINACT flag. The syncer is then responsible for vdrop. Reviewed by: kib (previous version) Tested by: pho (in a larger patch, previous version) Differential Revision: https://reviews.freebsd.org/D23036 Modified: head/sys/compat/linux/linux_stats.c head/sys/geom/journal/g_journal.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/sys/mount.h head/sys/sys/vnode.h Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/compat/linux/linux_stats.c Tue Jan 7 15:56:24 2020 (r356441) @@ -666,7 +666,7 @@ linux_syncfs(struct thread *td, struct linux_syncfs_ar if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { save = curthread_pflags_set(TDP_SYNCIO); - vfs_msync(mp, MNT_NOWAIT); + vfs_periodic(mp, MNT_NOWAIT); VFS_SYNC(mp, MNT_NOWAIT); curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/geom/journal/g_journal.c Tue Jan 7 15:56:24 2020 (r356441) @@ -2874,7 +2874,7 @@ g_journal_do_switch(struct g_class *classp) save = curthread_pflags_set(TDP_SYNCIO); GJ_TIMER_START(1, &bt); - vfs_msync(mp, MNT_NOWAIT); + vfs_periodic(mp, MNT_NOWAIT); GJ_TIMER_STOP(1, &bt, "Msync time of %s", mountpoint); GJ_TIMER_START(1, &bt); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/kern/vfs_mount.c Tue Jan 7 15:56:24 2020 (r356441) @@ -1692,7 +1692,7 @@ dounmount(struct mount *mp, int flags, struct thread * if (coveredvp != NULL) vdrop(coveredvp); - vfs_msync(mp, MNT_WAIT); + vfs_periodic(mp, MNT_WAIT); MNT_ILOCK(mp); async_flag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/kern/vfs_subr.c Tue Jan 7 15:56:24 2020 (r356441) @@ -217,10 +217,9 @@ static int reassignbufcalls; SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW | CTLFLAG_STATS, &reassignbufcalls, 0, "Number of calls to reassignbuf"); -static counter_u64_t free_owe_inact; -SYSCTL_COUNTER_U64(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact, - "Number of times free vnodes kept on active list due to VFS " - "owing inactivation"); +static counter_u64_t deferred_inact; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, deferred_inact, CTLFLAG_RD, &deferred_inact, + "Number of times inactive processing was deferred"); /* To keep more than one thread at a time from running vfs_getnewfsid */ static struct mtx mntid_mtx; @@ -608,7 +607,7 @@ vntblinit(void *dummy __unused) vnodes_created = counter_u64_alloc(M_WAITOK); recycles_count = counter_u64_alloc(M_WAITOK); recycles_free_count = counter_u64_alloc(M_WAITOK); - free_owe_inact = counter_u64_alloc(M_WAITOK); + deferred_inact = counter_u64_alloc(M_WAITOK); /* * Initialize the filesystem syncer. @@ -3012,6 +3011,39 @@ vrefcnt(struct vnode *vp) return (vp->v_usecount); } +static void +vdefer_inactive(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNASSERT(vp->v_iflag & VI_OWEINACT, vp, + ("%s: vnode without VI_OWEINACT", __func__)); + VNASSERT(!VN_IS_DOOMED(vp), vp, + ("%s: doomed vnode", __func__)); + if (vp->v_iflag & VI_DEFINACT) { + VNASSERT(vp->v_holdcnt > 1, vp, ("lost hold count")); + vdropl(vp); + return; + } + vp->v_iflag |= VI_DEFINACT; + VI_UNLOCK(vp); + counter_u64_add(deferred_inact, 1); +} + +static void +vdefer_inactive_cond(struct vnode *vp) +{ + + VI_LOCK(vp); + VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count")); + if (VN_IS_DOOMED(vp) || + (vp->v_iflag & VI_OWEINACT) == 0) { + vdropl(vp); + return; + } + vdefer_inactive(vp); +} + enum vputx_op { VPUTX_VRELE, VPUTX_VPUT, VPUTX_VUNREF }; /* @@ -3101,8 +3133,12 @@ vputx(struct vnode *vp, enum vputx_op func) vinactive(vp); if (func != VPUTX_VUNREF) VOP_UNLOCK(vp); + vdropl(vp); + } else if (vp->v_iflag & VI_OWEINACT) { + vdefer_inactive(vp); + } else { + vdropl(vp); } - vdropl(vp); } /* @@ -3257,28 +3293,27 @@ vdrop_deactivate(struct vnode *vp) ("vdrop: vnode already reclaimed.")); VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("vnode already free")); + VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, + ("vnode with VI_OWEINACT set")); + VNASSERT((vp->v_iflag & VI_DEFINACT) == 0, vp, + ("vnode with VI_DEFINACT set")); VNASSERT(vp->v_holdcnt == 0, vp, ("vdrop: freeing when we shouldn't")); - if ((vp->v_iflag & VI_OWEINACT) == 0) { - mp = vp->v_mount; - mtx_lock(&mp->mnt_listmtx); - if (vp->v_iflag & VI_ACTIVE) { - vp->v_iflag &= ~VI_ACTIVE; - TAILQ_REMOVE(&mp->mnt_activevnodelist, vp, v_actfreelist); - mp->mnt_activevnodelistsize--; - } - TAILQ_INSERT_TAIL(&mp->mnt_tmpfreevnodelist, vp, v_actfreelist); - mp->mnt_tmpfreevnodelistsize++; - vp->v_iflag |= VI_FREE; - vp->v_mflag |= VMP_TMPMNTFREELIST; - VI_UNLOCK(vp); - if (mp->mnt_tmpfreevnodelistsize >= mnt_free_list_batch) - vnlru_return_batch_locked(mp); - mtx_unlock(&mp->mnt_listmtx); - } else { - VI_UNLOCK(vp); - counter_u64_add(free_owe_inact, 1); + mp = vp->v_mount; + mtx_lock(&mp->mnt_listmtx); + if (vp->v_iflag & VI_ACTIVE) { + vp->v_iflag &= ~VI_ACTIVE; + TAILQ_REMOVE(&mp->mnt_activevnodelist, vp, v_actfreelist); + mp->mnt_activevnodelistsize--; } + TAILQ_INSERT_TAIL(&mp->mnt_tmpfreevnodelist, vp, v_actfreelist); + mp->mnt_tmpfreevnodelistsize++; + vp->v_iflag |= VI_FREE; + vp->v_mflag |= VMP_TMPMNTFREELIST; + VI_UNLOCK(vp); + if (mp->mnt_tmpfreevnodelistsize >= mnt_free_list_batch) + vnlru_return_batch_locked(mp); + mtx_unlock(&mp->mnt_listmtx); } void @@ -3629,7 +3664,17 @@ vgonel(struct vnode *vp) */ active = vp->v_usecount > 0; oweinact = (vp->v_iflag & VI_OWEINACT) != 0; - VI_UNLOCK(vp); + /* + * If we need to do inactive VI_OWEINACT will be set. + */ + if (vp->v_iflag & VI_DEFINACT) { + VNASSERT(vp->v_holdcnt > 1, vp, ("lost hold count")); + vp->v_iflag &= ~VI_DEFINACT; + vdropl(vp); + } else { + VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count")); + VI_UNLOCK(vp); + } vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); /* @@ -3823,8 +3868,10 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VI_DOINGINACT", sizeof(buf)); if (vp->v_iflag & VI_OWEINACT) strlcat(buf, "|VI_OWEINACT", sizeof(buf)); + if (vp->v_iflag & VI_DEFINACT) + strlcat(buf, "|VI_DEFINACT", sizeof(buf)); flags = vp->v_iflag & ~(VI_TEXT_REF | VI_MOUNT | VI_FREE | VI_ACTIVE | - VI_DOINGINACT | VI_OWEINACT); + VI_DOINGINACT | VI_OWEINACT | VI_DEFINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); @@ -4381,23 +4428,67 @@ vfs_unmountall(void) unmount_or_warn(rootdevmp); } -/* - * perform msync on all vnodes under a mount point - * the mount point must be locked. - */ -void -vfs_msync(struct mount *mp, int flags) +static void +vfs_deferred_inactive(struct vnode *vp, int lkflags) { + + ASSERT_VI_LOCKED(vp, __func__); + VNASSERT((vp->v_iflag & VI_DEFINACT) == 0, vp, ("VI_DEFINACT still set")); + if ((vp->v_iflag & VI_OWEINACT) == 0) { + vdropl(vp); + return; + } + if (vn_lock(vp, lkflags) == 0) { + VI_LOCK(vp); + if ((vp->v_iflag & (VI_OWEINACT | VI_DOINGINACT)) == VI_OWEINACT) + vinactive(vp); + VOP_UNLOCK(vp); + vdropl(vp); + return; + } + vdefer_inactive_cond(vp); +} + +static void __noinline +vfs_periodic_inactive(struct mount *mp, int flags) +{ struct vnode *vp, *mvp; + int lkflags; + + lkflags = LK_EXCLUSIVE | LK_INTERLOCK; + if (flags != MNT_WAIT) + lkflags |= LK_NOWAIT; + + MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { + if ((vp->v_iflag & VI_DEFINACT) == 0) { + VI_UNLOCK(vp); + continue; + } + vp->v_iflag &= ~VI_DEFINACT; + vfs_deferred_inactive(vp, lkflags); + } +} + +static inline bool +vfs_want_msync(struct vnode *vp) +{ struct vm_object *obj; + + if (vp->v_vflag & VV_NOSYNC) + return (false); + obj = vp->v_object; + return (obj != NULL && vm_object_mightbedirty(obj)); +} + +static void __noinline +vfs_periodic_msync_inactive(struct mount *mp, int flags) +{ + struct vnode *vp, *mvp; + struct vm_object *obj; struct thread *td; int lkflags, objflags; + bool seen_defer; - CTR2(KTR_VFS, "%s: mp %p", __func__, mp); - - if ((mp->mnt_kern_flag & MNTK_NOMSYNC) != 0) - return; - td = curthread; lkflags = LK_EXCLUSIVE | LK_INTERLOCK; @@ -4409,9 +4500,16 @@ vfs_msync(struct mount *mp, int flags) } MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { - obj = vp->v_object; - if (obj == NULL || !vm_object_mightbedirty(obj)) { - VI_UNLOCK(vp); + seen_defer = false; + if (vp->v_iflag & VI_DEFINACT) { + vp->v_iflag &= ~VI_DEFINACT; + seen_defer = true; + } + if (!vfs_want_msync(vp)) { + if (seen_defer) + vfs_deferred_inactive(vp, lkflags); + else + VI_UNLOCK(vp); continue; } if (vget(vp, lkflags, td) == 0) { @@ -4422,10 +4520,27 @@ vfs_msync(struct mount *mp, int flags) VM_OBJECT_WUNLOCK(obj); } vput(vp); + if (seen_defer) + vdrop(vp); + } else { + if (seen_defer) + vdefer_inactive_cond(vp); } } } +void +vfs_periodic(struct mount *mp, int flags) +{ + + CTR2(KTR_VFS, "%s: mp %p", __func__, mp); + + if ((mp->mnt_kern_flag & MNTK_NOMSYNC) != 0) + vfs_periodic_inactive(mp, flags); + else + vfs_periodic_msync_inactive(mp, flags); +} + static void destroy_vpollinfo_free(struct vpollinfo *vi) { @@ -4636,7 +4751,7 @@ sync_fsync(struct vop_fsync_args *ap) * batch. Return them instead of letting them stay there indefinitely. */ vnlru_return_batch(mp); - vfs_msync(mp, MNT_NOWAIT); + vfs_periodic(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/kern/vfs_syscalls.c Tue Jan 7 15:56:24 2020 (r356441) @@ -129,7 +129,7 @@ kern_sync(struct thread *td) if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { save = curthread_pflags_set(TDP_SYNCIO); - vfs_msync(mp, MNT_NOWAIT); + vfs_periodic(mp, MNT_NOWAIT); VFS_SYNC(mp, MNT_NOWAIT); curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/sys/mount.h Tue Jan 7 15:56:24 2020 (r356441) @@ -396,7 +396,7 @@ void __mnt_vnode_markerfree_active(struct vno #define MNTK_UNMOUNTF 0x00000001 /* forced unmount in progress */ #define MNTK_ASYNC 0x00000002 /* filtered async flag */ #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ -#define MNTK_NOMSYNC 0x00000008 /* don't do vfs_msync */ +#define MNTK_NOMSYNC 0x00000008 /* don't do msync */ #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ @@ -903,7 +903,7 @@ int vfs_setopts(struct vfsoptlist *opts, const char *n const char *value); int vfs_setpublicfs /* set publicly exported fs */ (struct mount *, struct netexport *, struct export_args *); -void vfs_msync(struct mount *, int); +void vfs_periodic(struct mount *, int); int vfs_busy(struct mount *, int); int vfs_export /* process mount export info */ (struct mount *, struct export_args *); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Jan 7 15:44:19 2020 (r356440) +++ head/sys/sys/vnode.h Tue Jan 7 15:56:24 2020 (r356441) @@ -242,6 +242,7 @@ struct xvnode { #define VI_ACTIVE 0x0200 /* This vnode is on the active list */ #define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ #define VI_OWEINACT 0x1000 /* Need to call inactive */ +#define VI_DEFINACT 0x2000 /* deferred inactive */ #define VV_ROOT 0x0001 /* root of its filesystem */ #define VV_ISTTY 0x0002 /* vnode represents a tty */ From owner-svn-src-head@freebsd.org Tue Jan 7 15:59:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E60131EB8F8; Tue, 7 Jan 2020 15:59:02 +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 47scWB5l08z4H19; Tue, 7 Jan 2020 15:59:02 +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 C01761480; Tue, 7 Jan 2020 15:59:02 +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 007Fx2C5049760; Tue, 7 Jan 2020 15:59:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007Fx2nw049759; Tue, 7 Jan 2020 15:59:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001071559.007Fx2nw049759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 15:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356442 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 356442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:59:03 -0000 Author: markj Date: Tue Jan 7 15:59:02 2020 New Revision: 356442 URL: https://svnweb.freebsd.org/changeset/base/356442 Log: Consistently use pmap_t instead of struct pmap *. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Jan 7 15:56:24 2020 (r356441) +++ head/sys/i386/i386/pmap.c Tue Jan 7 15:59:02 2020 (r356442) @@ -342,12 +342,10 @@ static void pmap_remove_pde(pmap_t pmap, pd_entry_t *p static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, struct spglist *free); static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); -static void pmap_remove_page(struct pmap *pmap, vm_offset_t va, - struct spglist *free); +static void pmap_remove_page(pmap_t pmap, vm_offset_t va, struct spglist *free); static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, struct spglist *free); -static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, - vm_offset_t va); +static void pmap_remove_entry(pmap_t pmap, vm_page_t m, vm_offset_t va); static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); From owner-svn-src-head@freebsd.org Tue Jan 7 15:59:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0BF51EB979; Tue, 7 Jan 2020 15:59:32 +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 47scWm67lMz4H7P; Tue, 7 Jan 2020 15:59:32 +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 CDEC01481; Tue, 7 Jan 2020 15:59:32 +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 007FxW80049827; Tue, 7 Jan 2020 15:59:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007FxWse049824; Tue, 7 Jan 2020 15:59:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001071559.007FxWse049824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 15:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356443 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 356443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:59:33 -0000 Author: markj Date: Tue Jan 7 15:59:31 2020 New Revision: 356443 URL: https://svnweb.freebsd.org/changeset/base/356443 Log: Define a unified pmap structure for i386. The overloading of struct pmap for PAE and non-PAE pmaps results in three distinct layouts for the structure, which is embedded in struct vmspace. This causes a large number of duplicate structure definitions in the i386 kernel's CTF type graph. Since most pmap fields are the same in the two pmaps, simply provide side-by-side variants of the fields that are distinct, using fixed-size types. PR: 242689 Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22896 Modified: head/sys/i386/i386/pmap.c head/sys/i386/i386/pmap_nopae.c head/sys/i386/i386/pmap_pae.c head/sys/i386/include/pmap.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap.c Tue Jan 7 15:59:31 2020 (r356443) @@ -216,9 +216,6 @@ __FBSDID("$FreeBSD$"); atomic_clear_int((u_int *)(pte), PG_W)) #define pmap_pte_set_prot(pte, v) ((*(int *)pte &= ~PG_PROT), (*(int *)pte |= (v))) -_Static_assert(sizeof(struct pmap) <= sizeof(struct pmap_KBI), - "pmap_KBI"); - static int pgeflag = 0; /* PG_G or-in */ static int pseflag = 0; /* PG_PS or-in */ Modified: head/sys/i386/i386/pmap_nopae.c ============================================================================== --- head/sys/i386/i386/pmap_nopae.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap_nopae.c Tue Jan 7 15:59:31 2020 (r356443) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #define PMTYPE pmap_nopae_ +#define pm_pdir pm_pdir_nopae #include #include -_Static_assert(sizeof(struct pmap_KBI) >= sizeof(struct pmap), "pmap KBI"); #include "pmap.c" Modified: head/sys/i386/i386/pmap_pae.c ============================================================================== --- head/sys/i386/i386/pmap_pae.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap_pae.c Tue Jan 7 15:59:31 2020 (r356443) @@ -43,7 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #define PMTYPE pmap_pae_ +#define pm_pdir pm_pdir_pae +#define pm_pdpt pm_pdpt_pae #include #include -_Static_assert(sizeof(struct pmap_KBI) >= sizeof(struct pmap), "pmap KBI"); #include "pmap.c" Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/include/pmap.h Tue Jan 7 15:59:31 2020 (r356443) @@ -166,30 +166,18 @@ struct md_page { int pat_mode; }; -#define PMAP_EXTERN_FIELDS \ - cpuset_t pm_active; /* active on cpus */ \ - struct mtx pm_mtx; \ - struct pmap_statistics pm_stats; /* pmap statistics */ - -struct pmap_KBI { - PMAP_EXTERN_FIELDS - int32_t pm_fill[32]; -}; - -#ifdef PMTYPE struct pmap { - PMAP_EXTERN_FIELDS - pd_entry_t *pm_pdir; /* KVA of page directory */ + cpuset_t pm_active; /* active on cpus */ + struct mtx pm_mtx; + struct pmap_statistics pm_stats; /* pmap statistics */ + uint32_t *pm_pdir_nopae; /* KVA of page directory */ + uint64_t *pm_pdir_pae; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ - pdpt_entry_t *pm_pdpt; /* KVA of page directory pointer - table */ + uint64_t *pm_pdpt_pae; struct vm_radix pm_root; /* spare page table pages */ - vm_page_t pm_ptdpg[NPGPTD]; + vm_page_t pm_ptdpg[4]; /* PAE NPGPTD */ }; -#else -#define pmap pmap_KBI -#endif typedef struct pmap *pmap_t; From owner-svn-src-head@freebsd.org Tue Jan 7 16:03:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21B911EBBC2; Tue, 7 Jan 2020 16:03:12 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47scc0049Rz4HWK; Tue, 7 Jan 2020 16:03:12 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1D28164B; Tue, 7 Jan 2020 16:03:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007G3BjI056080; Tue, 7 Jan 2020 16:03:11 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007G3B0S056079; Tue, 7 Jan 2020 16:03:11 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <202001071603.007G3B0S056079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 7 Jan 2020 16:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356444 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: rstone X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 356444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 16:03:12 -0000 Author: rstone Date: Tue Jan 7 16:03:11 2020 New Revision: 356444 URL: https://svnweb.freebsd.org/changeset/base/356444 Log: rtld: Fix segfault in direct exec mode When rtld is directly executed with arguments, it has to move the program arguments, environment and elf aux data up a few slots to remove its own arguments before the process being executed sees them. When copying the environment, rtld was incorrectly testing whether the location about to be written to currently contained NULL, when was supposed to check whether it had just copied the NULL terminator of the environment string. This had the result that the ELF aux data was mostly treated as environment variables, and rtld would quickly crash when it tried to access required ELF aux data that it didn't think was present. Differential Revision: https://reviews.freebsd.org/D23008 Reviewed by: kib MFC after: 1 month Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 7 15:59:31 2020 (r356443) +++ head/libexec/rtld-elf/rtld.c Tue Jan 7 16:03:11 2020 (r356444) @@ -514,12 +514,13 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr argv[i] = argv[i + rtld_argc]; *argcp -= rtld_argc; environ = env = envp = argv + main_argc + 1; + dbg("move env from %p to %p", envp + rtld_argc, envp); do { *envp = *(envp + rtld_argc); - envp++; - } while (*envp != NULL); + } while (*envp++ != NULL); aux = auxp = (Elf_Auxinfo *)envp; auxpf = (Elf_Auxinfo *)(envp + rtld_argc); + dbg("move aux from %p to %p", auxpf, aux); /* XXXKIB insert place for AT_EXECPATH if not present */ for (;; auxp++, auxpf++) { *auxp = *auxpf; From owner-svn-src-head@freebsd.org Tue Jan 7 16:07:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C81141EBC8C; Tue, 7 Jan 2020 16:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47schz4yf5z4Hk1; Tue, 7 Jan 2020 16:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 875CB1651; Tue, 7 Jan 2020 16:07:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007G7V8W056371; Tue, 7 Jan 2020 16:07:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007G7VBl056370; Tue, 7 Jan 2020 16:07:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001071607.007G7VBl056370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 16:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356445 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 356445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 16:07:31 -0000 Author: markj Date: Tue Jan 7 16:07:30 2020 New Revision: 356445 URL: https://svnweb.freebsd.org/changeset/base/356445 Log: Decrease logging severity when adding a device or reading config table. In PR 243056 a user reports some spam from smartpqi(4). In particular, the driver warns about an unrecognized PQI_CONF_TABLE_SECTION_SOFT_RESET section (not yet defined in the driver, but handled in Linux), but this doesn't cause any problems. The Linux driver also does not warn about unrecognized sections. Also do not log a warning when a device is added, since this is routine. Lower severity to DISC, to match pqisrc_remove_device(). PR: 243056 Reviewed by: sbruno MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23023 Modified: head/sys/dev/smartpqi/smartpqi_discovery.c head/sys/dev/smartpqi/smartpqi_init.c Modified: head/sys/dev/smartpqi/smartpqi_discovery.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_discovery.c Tue Jan 7 16:03:11 2020 (r356444) +++ head/sys/dev/smartpqi/smartpqi_discovery.c Tue Jan 7 16:07:30 2020 (r356445) @@ -1213,7 +1213,7 @@ static int pqisrc_add_device(pqisrc_softstate_t *softs pqi_scsi_dev_t *device) { DBG_FUNC("IN\n"); - DBG_WARN("vendor: %s model: %s bus:%d target:%d lun:%d is_physical_device:0x%x expose_device:0x%x volume_offline 0x%x volume_status 0x%x \n", + DBG_DISC("vendor: %s model: %s bus:%d target:%d lun:%d is_physical_device:0x%x expose_device:0x%x volume_offline 0x%x volume_status 0x%x \n", device->vendor, device->model, device->bus, device->target, device->lun, device->is_physical_device, device->expose_device, device->volume_offline, device->volume_status); device->invalid = false; Modified: head/sys/dev/smartpqi/smartpqi_init.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_init.c Tue Jan 7 16:03:11 2020 (r356444) +++ head/sys/dev/smartpqi/smartpqi_init.c Tue Jan 7 16:07:30 2020 (r356445) @@ -453,7 +453,7 @@ int pqisrc_process_config_table(pqisrc_softstate_t *so ret = PQI_STATUS_SUCCESS; break; default: - DBG_ERR("unrecognized PQI config table section ID: 0x%x\n", + DBG_INFO("unrecognized PQI config table section ID: 0x%x\n", LE_16(section_hdr->section_id)); break; } From owner-svn-src-head@freebsd.org Tue Jan 7 16:53:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D1621ECE9A; Tue, 7 Jan 2020 16:53:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sdkS2Hxtz4LbB; Tue, 7 Jan 2020 16:53:52 +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 49FF61F7D; Tue, 7 Jan 2020 16:53:52 +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 007GrqEP086401; Tue, 7 Jan 2020 16:53:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007GrqKo086400; Tue, 7 Jan 2020 16:53:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001071653.007GrqKo086400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Jan 2020 16:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356452 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 16:53:52 -0000 Author: jhb Date: Tue Jan 7 16:53:51 2020 New Revision: 356452 URL: https://svnweb.freebsd.org/changeset/base/356452 Log: Remove support for using GCC 4.2.1 from make tinderbox. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D23054 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jan 7 16:52:15 2020 (r356451) +++ head/Makefile Tue Jan 7 16:53:51 2020 (r356452) @@ -6,9 +6,7 @@ # universe - *Really* build *everything* (buildworld and # all kernels on all architectures). Define # MAKE_JUST_KERNELS to only build kernels, -# MAKE_JUST_WORLDS to only build userland, and/or -# MAKE_OBSOLETE_GCC to also build architectures -# unsupported by clang using in-tree gcc. +# MAKE_JUST_WORLDS to only build userland. # tinderbox - Same as universe, but presents a list of failed build # targets and exits with an error if there were any. # buildworld - Rebuild *everything*, including glue to help do @@ -490,8 +488,7 @@ worlds: .PHONY # In all cases, if the user specifies TARGETS on the command line, # honor that most of all. # -_OBSOLETE_GCC_TARGETS=mips sparc64 -TARGETS?=amd64 arm arm64 i386 powerpc riscv ${_OBSOLETE_GCC_TARGETS} +TARGETS?=amd64 arm arm64 i386 mips powerpc riscv sparc64 _UNIVERSE_TARGETS= ${TARGETS} TARGET_ARCHES_arm?= armv6 armv7 TARGET_ARCHES_arm64?= aarch64 @@ -505,21 +502,16 @@ TARGET_ARCHES_${target}?= ${target} .endfor MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc -.if !defined(MAKE_OBSOLETE_GCC) -OBSOLETE_GCC_TARGETS=${_OBSOLETE_GCC_TARGETS} MAKE_PARAMS_mips?= CROSS_TOOLCHAIN=mips-gcc6 MAKE_PARAMS_sparc64?= CROSS_TOOLCHAIN=sparc64-gcc6 -.endif TOOLCHAINS_mips= mips-gcc6 TOOLCHAINS_riscv= riscv64-gcc TOOLCHAINS_sparc64= sparc64-gcc6 # Remove architectures only supported by external toolchain from -# universe if required toolchain packages are missing. riscv requires -# an out-of-tree toolchain. When MAKE_OBSOLETE_GCC is not defined, -# the same logic appleis to the obsolete gcc targets. -.for target in riscv ${OBSOLETE_GCC_TARGETS} +# universe if required toolchain packages are missing. +.for target in mips riscv sparc64 .if ${_UNIVERSE_TARGETS:M${target}} .for toolchain in ${TOOLCHAINS_${target}} .if !exists(/usr/local/share/toolchains/${toolchain}.mk) From owner-svn-src-head@freebsd.org Tue Jan 7 17:07:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4B941ED41E; Tue, 7 Jan 2020 17:07: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 47sf2k6RFlz4Mfy; Tue, 7 Jan 2020 17:07: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 D58E6219B; Tue, 7 Jan 2020 17:07: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 007H7wwI092760; Tue, 7 Jan 2020 17:07:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007H7wsE092759; Tue, 7 Jan 2020 17:07:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001071707.007H7wsE092759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Jan 2020 17:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356457 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 356457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 17:07:59 -0000 Author: jhb Date: Tue Jan 7 17:07:58 2020 New Revision: 356457 URL: https://svnweb.freebsd.org/changeset/base/356457 Log: Various cleanups to cryptocheck. - Rename 'blkcipher' to 'cipher'. Some of the ciphers being tested are stream ciphers. - Rename 'authenc' to 'eta' as it is only testing ETA chained operations and not other combination modes. - Add a notion of an OCF session and some helper routines to try to reduce duplicated code. This also uses a single session for both encrypt and decrypt operations during a single test. - Add tests to ensure that AEAD algorithms fail decryption with EBADMSG when given a corrupted tag. - Remove the transitional hack for COP_F_CIPHER_FIRST. - Update block comment to mention plain hashes. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22940 Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Tue Jan 7 17:02:49 2020 (r356456) +++ head/tools/tools/crypto/cryptocheck.c Tue Jan 7 17:07:58 2020 (r356457) @@ -73,41 +73,50 @@ * * Supported algorithms: * all Run all tests - * hmac Run all hmac tests - * blkcipher Run all block cipher tests - * authenc Run all authenticated encryption tests + * hash Run all hash tests + * mac Run all mac tests + * cipher Run all cipher tests + * eta Run all encrypt-then-authenticate tests * aead Run all authenticated encryption with associated data * tests * - * HMACs: - * sha1 sha1 hmac - * sha256 256-bit sha2 hmac - * sha384 384-bit sha2 hmac - * sha512 512-bit sha2 hmac + * Hashes: + * sha1 SHA-1 + * sha224 224-bit SHA-2 + * sha256 256-bit SHA-2 + * sha384 384-bit SHA-2 + * sha512 512-bit SHA-2 * blake2b Blake2-B * blake2s Blake2-S * - * Block Ciphers: - * aes-cbc 128-bit aes cbc - * aes-cbc192 192-bit aes cbc - * aes-cbc256 256-bit aes cbc - * aes-ctr 128-bit aes ctr - * aes-ctr192 192-bit aes ctr - * aes-ctr256 256-bit aes ctr - * aes-xts 128-bit aes xts - * aes-xts256 256-bit aes xts + * MACs: + * sha1hmac SHA-1 HMAC + * sha224hmac 224-bit SHA-2 HMAC + * sha256hmac 256-bit SHA-2 HMAC + * sha384hmac 384-bit SHA-2 HMAC + * sha512hmac 512-bit SHA-2 HMAC + * + * Ciphers: + * aes-cbc 128-bit AES-CBC + * aes-cbc192 192-bit AES-CBC + * aes-cbc256 256-bit AES-CBC + * aes-ctr 128-bit AES-CTR + * aes-ctr192 192-bit AES-CTR + * aes-ctr256 256-bit AES-CTR + * aes-xts 128-bit AES-XTS + * aes-xts256 256-bit AES-XTS * chacha20 * - * Authenticated Encryption: - * + + * Encrypt then Authenticate: + * + * * Authenticated Encryption with Associated Data: - * aes-gcm 128-bit aes gcm - * aes-gcm192 192-bit aes gcm - * aes-gcm256 256-bit aes gcm - * aes-ccm 128-bit aes ccm - * aes-ccm192 192-bit aes ccm - * aes-ccm256 256-bit aes ccm + * aes-gcm 128-bit AES-GCM + * aes-gcm192 192-bit AES-GCM + * aes-gcm256 256-bit AES-GCM + * aes-ccm 128-bit AES-CCM + * aes-ccm192 192-bit AES-CCM + * aes-ccm256 256-bit AES-CCM */ #include @@ -126,16 +135,17 @@ #include -/* XXX: Temporary hack */ -#ifndef COP_F_CIPHER_FIRST -#define COP_F_CIPHER_FIRST 0x0001 /* Cipher before MAC. */ -#endif +struct ocf_session { + int fd; + int ses; + int crid; +}; -struct alg { +const struct alg { const char *name; int cipher; int mac; - enum { T_HASH, T_HMAC, T_BLKCIPHER, T_AUTHENC, T_GCM, T_CCM } type; + enum { T_HASH, T_HMAC, T_CIPHER, T_ETA, T_AEAD } type; const EVP_CIPHER *(*evp_cipher)(void); const EVP_MD *(*evp_md)(void); } algs[] = { @@ -163,41 +173,41 @@ struct alg { .evp_md = EVP_blake2b512 }, { .name = "blake2s", .mac = CRYPTO_BLAKE2S, .type = T_HASH, .evp_md = EVP_blake2s256 }, - { .name = "aes-cbc", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER, + { .name = "aes-cbc", .cipher = CRYPTO_AES_CBC, .type = T_CIPHER, .evp_cipher = EVP_aes_128_cbc }, - { .name = "aes-cbc192", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER, + { .name = "aes-cbc192", .cipher = CRYPTO_AES_CBC, .type = T_CIPHER, .evp_cipher = EVP_aes_192_cbc }, - { .name = "aes-cbc256", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER, + { .name = "aes-cbc256", .cipher = CRYPTO_AES_CBC, .type = T_CIPHER, .evp_cipher = EVP_aes_256_cbc }, - { .name = "aes-ctr", .cipher = CRYPTO_AES_ICM, .type = T_BLKCIPHER, + { .name = "aes-ctr", .cipher = CRYPTO_AES_ICM, .type = T_CIPHER, .evp_cipher = EVP_aes_128_ctr }, - { .name = "aes-ctr192", .cipher = CRYPTO_AES_ICM, .type = T_BLKCIPHER, + { .name = "aes-ctr192", .cipher = CRYPTO_AES_ICM, .type = T_CIPHER, .evp_cipher = EVP_aes_192_ctr }, - { .name = "aes-ctr256", .cipher = CRYPTO_AES_ICM, .type = T_BLKCIPHER, + { .name = "aes-ctr256", .cipher = CRYPTO_AES_ICM, .type = T_CIPHER, .evp_cipher = EVP_aes_256_ctr }, - { .name = "aes-xts", .cipher = CRYPTO_AES_XTS, .type = T_BLKCIPHER, + { .name = "aes-xts", .cipher = CRYPTO_AES_XTS, .type = T_CIPHER, .evp_cipher = EVP_aes_128_xts }, - { .name = "aes-xts256", .cipher = CRYPTO_AES_XTS, .type = T_BLKCIPHER, + { .name = "aes-xts256", .cipher = CRYPTO_AES_XTS, .type = T_CIPHER, .evp_cipher = EVP_aes_256_xts }, - { .name = "chacha20", .cipher = CRYPTO_CHACHA20, .type = T_BLKCIPHER, + { .name = "chacha20", .cipher = CRYPTO_CHACHA20, .type = T_CIPHER, .evp_cipher = EVP_chacha20 }, { .name = "aes-gcm", .cipher = CRYPTO_AES_NIST_GCM_16, - .mac = CRYPTO_AES_128_NIST_GMAC, .type = T_GCM, + .mac = CRYPTO_AES_128_NIST_GMAC, .type = T_AEAD, .evp_cipher = EVP_aes_128_gcm }, { .name = "aes-gcm192", .cipher = CRYPTO_AES_NIST_GCM_16, - .mac = CRYPTO_AES_192_NIST_GMAC, .type = T_GCM, + .mac = CRYPTO_AES_192_NIST_GMAC, .type = T_AEAD, .evp_cipher = EVP_aes_192_gcm }, { .name = "aes-gcm256", .cipher = CRYPTO_AES_NIST_GCM_16, - .mac = CRYPTO_AES_256_NIST_GMAC, .type = T_GCM, + .mac = CRYPTO_AES_256_NIST_GMAC, .type = T_AEAD, .evp_cipher = EVP_aes_256_gcm }, { .name = "aes-ccm", .cipher = CRYPTO_AES_CCM_16, - .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_CCM, + .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_AEAD, .evp_cipher = EVP_aes_128_ccm }, { .name = "aes-ccm192", .cipher = CRYPTO_AES_CCM_16, - .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_CCM, + .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_AEAD, .evp_cipher = EVP_aes_192_ccm }, { .name = "aes-ccm256", .cipher = CRYPTO_AES_CCM_16, - .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_CCM, + .mac = CRYPTO_AES_CCM_CBC_MAC, .type = T_AEAD, .evp_cipher = EVP_aes_256_ccm }, }; @@ -213,7 +223,7 @@ usage(void) exit(1); } -static struct alg * +static const struct alg * find_alg(const char *name) { u_int i; @@ -225,42 +235,49 @@ find_alg(const char *name) } static struct alg * -build_authenc(struct alg *cipher, struct alg *hmac) +build_eta(const struct alg *cipher, const struct alg *mac) { - static struct alg authenc; + struct alg *eta; char *name; - assert(cipher->type == T_BLKCIPHER); - assert(hmac->type == T_HMAC); - memset(&authenc, 0, sizeof(authenc)); - asprintf(&name, "%s+%s", cipher->name, hmac->name); - authenc.name = name; - authenc.cipher = cipher->cipher; - authenc.mac = hmac->mac; - authenc.type = T_AUTHENC; - authenc.evp_cipher = cipher->evp_cipher; - authenc.evp_md = hmac->evp_md; - return (&authenc); + assert(cipher->type == T_CIPHER); + assert(mac->type == T_HMAC); + eta = calloc(1, sizeof(*eta)); + asprintf(&name, "%s+%s", cipher->name, mac->name); + eta->name = name; + eta->cipher = cipher->cipher; + eta->mac = mac->mac; + eta->type = T_ETA; + eta->evp_cipher = cipher->evp_cipher; + eta->evp_md = mac->evp_md; + return (eta); } +static void +free_eta(struct alg *eta) +{ + free(__DECONST(char *, eta->name)); + free(eta); +} + static struct alg * -build_authenc_name(const char *name) +build_eta_name(const char *name) { - struct alg *cipher, *hmac; - const char *hmac_name; + const struct alg *cipher, *mac; + const char *mac_name; char *cp, *cipher_name; cp = strchr(name, '+'); cipher_name = strndup(name, cp - name); - hmac_name = cp + 1; + mac_name = cp + 1; cipher = find_alg(cipher_name); free(cipher_name); - if (cipher == NULL) + if (cipher == NULL || cipher->type != T_CIPHER) errx(1, "Invalid cipher %s", cipher_name); - hmac = find_alg(hmac_name); - if (hmac == NULL) - errx(1, "Invalid hash %s", hmac_name); - return (build_authenc(cipher, hmac)); + mac = find_alg(mac_name); + if (mac == NULL || mac->type != T_HMAC) + errx(1, "Invalid hmac %s", mac_name); + return (build_eta(cipher, mac)); } static int @@ -371,7 +388,7 @@ alloc_buffer(size_t len) } static char * -generate_iv(size_t len, struct alg *alg) +generate_iv(size_t len, const struct alg *alg) { char *iv; @@ -402,51 +419,93 @@ generate_iv(size_t len, struct alg *alg) return (iv); } +static void +ocf_init_sop(struct session2_op *sop) +{ + memset(sop, 0, sizeof(*sop)); + sop->crid = crid; +} + static bool -ocf_hash(struct alg *alg, const char *buffer, size_t size, char *digest, - int *cridp) +ocf_init_session(struct session2_op *sop, const char *type, const char *name, + struct ocf_session *ses) { - struct session2_op sop; - struct crypt_op cop; int fd; - memset(&sop, 0, sizeof(sop)); - memset(&cop, 0, sizeof(cop)); - sop.crid = crid; - sop.mac = alg->mac; fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s HASH not supported for device %s", - alg->name, crfind(crid)); + if (ioctl(fd, CIOCGSESSION2, sop) < 0) { + warn("cryptodev %s %s not supported for device %s", + type, name, crfind(crid)); close(fd); + ses->fd = -1; return (false); } + ses->fd = fd; + ses->ses = sop->ses; + ses->crid = sop->crid; + return (true); +} - cop.ses = sop.ses; +static void +ocf_destroy_session(struct ocf_session *ses) +{ + if (ses->fd == -1) + return; + + if (ioctl(ses->fd, CIOCFSESSION, &ses->ses) < 0) + warn("ioctl(CIOCFSESSION)"); + + close(ses->fd); +} + +static void +ocf_init_cop(const struct ocf_session *ses, struct crypt_op *cop) +{ + memset(cop, 0, sizeof(*cop)); + cop->ses = ses->ses; +} + +static void +ocf_init_caead(const struct ocf_session *ses, struct crypt_aead *caead) +{ + memset(caead, 0, sizeof(*caead)); + caead->ses = ses->ses; +} + +static bool +ocf_hash(const struct alg *alg, const char *buffer, size_t size, char *digest, + int *cridp) +{ + struct ocf_session ses; + struct session2_op sop; + struct crypt_op cop; + int error; + + ocf_init_sop(&sop); + sop.mac = alg->mac; + if (!ocf_init_session(&sop, "HASH", alg->name, &ses)) + return (false); + + ocf_init_cop(&ses, &cop); cop.op = 0; cop.len = size; cop.src = (char *)buffer; - cop.dst = NULL; cop.mac = digest; - cop.iv = NULL; - if (ioctl(fd, CIOCCRYPT, &cop) < 0) { + if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) HASH failed for device %s", alg->name, size, crfind(crid)); - close(fd); + ocf_destroy_session(&ses); return (false); } - if (ioctl(fd, CIOCFSESSION, &sop.ses) < 0) - warn("ioctl(CIOCFSESSION)"); - - close(fd); - *cridp = sop.crid; + *cridp = ses.crid; + ocf_destroy_session(&ses); return (true); } static void -openssl_hash(struct alg *alg, const EVP_MD *md, const void *buffer, +openssl_hash(const struct alg *alg, const EVP_MD *md, const void *buffer, size_t size, void *digest_out, unsigned *digest_sz_out) { EVP_MD_CTX *mdctx; @@ -480,7 +539,7 @@ err_out: } static void -run_hash_test(struct alg *alg, size_t size) +run_hash_test(const struct alg *alg, size_t size) { const EVP_MD *md; char *buffer; @@ -525,52 +584,40 @@ out: } static bool -ocf_hmac(struct alg *alg, const char *buffer, size_t size, const char *key, - size_t key_len, char *digest, int *cridp) +ocf_hmac(const struct alg *alg, const char *buffer, size_t size, + const char *key, size_t key_len, char *digest, int *cridp) { + struct ocf_session ses; struct session2_op sop; struct crypt_op cop; - int fd; - memset(&sop, 0, sizeof(sop)); - memset(&cop, 0, sizeof(cop)); - sop.crid = crid; + ocf_init_sop(&sop); sop.mackeylen = key_len; sop.mackey = (char *)key; sop.mac = alg->mac; - fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s HMAC not supported for device %s", - alg->name, crfind(crid)); - close(fd); + if (!ocf_init_session(&sop, "HMAC", alg->name, &ses)) return (false); - } - cop.ses = sop.ses; + ocf_init_cop(&ses, &cop); cop.op = 0; cop.len = size; cop.src = (char *)buffer; - cop.dst = NULL; cop.mac = digest; - cop.iv = NULL; - if (ioctl(fd, CIOCCRYPT, &cop) < 0) { + if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) HMAC failed for device %s", alg->name, size, crfind(crid)); - close(fd); + ocf_destroy_session(&ses); return (false); } - if (ioctl(fd, CIOCFSESSION, &sop.ses) < 0) - warn("ioctl(CIOCFSESSION)"); - - close(fd); - *cridp = sop.crid; + *cridp = ses.crid; + ocf_destroy_session(&ses); return (true); } static void -run_hmac_test(struct alg *alg, size_t size) +run_hmac_test(const struct alg *alg, size_t size) { const EVP_MD *md; char *key, *buffer; @@ -621,7 +668,7 @@ out: } static void -openssl_cipher(struct alg *alg, const EVP_CIPHER *cipher, const char *key, +openssl_cipher(const struct alg *alg, const EVP_CIPHER *cipher, const char *key, const char *iv, const char *input, char *output, size_t size, int enc) { EVP_CIPHER_CTX *ctx; @@ -652,59 +699,48 @@ openssl_cipher(struct alg *alg, const EVP_CIPHER *ciph } static bool -ocf_cipher(struct alg *alg, const char *key, size_t key_len, - const char *iv, const char *input, char *output, size_t size, int enc, - int *cridp) +ocf_init_cipher_session(const struct alg *alg, const char *key, size_t key_len, + struct ocf_session *ses) { struct session2_op sop; - struct crypt_op cop; - int fd; - memset(&sop, 0, sizeof(sop)); - memset(&cop, 0, sizeof(cop)); - sop.crid = crid; + ocf_init_sop(&sop); sop.keylen = key_len; sop.key = (char *)key; sop.cipher = alg->cipher; - fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s block cipher not supported for device %s", - alg->name, crfind(crid)); - close(fd); - return (false); - } + return (ocf_init_session(&sop, "cipher", alg->name, ses)); +} - cop.ses = sop.ses; - cop.op = enc ? COP_ENCRYPT : COP_DECRYPT; +static bool +ocf_cipher(const struct ocf_session *ses, const struct alg *alg, const char *iv, + const char *input, char *output, size_t size, int op) +{ + struct crypt_op cop; + + ocf_init_cop(ses, &cop); + cop.op = op; cop.len = size; cop.src = (char *)input; cop.dst = output; - cop.mac = NULL; cop.iv = (char *)iv; - if (ioctl(fd, CIOCCRYPT, &cop) < 0) { - warn("cryptodev %s (%zu) block cipher failed for device %s", + if (ioctl(ses->fd, CIOCCRYPT, &cop) < 0) { + warn("cryptodev %s (%zu) cipher failed for device %s", alg->name, size, crfind(crid)); - close(fd); return (false); } - if (ioctl(fd, CIOCFSESSION, &sop.ses) < 0) - warn("ioctl(CIOCFSESSION)"); - - close(fd); - *cridp = sop.crid; return (true); } static void -run_blkcipher_test(struct alg *alg, size_t size) +run_cipher_test(const struct alg *alg, size_t size) { + struct ocf_session ses; const EVP_CIPHER *cipher; char *buffer, *cleartext, *ciphertext; char *iv, *key; u_int iv_len, key_len; - int crid; cipher = alg->evp_cipher(); if (size % EVP_CIPHER_block_size(cipher) != 0) { @@ -739,37 +775,39 @@ run_blkcipher_test(struct alg *alg, size_t size) exit(1); } + if (!ocf_init_cipher_session(alg, key, key_len, &ses)) + goto out; + /* OCF encrypt. */ - if (!ocf_cipher(alg, key, key_len, iv, cleartext, buffer, size, 1, - &crid)) + if (!ocf_cipher(&ses, alg, iv, cleartext, buffer, size, COP_ENCRYPT)) goto out; if (memcmp(ciphertext, buffer, size) != 0) { printf("%s (%zu) encryption mismatch:\n", alg->name, size); printf("control:\n"); hexdump(ciphertext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer, size, NULL, 0); goto out; } /* OCF decrypt. */ - if (!ocf_cipher(alg, key, key_len, iv, ciphertext, buffer, size, 0, - &crid)) + if (!ocf_cipher(&ses, alg, iv, ciphertext, buffer, size, COP_DECRYPT)) goto out; if (memcmp(cleartext, buffer, size) != 0) { printf("%s (%zu) decryption mismatch:\n", alg->name, size); printf("control:\n"); hexdump(cleartext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer, size, NULL, 0); goto out; } if (verbose) printf("%s (%zu) matched (cryptodev device %s)\n", - alg->name, size, crfind(crid)); + alg->name, size, crfind(ses.crid)); out: + ocf_destroy_session(&ses); free(ciphertext); free(buffer); free(cleartext); @@ -778,37 +816,35 @@ out: } static bool -ocf_authenc(struct alg *alg, const char *cipher_key, size_t cipher_key_len, - const char *iv, size_t iv_len, const char *auth_key, size_t auth_key_len, - const char *aad, size_t aad_len, const char *input, char *output, - size_t size, char *digest, int enc, int *cridp) +ocf_init_eta_session(const struct alg *alg, const char *cipher_key, + size_t cipher_key_len, const char *auth_key, size_t auth_key_len, + struct ocf_session *ses) { struct session2_op sop; - int fd; - memset(&sop, 0, sizeof(sop)); - sop.crid = crid; + ocf_init_sop(&sop); sop.keylen = cipher_key_len; sop.key = (char *)cipher_key; sop.cipher = alg->cipher; sop.mackeylen = auth_key_len; sop.mackey = (char *)auth_key; sop.mac = alg->mac; - fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s AUTHENC not supported for device %s", - alg->name, crfind(crid)); - close(fd); - return (false); - } + return (ocf_init_session(&sop, "ETA", alg->name, ses)); +} +static bool +ocf_eta(const struct ocf_session *ses, const struct alg *alg, const char *iv, + size_t iv_len, const char *aad, size_t aad_len, const char *input, + char *output, size_t size, char *digest, int op) +{ + int ret; + if (aad_len != 0) { struct crypt_aead caead; - memset(&caead, 0, sizeof(caead)); - caead.ses = sop.ses; - caead.op = enc ? COP_ENCRYPT : COP_DECRYPT; - caead.flags = enc ? COP_F_CIPHER_FIRST : 0; + ocf_init_caead(ses, &caead); + caead.op = op; + caead.flags = op == COP_ENCRYPT ? COP_F_CIPHER_FIRST : 0; caead.len = size; caead.aadlen = aad_len; caead.ivlen = iv_len; @@ -818,50 +854,40 @@ ocf_authenc(struct alg *alg, const char *cipher_key, s caead.tag = digest; caead.iv = (char *)iv; - if (ioctl(fd, CIOCCRYPTAEAD, &caead) < 0) { - warn("cryptodev %s (%zu) failed for device %s", - alg->name, size, crfind(crid)); - close(fd); - return (false); - } + ret = ioctl(ses->fd, CIOCCRYPTAEAD, &caead); } else { struct crypt_op cop; - memset(&cop, 0, sizeof(cop)); - cop.ses = sop.ses; - cop.op = enc ? COP_ENCRYPT : COP_DECRYPT; - cop.flags = enc ? COP_F_CIPHER_FIRST : 0; + ocf_init_cop(ses, &cop); + cop.op = op; + cop.flags = op == COP_ENCRYPT ? COP_F_CIPHER_FIRST : 0; cop.len = size; cop.src = (char *)input; cop.dst = output; cop.mac = digest; cop.iv = (char *)iv; - if (ioctl(fd, CIOCCRYPT, &cop) < 0) { - warn("cryptodev %s (%zu) AUTHENC failed for device %s", - alg->name, size, crfind(crid)); - close(fd); - return (false); - } + ret = ioctl(ses->fd, CIOCCRYPT, &cop); } - if (ioctl(fd, CIOCFSESSION, &sop.ses) < 0) - warn("ioctl(CIOCFSESSION)"); + if (ret < 0) { + warn("cryptodev %s (%zu) ETA failed for device %s", + alg->name, size, crfind(crid)); + return (false); + } - close(fd); - *cridp = sop.crid; return (true); } static void -run_authenc_test(struct alg *alg, size_t size) +run_eta_test(const struct alg *alg, size_t size) { + struct ocf_session ses; const EVP_CIPHER *cipher; const EVP_MD *md; char *aad, *buffer, *cleartext, *ciphertext; char *iv, *auth_key, *cipher_key; - u_int iv_len, auth_key_len, cipher_key_len, digest_len; - int crid; + u_int i, iv_len, auth_key_len, cipher_key_len, digest_len; char control_digest[EVP_MAX_MD_SIZE], test_digest[EVP_MAX_MD_SIZE]; cipher = alg->evp_cipher(); @@ -904,16 +930,20 @@ run_authenc_test(struct alg *alg, size_t size) errx(1, "OpenSSL %s (%zu) HMAC failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); + if (!ocf_init_eta_session(alg, cipher_key, cipher_key_len, auth_key, + auth_key_len, &ses)) + goto out; + /* OCF encrypt + HMAC. */ - if (!ocf_authenc(alg, cipher_key, cipher_key_len, iv, iv_len, auth_key, - auth_key_len, aad_len != 0 ? cleartext : NULL, aad_len, - cleartext + aad_len, buffer + aad_len, size, test_digest, 1, &crid)) + if (!ocf_eta(&ses, alg, iv, iv_len, + aad_len != 0 ? cleartext : NULL, aad_len, cleartext + aad_len, + buffer + aad_len, size, test_digest, COP_ENCRYPT)) goto out; if (memcmp(ciphertext + aad_len, buffer + aad_len, size) != 0) { printf("%s (%zu) encryption mismatch:\n", alg->name, size); printf("control:\n"); hexdump(ciphertext + aad_len, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer + aad_len, size, NULL, 0); goto out; } @@ -926,45 +956,31 @@ run_authenc_test(struct alg *alg, size_t size) size); printf("control:\n"); hexdump(control_digest, sizeof(control_digest), NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(test_digest, sizeof(test_digest), NULL, 0); goto out; } /* OCF HMAC + decrypt. */ - memset(test_digest, 0x3c, sizeof(test_digest)); - if (!ocf_authenc(alg, cipher_key, cipher_key_len, iv, iv_len, auth_key, - auth_key_len, aad_len != 0 ? ciphertext : NULL, aad_len, - ciphertext + aad_len, buffer + aad_len, size, test_digest, 0, - &crid)) + if (!ocf_eta(&ses, alg, iv, iv_len, + aad_len != 0 ? ciphertext : NULL, aad_len, ciphertext + aad_len, + buffer + aad_len, size, test_digest, COP_DECRYPT)) goto out; - if (memcmp(control_digest, test_digest, sizeof(control_digest)) != 0) { - if (memcmp(control_digest, test_digest, EVP_MD_size(md)) == 0) - printf("%s (%zu) dec hash mismatch in trailer:\n", - alg->name, size); - else - printf("%s (%zu) dec hash mismatch:\n", alg->name, - size); - printf("control:\n"); - hexdump(control_digest, sizeof(control_digest), NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); - hexdump(test_digest, sizeof(test_digest), NULL, 0); - goto out; - } if (memcmp(cleartext + aad_len, buffer + aad_len, size) != 0) { printf("%s (%zu) decryption mismatch:\n", alg->name, size); printf("control:\n"); hexdump(cleartext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer, size, NULL, 0); goto out; } if (verbose) printf("%s (%zu) matched (cryptodev device %s)\n", - alg->name, size, crfind(crid)); + alg->name, size, crfind(ses.crid)); out: + ocf_destroy_session(&ses); free(ciphertext); free(buffer); free(cleartext); @@ -974,9 +990,9 @@ out: } static void -openssl_gcm_encrypt(struct alg *alg, const EVP_CIPHER *cipher, const char *key, - const char *iv, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *tag) +openssl_gcm_encrypt(const struct alg *alg, const EVP_CIPHER *cipher, + const char *key, const char *iv, const char *aad, size_t aad_len, + const char *input, char *output, size_t size, char *tag) { EVP_CIPHER_CTX *ctx; int outl, total; @@ -1016,63 +1032,11 @@ openssl_gcm_encrypt(struct alg *alg, const EVP_CIPHER EVP_CIPHER_CTX_free(ctx); } -static bool -ocf_gcm(struct alg *alg, const char *key, size_t key_len, const char *iv, - size_t iv_len, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *tag, int enc, int *cridp) -{ - struct session2_op sop; - struct crypt_aead caead; - int fd; - - memset(&sop, 0, sizeof(sop)); - memset(&caead, 0, sizeof(caead)); - sop.crid = crid; - sop.keylen = key_len; - sop.key = (char *)key; - sop.cipher = alg->cipher; - sop.mackeylen = key_len; - sop.mackey = (char *)key; - sop.mac = alg->mac; - fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s not supported for device %s", - alg->name, crfind(crid)); - close(fd); - return (false); - } - - caead.ses = sop.ses; - caead.op = enc ? COP_ENCRYPT : COP_DECRYPT; - caead.len = size; - caead.aadlen = aad_len; - caead.ivlen = iv_len; - caead.src = (char *)input; - caead.dst = output; - caead.aad = (char *)aad; - caead.tag = tag; - caead.iv = (char *)iv; - - if (ioctl(fd, CIOCCRYPTAEAD, &caead) < 0) { - warn("cryptodev %s (%zu) failed for device %s", - alg->name, size, crfind(crid)); - close(fd); - return (false); - } - - if (ioctl(fd, CIOCFSESSION, &sop.ses) < 0) - warn("ioctl(CIOCFSESSION)"); - - close(fd); - *cridp = sop.crid; - return (true); -} - #ifdef notused static bool -openssl_gcm_decrypt(struct alg *alg, const EVP_CIPHER *cipher, const char *key, - const char *iv, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *tag) +openssl_gcm_decrypt(const struct alg *alg, const EVP_CIPHER *cipher, + const char *key, const char *iv, const char *aad, size_t aad_len, + const char *input, char *output, size_t size, char *tag) { EVP_CIPHER_CTX *ctx; int outl, total; @@ -1114,96 +1078,10 @@ openssl_gcm_decrypt(struct alg *alg, const EVP_CIPHER #endif static void -run_gcm_test(struct alg *alg, size_t size) +openssl_ccm_encrypt(const struct alg *alg, const EVP_CIPHER *cipher, + const char *key, const char *iv, size_t iv_len, const char *aad, + size_t aad_len, const char *input, char *output, size_t size, char *tag) { - const EVP_CIPHER *cipher; - char *aad, *buffer, *cleartext, *ciphertext; - char *iv, *key; - u_int iv_len, key_len; - int crid; - char control_tag[AES_GMAC_HASH_LEN], test_tag[AES_GMAC_HASH_LEN]; - - cipher = alg->evp_cipher(); - if (size % EVP_CIPHER_block_size(cipher) != 0) { - if (verbose) - printf( - "%s (%zu): invalid buffer size (block size %d)\n", - alg->name, size, EVP_CIPHER_block_size(cipher)); - return; - } - - memset(control_tag, 0x3c, sizeof(control_tag)); - memset(test_tag, 0x3c, sizeof(test_tag)); - - key_len = EVP_CIPHER_key_length(cipher); - iv_len = EVP_CIPHER_iv_length(cipher); - - key = alloc_buffer(key_len); - iv = generate_iv(iv_len, alg); - cleartext = alloc_buffer(size); - buffer = malloc(size); - ciphertext = malloc(size); - if (aad_len != 0) - aad = alloc_buffer(aad_len); - else - aad = NULL; - - /* OpenSSL encrypt */ - openssl_gcm_encrypt(alg, cipher, key, iv, aad, aad_len, cleartext, - ciphertext, size, control_tag); - - /* OCF encrypt */ - if (!ocf_gcm(alg, key, key_len, iv, iv_len, aad, aad_len, cleartext, - buffer, size, test_tag, 1, &crid)) - goto out; - if (memcmp(ciphertext, buffer, size) != 0) { - printf("%s (%zu) encryption mismatch:\n", alg->name, size); - printf("control:\n"); - hexdump(ciphertext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); - hexdump(buffer, size, NULL, 0); - goto out; - } - if (memcmp(control_tag, test_tag, sizeof(control_tag)) != 0) { - printf("%s (%zu) enc tag mismatch:\n", alg->name, size); - printf("control:\n"); - hexdump(control_tag, sizeof(control_tag), NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); - hexdump(test_tag, sizeof(test_tag), NULL, 0); - goto out; - } - - /* OCF decrypt */ - if (!ocf_gcm(alg, key, key_len, iv, iv_len, aad, aad_len, ciphertext, - buffer, size, control_tag, 0, &crid)) - goto out; - if (memcmp(cleartext, buffer, size) != 0) { - printf("%s (%zu) decryption mismatch:\n", alg->name, size); - printf("control:\n"); - hexdump(cleartext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); - hexdump(buffer, size, NULL, 0); - goto out; - } - - if (verbose) - printf("%s (%zu) matched (cryptodev device %s)\n", - alg->name, size, crfind(crid)); - -out: - free(aad); - free(ciphertext); - free(buffer); - free(cleartext); - free(iv); - free(key); -} - -static void -openssl_ccm_encrypt(struct alg *alg, const EVP_CIPHER *cipher, const char *key, - const char *iv, size_t iv_len, const char *aad, size_t aad_len, - const char *input, char *output, size_t size, char *tag) -{ EVP_CIPHER_CTX *ctx; int outl, total; @@ -1255,34 +1133,30 @@ openssl_ccm_encrypt(struct alg *alg, const EVP_CIPHER } static bool -ocf_ccm(struct alg *alg, const char *key, size_t key_len, const char *iv, - size_t iv_len, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *tag, int enc, int *cridp) +ocf_init_aead_session(const struct alg *alg, const char *key, size_t key_len, + struct ocf_session *ses) { struct session2_op sop; - struct crypt_aead caead; - int fd; - bool rv; - memset(&sop, 0, sizeof(sop)); - memset(&caead, 0, sizeof(caead)); - sop.crid = crid; + ocf_init_sop(&sop); sop.keylen = key_len; sop.key = (char *)key; sop.cipher = alg->cipher; sop.mackeylen = key_len; sop.mackey = (char *)key; sop.mac = alg->mac; - fd = crget(); - if (ioctl(fd, CIOCGSESSION2, &sop) < 0) { - warn("cryptodev %s not supported for device %s", - alg->name, crfind(crid)); - close(fd); - return (false); - } + return (ocf_init_session(&sop, "AEAD", alg->name, ses)); +} - caead.ses = sop.ses; - caead.op = enc ? COP_ENCRYPT : COP_DECRYPT; +static int +ocf_aead(const struct ocf_session *ses, const struct alg *alg, const char *iv, + size_t iv_len, const char *aad, size_t aad_len, const char *input, + char *output, size_t size, char *tag, int op) +{ + struct crypt_aead caead; + + ocf_init_caead(ses, &caead); + caead.op = op; caead.len = size; caead.aadlen = aad_len; caead.ivlen = iv_len; @@ -1292,30 +1166,23 @@ ocf_ccm(struct alg *alg, const char *key, size_t key_l caead.tag = tag; caead.iv = (char *)iv; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 7 17:49:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34B3D1EDEDE; Tue, 7 Jan 2020 17:49: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 47sfz20Zqtz4PMJ; Tue, 7 Jan 2020 17:49: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 0F356292B; Tue, 7 Jan 2020 17:49: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 007Hnn9u017736; Tue, 7 Jan 2020 17:49:49 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007Hnn3M017735; Tue, 7 Jan 2020 17:49:49 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202001071749.007Hnn3M017735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 7 Jan 2020 17:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356458 - head/tests/sys/geom/class/multipath X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 356458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 17:49:50 -0000 Author: lwhsu Date: Tue Jan 7 17:49:49 2020 New Revision: 356458 URL: https://svnweb.freebsd.org/changeset/base/356458 Log: Revert r355861 because the issue has been fixed in r356443 PR: 242689 Notified by: markj Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/multipath/failloop.sh Modified: head/tests/sys/geom/class/multipath/failloop.sh ============================================================================== --- head/tests/sys/geom/class/multipath/failloop.sh Tue Jan 7 17:07:58 2020 (r356457) +++ head/tests/sys/geom/class/multipath/failloop.sh Tue Jan 7 17:49:49 2020 (r356458) @@ -36,11 +36,6 @@ failloop_head() } failloop_body() { - if [ "$(atf_config_get ci false)" = "true" ] && \ - [ "$(uname -p)" = "i386" ]; then - atf_skip "https://bugs.freebsd.org/242689" - fi - sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath From owner-svn-src-head@freebsd.org Tue Jan 7 17:57:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAFA01EE34D; Tue, 7 Jan 2020 17:57:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sg7S5VDNz4PvG; Tue, 7 Jan 2020 17:57:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B72512AF8; Tue, 7 Jan 2020 17:57:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007Hv8Em023403; Tue, 7 Jan 2020 17:57:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007Hv86w023402; Tue, 7 Jan 2020 17:57:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001071757.007Hv86w023402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 7 Jan 2020 17:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356459 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 356459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 17:57:08 -0000 Author: emaste Date: Tue Jan 7 17:57:08 2020 New Revision: 356459 URL: https://svnweb.freebsd.org/changeset/base/356459 Log: Do not define TCPOUTFLAGS in rack_bbr_common tcp_outflags isn't used in this source file and compilation failed with external GCC on sparc64. I'm not sure why only that case failed (perhaps inconsistent -Werror config) but it is a legitimate issue to fix. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D23068 Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Jan 7 17:49:49 2020 (r356458) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Jan 7 17:57:08 2020 (r356459) @@ -91,7 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include From owner-svn-src-head@freebsd.org Tue Jan 7 19:49:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2246B1F0F27; Tue, 7 Jan 2020 19:49:32 +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 47sjd80B5zz4XFs; Tue, 7 Jan 2020 19:49:32 +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 014BE4222; Tue, 7 Jan 2020 19:49:32 +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 007JnVcX091523; Tue, 7 Jan 2020 19:49:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007JnV2Q091522; Tue, 7 Jan 2020 19:49:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001071949.007JnV2Q091522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Jan 2020 19:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356463 - head/gnu/lib/libssp X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/gnu/lib/libssp X-SVN-Commit-Revision: 356463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 19:49:32 -0000 Author: kevans Date: Tue Jan 7 19:49:31 2020 New Revision: 356463 URL: https://svnweb.freebsd.org/changeset/base/356463 Log: Remove gcclibs libssp build glue r356356 started providing libssp based on ^/lib/libc/secure and disconnected this version from the build. This one did formally provide runtime support for _FORTIFY_SOURCE, but FreeBSD lacks the build support that would have been needed to take advantage of it. MFC after: never Deleted: head/gnu/lib/libssp/ From owner-svn-src-head@freebsd.org Tue Jan 7 20:24:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24FA11F1E3C; Tue, 7 Jan 2020 20:24: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 47skPL06Yyz4Zk8; Tue, 7 Jan 2020 20:24:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3293498C; Tue, 7 Jan 2020 20:24:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007KOLdg015985; Tue, 7 Jan 2020 20:24:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007KOLna015984; Tue, 7 Jan 2020 20:24:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001072024.007KOLna015984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 7 Jan 2020 20:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356470 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 20:24:22 -0000 Author: mjg Date: Tue Jan 7 20:24:21 2020 New Revision: 356470 URL: https://svnweb.freebsd.org/changeset/base/356470 Log: vfs: handle doomed vnodes in vdefer_inactive vgone dooms the vnode while keeping VI_OWEINACT set and then drops the interlock. vputx can pick up the interlock and pass it to vdefer_inactive since the flag is set. The race is harmless, just don't defer anything as vgone will take care of it. Reported by: pho Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 7 20:13:31 2020 (r356469) +++ head/sys/kern/vfs_subr.c Tue Jan 7 20:24:21 2020 (r356470) @@ -3018,8 +3018,10 @@ vdefer_inactive(struct vnode *vp) ASSERT_VI_LOCKED(vp, __func__); VNASSERT(vp->v_iflag & VI_OWEINACT, vp, ("%s: vnode without VI_OWEINACT", __func__)); - VNASSERT(!VN_IS_DOOMED(vp), vp, - ("%s: doomed vnode", __func__)); + if (VN_IS_DOOMED(vp)) { + vdropl(vp); + return; + } if (vp->v_iflag & VI_DEFINACT) { VNASSERT(vp->v_holdcnt > 1, vp, ("lost hold count")); vdropl(vp); @@ -3036,8 +3038,7 @@ vdefer_inactive_cond(struct vnode *vp) VI_LOCK(vp); VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count")); - if (VN_IS_DOOMED(vp) || - (vp->v_iflag & VI_OWEINACT) == 0) { + if ((vp->v_iflag & VI_OWEINACT) == 0) { vdropl(vp); return; } From owner-svn-src-head@freebsd.org Tue Jan 7 21:13:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72AB41F2D97; Tue, 7 Jan 2020 21:13:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47slV72SYqz4dqQ; Tue, 7 Jan 2020 21:13:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FBE152E8; Tue, 7 Jan 2020 21:13:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007LDZYl045648; Tue, 7 Jan 2020 21:13:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LDZUK045647; Tue, 7 Jan 2020 21:13:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001072113.007LDZUK045647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 7 Jan 2020 21:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356472 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 356472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:13:35 -0000 Author: ian Date: Tue Jan 7 21:13:34 2020 New Revision: 356472 URL: https://svnweb.freebsd.org/changeset/base/356472 Log: Add #ifdef option-test wrappers around another call to an arm/unwind.c function which is only compiled-in with certain options. Why is it always the most trivial part of a big commit that takes 3 tries to get right? Modified: head/sys/arm/arm/elf_machdep.c Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Tue Jan 7 20:35:43 2020 (r356471) +++ head/sys/arm/arm/elf_machdep.c Tue Jan 7 21:13:34 2020 (r356472) @@ -337,7 +337,9 @@ int elf_cpu_unload_file(linker_file_t lf) { +#if defined(DDB) || defined(KDTRACE_HOOKS) || defined(STACK) /* Inform the stack(9) code that this module is gone. */ unwind_module_unloaded(lf); +#endif return (0); } From owner-svn-src-head@freebsd.org Tue Jan 7 21:16:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30B911F2F8A; Tue, 7 Jan 2020 21:16:32 +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 47slYX1DlTz4f4L; Tue, 7 Jan 2020 21:16:32 +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 2134C52E9; Tue, 7 Jan 2020 21:16:32 +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 007LGWqC045835; Tue, 7 Jan 2020 21:16:32 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LGU6C045827; Tue, 7 Jan 2020 21:16:30 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001072116.007LGU6C045827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 7 Jan 2020 21:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356473 - in head: sys/net sys/netinet6 tests/sys/net/routing X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sys/net sys/netinet6 tests/sys/net/routing X-SVN-Commit-Revision: 356473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:16:32 -0000 Author: melifaro Date: Tue Jan 7 21:16:30 2020 New Revision: 356473 URL: https://svnweb.freebsd.org/changeset/base/356473 Log: Fix rtsock route message generation for interface addresses. Reviewed by: olivier MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22974 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet6/in6.c head/sys/netinet6/nd6_rtr.c head/tests/sys/net/routing/rtsock_common.h head/tests/sys/net/routing/rtsock_print.h head/tests/sys/net/routing/test_rtsock_l3.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jan 7 21:13:34 2020 (r356472) +++ head/sys/net/route.c Tue Jan 7 21:16:30 2020 (r356473) @@ -2147,7 +2147,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi #endif RT_ADDREF(rt); RT_UNLOCK(rt); - rt_newaddrmsg_fib(cmd, ifa, error, rt, fibnum); + rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); RT_LOCK(rt); RT_REMREF(rt); if (cmd == RTM_DELETE) { @@ -2233,17 +2233,16 @@ rt_addrmsg(int cmd, struct ifaddr *ifa, int fibnum) } /* - * Announce route addition/removal. - * Users of this function MUST validate input data BEFORE calling. - * However we have to be able to handle invalid data: - * if some userland app sends us "invalid" route message (invalid mask, - * no dst, wrong address families, etc...) we need to pass it back - * to app (and any other rtsock consumers) with rtm_errno field set to - * non-zero value. + * Announce kernel-originated route addition/removal to rtsock based on @rt data. + * cmd: RTM_ cmd + * @rt: valid rtentry + * @ifp: target route interface + * @fibnum: fib id or RT_ALL_FIBS + * * Returns 0 on success. */ int -rt_routemsg(int cmd, struct ifnet *ifp, int error, struct rtentry *rt, +rt_routemsg(int cmd, struct rtentry *rt, struct ifnet *ifp, int rti_addrs, int fibnum) { @@ -2255,23 +2254,39 @@ rt_routemsg(int cmd, struct ifnet *ifp, int error, str KASSERT(rt_key(rt) != NULL, (":%s: rt_key must be supplied", __func__)); - return (rtsock_routemsg(cmd, ifp, error, rt, fibnum)); + return (rtsock_routemsg(cmd, rt, ifp, 0, fibnum)); } -void -rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) +/* + * Announce kernel-originated route addition/removal to rtsock based on @rt data. + * cmd: RTM_ cmd + * @info: addrinfo structure with valid data. + * @fibnum: fib id or RT_ALL_FIBS + * + * Returns 0 on success. + */ +int +rt_routemsg_info(int cmd, struct rt_addrinfo *info, int fibnum) { - rt_newaddrmsg_fib(cmd, ifa, error, rt, RT_ALL_FIBS); + KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE || cmd == RTM_CHANGE, + ("unexpected cmd %d", cmd)); + + KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), + ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); + + KASSERT(info->rti_info[RTAX_DST] != NULL, (":%s: RTAX_DST must be supplied", __func__)); + + return (rtsock_routemsg_info(cmd, info, fibnum)); } + /* * This is called to generate messages from the routing socket * indicating a network interface has had addresses associated with it. */ void -rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt, - int fibnum) +rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, struct rtentry *rt, int fibnum) { KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE, @@ -2282,10 +2297,10 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, int err if (cmd == RTM_ADD) { rt_addrmsg(cmd, ifa, fibnum); if (rt != NULL) - rt_routemsg(cmd, ifa->ifa_ifp, error, rt, fibnum); + rt_routemsg(cmd, rt, ifa->ifa_ifp, 0, fibnum); } else { if (rt != NULL) - rt_routemsg(cmd, ifa->ifa_ifp, error, rt, fibnum); + rt_routemsg(cmd, rt, ifa->ifa_ifp, 0, fibnum); rt_addrmsg(cmd, ifa, fibnum); } } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Jan 7 21:13:34 2020 (r356472) +++ head/sys/net/route.h Tue Jan 7 21:16:30 2020 (r356473) @@ -448,10 +448,10 @@ void rt_ifannouncemsg(struct ifnet *, int); void rt_ifmsg(struct ifnet *); void rt_missmsg(int, struct rt_addrinfo *, int, int); void rt_missmsg_fib(int, struct rt_addrinfo *, int, int, int); -void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); -void rt_newaddrmsg_fib(int, struct ifaddr *, int, struct rtentry *, int); +void rt_newaddrmsg_fib(int, struct ifaddr *, struct rtentry *, int); int rt_addrmsg(int, struct ifaddr *, int); -int rt_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); +int rt_routemsg(int, struct rtentry *, struct ifnet *ifp, int, int); +int rt_routemsg_info(int, struct rt_addrinfo *, int); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); @@ -460,7 +460,8 @@ void rt_table_destroy(struct rib_head *); u_int rt_tables_get_gen(int table, int fam); int rtsock_addrmsg(int, struct ifaddr *, int); -int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); +int rtsock_routemsg(int, struct rtentry *, struct ifnet *ifp, int, int); +int rtsock_routemsg_info(int, struct rt_addrinfo *, int); /* * Note the following locking behavior: Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Jan 7 21:13:34 2020 (r356472) +++ head/sys/net/rtsock.c Tue Jan 7 21:16:30 2020 (r356473) @@ -1450,7 +1450,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr; info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask( - info.rti_info[RTAX_IFP], ifa->ifa_netmask, &ss); + info.rti_info[RTAX_IFA], ifa->ifa_netmask, &ss); info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; if ((m = rtsock_msg_mbuf(ncmd, &info)) == NULL) return (ENOBUFS); @@ -1471,46 +1471,69 @@ rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum } /* - * Announce route addition/removal. - * Please do not call directly, use rt_routemsg(). - * Note that @rt data MAY be inconsistent/invalid: - * if some userland app sends us "invalid" route message (invalid mask, - * no dst, wrong address families, etc...) we need to pass it back - * to app (and any other rtsock consumers) with rtm_errno field set to - * non-zero value. + * Announce route addition/removal to rtsock based on @rt data. + * Callers are advives to use rt_routemsg() instead of using this + * function directly. + * Assume @rt data is consistent. * * Returns 0 on success. */ int -rtsock_routemsg(int cmd, struct ifnet *ifp, int error, struct rtentry *rt, +rtsock_routemsg(int cmd, struct rtentry *rt, struct ifnet *ifp, int rti_addrs, int fibnum) { - struct rt_addrinfo info; - struct sockaddr *sa; - struct mbuf *m; - struct rt_msghdr *rtm; struct sockaddr_storage ss; + struct rt_addrinfo info; if (V_route_cb.any_count == 0) return (0); bzero((caddr_t)&info, sizeof(info)); - info.rti_info[RTAX_DST] = sa = rt_key(rt); - info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(sa, rt_mask(rt), &ss); + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt), rt_mask(rt), &ss); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - if ((m = rtsock_msg_mbuf(cmd, &info)) == NULL) + info.rti_flags = rt->rt_flags; + info.rti_ifp = ifp; + + return (rtsock_routemsg_info(cmd, &info, fibnum)); +} + +int +rtsock_routemsg_info(int cmd, struct rt_addrinfo *info, int fibnum) +{ + struct rt_msghdr *rtm; + struct sockaddr *sa; + struct mbuf *m; + + if (V_route_cb.any_count == 0) + return (0); + + if (info->rti_flags & RTF_HOST) + info->rti_info[RTAX_NETMASK] = NULL; + + m = rtsock_msg_mbuf(cmd, info); + if (m == NULL) return (ENOBUFS); - rtm = mtod(m, struct rt_msghdr *); - rtm->rtm_index = ifp->if_index; - rtm->rtm_flags |= rt->rt_flags; - rtm->rtm_errno = error; - rtm->rtm_addrs = info.rti_addrs; if (fibnum != RT_ALL_FIBS) { + KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: fibnum out " + "of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; } + rtm = mtod(m, struct rt_msghdr *); + rtm->rtm_addrs = info->rti_addrs; + if (info->rti_ifp != NULL) + rtm->rtm_index = info->rti_ifp->if_index; + /* Add RTF_DONE to indicate command 'completion' required by API */ + info->rti_flags |= RTF_DONE; + /* Reported routes has to be up */ + if (cmd == RTM_ADD || cmd == RTM_CHANGE) + info->rti_flags |= RTF_UP; + rtm->rtm_flags = info->rti_flags; + + sa = info->rti_info[RTAX_DST]; rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); return (0); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 7 21:13:34 2020 (r356472) +++ head/sys/netinet6/in6.c Tue Jan 7 21:16:30 2020 (r356473) @@ -168,30 +168,35 @@ static int in6_broadcast_ifa(struct ifnet *, struct in void in6_newaddrmsg(struct in6_ifaddr *ia, int cmd) { + struct rt_addrinfo info; + struct ifaddr *ifa; struct sockaddr_dl gateway; - struct sockaddr_in6 mask, addr; - struct rtentry rt; int fibnum; + ifa = &ia->ia_ifa; + /* - * initialize for rtmsg generation + * Prepare info data for the host route. + * This code mimics one from ifa_maintain_loopback_route(). */ - bzero(&gateway, sizeof(gateway)); - gateway.sdl_len = sizeof(gateway); - gateway.sdl_family = AF_LINK; + bzero(&info, sizeof(struct rt_addrinfo)); + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; + info.rti_info[RTAX_DST] = ifa->ifa_addr; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gateway; + link_init_sdl(ifa->ifa_ifp, (struct sockaddr *)&gateway, ifa->ifa_ifp->if_type); + if (cmd != RTM_DELETE) + info.rti_ifp = V_loif; - bzero(&rt, sizeof(rt)); - rt.rt_gateway = (struct sockaddr *)&gateway; - memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); - rt_mask(&rt) = (struct sockaddr *)&mask; - rt_key(&rt) = (struct sockaddr *)&addr; - rt.rt_flags = RTF_HOST | RTF_STATIC; - if (cmd == RTM_ADD) - rt.rt_flags |= RTF_UP; + fibnum = V_rt_add_addr_allfibs ? RT_ALL_FIBS : ia62ifa(ia)->ifa_ifp->if_fib; - /* Announce arrival of local address to this FIB. */ - rt_newaddrmsg_fib(cmd, &ia->ia_ifa, 0, &rt, fibnum); + + if (cmd == RTM_ADD) { + rt_addrmsg(cmd, &ia->ia_ifa, fibnum); + rt_routemsg_info(cmd, &info, fibnum); + } else if (cmd == RTM_DELETE) { + rt_routemsg_info(cmd, &info, fibnum); + rt_addrmsg(cmd, &ia->ia_ifa, fibnum); + } } int Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Tue Jan 7 21:13:34 2020 (r356472) +++ head/sys/netinet6/nd6_rtr.c Tue Jan 7 21:16:30 2020 (r356473) @@ -609,30 +609,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) static void nd6_rtmsg(int cmd, struct rtentry *rt) { - struct rt_addrinfo info; - struct ifnet *ifp; - struct ifaddr *ifa; - bzero((caddr_t)&info, sizeof(info)); - info.rti_info[RTAX_DST] = rt_key(rt); - info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - info.rti_info[RTAX_NETMASK] = rt_mask(rt); - ifp = rt->rt_ifp; - if (ifp != NULL) { - struct epoch_tracker et; - - NET_EPOCH_ENTER(et); - ifa = CK_STAILQ_FIRST(&ifp->if_addrhead); - info.rti_info[RTAX_IFP] = ifa->ifa_addr; - ifa_ref(ifa); - NET_EPOCH_EXIT(et); - info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; - } else - ifa = NULL; - - rt_missmsg_fib(cmd, &info, rt->rt_flags, 0, rt->rt_fibnum); - if (ifa != NULL) - ifa_free(ifa); + rt_routemsg(cmd, rt, rt->rt_ifp, 0, rt->rt_fibnum); } /* PFXRTR */ Modified: head/tests/sys/net/routing/rtsock_common.h ============================================================================== --- head/tests/sys/net/routing/rtsock_common.h Tue Jan 7 21:13:34 2020 (r356472) +++ head/tests/sys/net/routing/rtsock_common.h Tue Jan 7 21:16:30 2020 (r356473) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -594,7 +595,18 @@ struct rt_msghdr * rtsock_read_rtm(int fd, char *buffer, size_t buflen) { ssize_t len; + struct pollfd pfd; + int poll_delay = 5 * 1000; /* 5 seconds */ + /* Check for the data available to read first */ + memset(&pfd, 0, sizeof(pfd)); + pfd.fd = fd; + pfd.events = POLLIN; + + if (poll(&pfd, 1, poll_delay) == 0) + ATF_REQUIRE_MSG(1 == 0, "rtsock read timed out (%d seconds passed)", + poll_delay / 1000); + len = read(fd, buffer, buflen); int my_errno = errno; ATF_REQUIRE_MSG(len > 0, "rtsock read failed: %s", strerror(my_errno)); @@ -706,35 +718,36 @@ rtsock_update_rtm_len(struct rt_msghdr *rtm) } static void -_validate_route_message(struct rt_msghdr *rtm) +_validate_message_sockaddrs(char *buffer, int rtm_len, size_t offset, int rtm_addrs) { struct sockaddr *sa; - size_t parsed_len = sizeof(struct rt_msghdr); - int len = rtm->rtm_msglen; + size_t parsed_len = offset; - sa = (struct sockaddr *)(rtm + 1); + /* Offset denotes initial header size */ + sa = (struct sockaddr *)(buffer + offset); for (int i = 0; i < RTAX_MAX; i++) { - if ((rtm->rtm_addrs & (1 << i)) == 0) + if ((rtm_addrs & (1 << i)) == 0) continue; parsed_len += SA_SIZE(sa); - RTSOCK_ATF_REQUIRE_MSG(rtm, parsed_len <= len, - "SA %d: len %d exceeds msg size %d", i, (int)sa->sa_len, len); + RTSOCK_ATF_REQUIRE_MSG((struct rt_msghdr *)buffer, parsed_len <= rtm_len, + "SA %d: len %d exceeds msg size %d", i, (int)sa->sa_len, rtm_len); if (sa->sa_family == AF_LINK) { struct sockaddr_dl *sdl = (struct sockaddr_dl *)sa; int data_len = sdl->sdl_nlen + sdl->sdl_alen; data_len += offsetof(struct sockaddr_dl, sdl_data); - RTSOCK_ATF_REQUIRE_MSG(rtm, data_len <= len, - "AF_LINK data size exceeds total len: %u vs %u", - data_len, len); + RTSOCK_ATF_REQUIRE_MSG((struct rt_msghdr *)buffer, + data_len <= rtm_len, + "AF_LINK data size exceeds total len: %u vs %u, nlen=%d alen=%d", + data_len, rtm_len, sdl->sdl_nlen, sdl->sdl_alen); } sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa)); } - RTSOCK_ATF_REQUIRE_MSG(rtm, parsed_len == rtm->rtm_msglen, + RTSOCK_ATF_REQUIRE_MSG((struct rt_msghdr *)buffer, parsed_len == rtm_len, "message len != parsed len: expected %d parsed %d", - rtm->rtm_msglen, (int)parsed_len); + rtm_len, (int)parsed_len); } /* @@ -758,9 +771,36 @@ rtsock_validate_message(char *buffer, ssize_t len) case RTM_ADD: case RTM_DELETE: case RTM_CHANGE: - _validate_route_message(rtm); + _validate_message_sockaddrs(buffer, rtm->rtm_msglen, + sizeof(struct rt_msghdr), rtm->rtm_addrs); break; + case RTM_DELADDR: + case RTM_NEWADDR: + _validate_message_sockaddrs(buffer, rtm->rtm_msglen, + sizeof(struct ifa_msghdr), ((struct ifa_msghdr *)buffer)->ifam_addrs); + break; } +} + +void +rtsock_validate_pid_ours(struct rt_msghdr *rtm) +{ + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_pid == getpid(), "expected pid %d, got %d", + getpid(), rtm->rtm_pid); +} + +void +rtsock_validate_pid_user(struct rt_msghdr *rtm) +{ + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_pid > 0, "expected non-zero pid, got %d", + rtm->rtm_pid); +} + +void +rtsock_validate_pid_kernel(struct rt_msghdr *rtm) +{ + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_pid == 0, "expected zero pid, got %d", + rtm->rtm_pid); } #endif Modified: head/tests/sys/net/routing/rtsock_print.h ============================================================================== --- head/tests/sys/net/routing/rtsock_print.h Tue Jan 7 21:13:34 2020 (r356472) +++ head/tests/sys/net/routing/rtsock_print.h Tue Jan 7 21:16:30 2020 (r356473) @@ -40,12 +40,20 @@ #define RTSOCK_ATF_REQUIRE_MSG(_rtm, _cond, _fmt, ...) do { \ if (!(_cond)) { \ printf("-- CONDITION FAILED, rtm dump --\n\n");\ - rtsock_print_rtm(_rtm); \ + rtsock_print_message(_rtm); \ } \ ATF_REQUIRE_MSG(_cond, _fmt, ##__VA_ARGS__); \ } while (0); +#define RTSOCKHD_ATF_REQUIRE_MSG(_rtm, _cond, _fmt, ...) do { \ + if (!(_cond)) { \ + printf("-- CONDITION FAILED, rtm hexdump--\n\n");\ + rtsock_print_message_hd(_rtm); \ + } \ + ATF_REQUIRE_MSG(_cond, _fmt, ##__VA_ARGS__); \ +} while (0); + /* from route.c */ static const char *const msgtypes[] = { "", @@ -145,7 +153,7 @@ sa_print_hd(char *buf, int buflen, const char *data, i unsigned char v; int repeat_count = 0; for (int i = 0; i < len; i++) { - if (last_char && *last_char == data[i]) { + if (last_char && *last_char == data[i] && data[i] == 0x00) { repeat_count++; continue; } @@ -157,9 +165,9 @@ sa_print_hd(char *buf, int buflen, const char *data, i v = ((const unsigned char *)data)[i]; if (last_char == NULL) - _PRINTX("%02X", v); + _PRINTX("x%02X", v); else - _PRINTX(", %02X", v); + _PRINTX(", x%02X", v); last_char = &data[i]; repeat_count = 1; @@ -259,6 +267,19 @@ rtsock_print_rtm(struct rt_msghdr *rtm) printf("%s: len %hu, pid: %d, seq %d, errno %d, flags: %s\n", msgtypes[rtm->rtm_type], rtm->rtm_msglen, rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno, flags_buf); + if (rtm->rtm_inits > 0) { + _printb(flags_buf, sizeof(flags_buf), rtm->rtm_inits, metricnames); + printf("metrics: %s\n", flags_buf); + if (rtm->rtm_inits & RTV_MTU) + printf("mtu: %lu\n", rtm->rtm_rmx.rmx_mtu); + if (rtm->rtm_inits & RTV_EXPIRE) { + struct timeval tv; + gettimeofday(&tv, NULL); + printf("expire: %d (%lu raw)\n", + (int)(rtm->rtm_rmx.rmx_expire - tv.tv_sec), rtm->rtm_rmx.rmx_expire); + } + } + _printb(flags_buf, sizeof(flags_buf), rtm->rtm_addrs, addrnames); printf("sockaddrs: 0x%X %s\n", rtm->rtm_addrs, flags_buf); @@ -275,6 +296,81 @@ rtsock_print_rtm(struct rt_msghdr *rtm) printf("\n"); +} + +void +rtsock_print_ifa(struct ifa_msghdr *ifam) +{ + struct timeval tv; + struct tm tm_res; + char buf[64]; + + gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm_res); + strftime(buf, sizeof(buf), "%F %T", &tm_res); + printf("Got message of size %hu on %s\n", ifam->ifam_msglen, buf); + + char flags_buf[256]; + _printb(flags_buf, sizeof(flags_buf), ifam->ifam_flags, routeflags); + + printf("%s: len %hu, ifindex: %d, flags: %s\n", msgtypes[ifam->ifam_type], + ifam->ifam_msglen, ifam->ifam_index, flags_buf); + + _printb(flags_buf, sizeof(flags_buf), ifam->ifam_addrs, addrnames); + printf("sockaddrs: 0x%X %s\n", ifam->ifam_addrs, flags_buf); + + char *ptr = (char *)(ifam + 1); + for (int i = 0; i < RTAX_MAX; i++) { + if (ifam->ifam_addrs & (1 << i)) { + struct sockaddr *sa = (struct sockaddr *)ptr; + sa_print(sa, 1); + + /* add */ + ptr += ALIGN(((struct sockaddr *)ptr)->sa_len); + } + } + + printf("\n"); + +} + +void +rtsock_print_message_hd(struct rt_msghdr *rtm) +{ + struct timeval tv; + struct tm tm_res; + char buf[64]; + char dumpbuf[2048]; + + gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm_res); + strftime(buf, sizeof(buf), "%F %T", &tm_res); + printf("Got message type %s of size %hu on %s\n", + rtsock_print_cmdtype(rtm->rtm_type), + rtm->rtm_msglen, buf); + + sa_print_hd(dumpbuf, sizeof(dumpbuf), (char *)rtm, rtm->rtm_msglen); + printf(" %s\n", dumpbuf); +} + +void +rtsock_print_message(struct rt_msghdr *rtm) +{ + + switch (rtm->rtm_type) { + case RTM_GET: + case RTM_ADD: + case RTM_DELETE: + case RTM_CHANGE: + rtsock_print_rtm(rtm); + break; + case RTM_DELADDR: + case RTM_NEWADDR: + rtsock_print_ifa((struct ifa_msghdr *)rtm); + break; + default: + printf("unknown rt message type %X\n", rtm->rtm_type); + } } #endif Modified: head/tests/sys/net/routing/test_rtsock_l3.c ============================================================================== --- head/tests/sys/net/routing/test_rtsock_l3.c Tue Jan 7 21:13:34 2020 (r356472) +++ head/tests/sys/net/routing/test_rtsock_l3.c Tue Jan 7 21:16:30 2020 (r356473) @@ -29,9 +29,14 @@ #include "rtsock_common.h" #include "rtsock_config.h" +#include "sys/types.h" +#include +#include +#include "net/bpf.h" + static inline struct rtsock_test_config * -presetup_ipv6(const atf_tc_t *tc) +presetup_ipv6_iface(const atf_tc_t *tc) { struct rtsock_test_config *c; int ret; @@ -44,6 +49,17 @@ presetup_ipv6(const atf_tc_t *tc) ret = iface_enable_ipv6(c->ifname); ATF_REQUIRE_MSG(ret == 0, "Unable to enable IPv6 on %s", c->ifname); + return (c); +} + +static inline struct rtsock_test_config * +presetup_ipv6(const atf_tc_t *tc) +{ + struct rtsock_test_config *c; + int ret; + + c = presetup_ipv6_iface(tc); + ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); c->rtsock_fd = rtsock_setup_socket(); @@ -52,16 +68,15 @@ presetup_ipv6(const atf_tc_t *tc) } static inline struct rtsock_test_config * -presetup_ipv4(const atf_tc_t *tc) +presetup_ipv4_iface(const atf_tc_t *tc) { struct rtsock_test_config *c; int ret; c = config_setup(tc); - /* assumes ifconfig doing IFF_UP */ - ret = iface_setup_addr(c->ifname, c->addr4_str, c->plen4); - ATF_REQUIRE_MSG(ret == 0, "ifconfig failed"); + ret = iface_turn_up(c->ifname); + ATF_REQUIRE_MSG(ret == 0, "Unable to turn up %s", c->ifname); /* Actually open interface, so kernel writes won't fail */ if (c->autocreated_interface) { @@ -69,6 +84,21 @@ presetup_ipv4(const atf_tc_t *tc) ATF_REQUIRE_MSG(ret >= 0, "unable to open interface %s", c->ifname); } + return (c); +} + +static inline struct rtsock_test_config * +presetup_ipv4(const atf_tc_t *tc) +{ + struct rtsock_test_config *c; + int ret; + + c = presetup_ipv4_iface(tc); + + /* assumes ifconfig doing IFF_UP */ + ret = iface_setup_addr(c->ifname, c->addr4_str, c->plen4); + ATF_REQUIRE_MSG(ret == 0, "ifconfig failed"); + c->rtsock_fd = rtsock_setup_socket(); return (c); @@ -158,8 +188,6 @@ verify_route_message(struct rt_msghdr *rtm, int cmd, s ret = sa_equal_msg(sa, gw, msg, sizeof(msg)); RTSOCK_ATF_REQUIRE_MSG(rtm, ret != 0, "GATEWAY sa diff: %s", msg); } - - RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_pid > 0, "expected non-zero pid"); } static void @@ -169,9 +197,22 @@ verify_route_message_extra(struct rt_msghdr *rtm, int "expected ifindex %d, got %d", ifindex, rtm->rtm_index); RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_flags == rtm_flags, - "expected flags: %X, got %X", rtm_flags, rtm->rtm_flags); + "expected flags: 0x%X, got 0x%X", rtm_flags, rtm->rtm_flags); } +static void +verify_link_gateway(struct rt_msghdr *rtm, int ifindex) +{ + struct sockaddr *sa; + struct sockaddr_dl *sdl; + + sa = rtsock_find_rtm_sa(rtm, RTA_GATEWAY); + RTSOCK_ATF_REQUIRE_MSG(rtm, sa != NULL, "GATEWAY is not set"); + RTSOCK_ATF_REQUIRE_MSG(rtm, sa->sa_family == AF_LINK, "GW sa family is %d", sa->sa_family); + sdl = (struct sockaddr_dl *)sa; + RTSOCK_ATF_REQUIRE_MSG(rtm, sdl->sdl_index == ifindex, "GW ifindex is %d", sdl->sdl_index); +} + /* TESTS */ #define DECLARE_TEST_VARS \ @@ -185,6 +226,16 @@ verify_route_message_extra(struct rt_msghdr *rtm, int #define DESCRIBE_ROOT_TEST(_msg) config_describe_root_test(tc, _msg) #define CLEANUP_AFTER_TEST config_generic_cleanup(config_setup(tc)) +#define RTM_DECLARE_ROOT_TEST(_name, _descr) \ +ATF_TC_WITH_CLEANUP(_name); \ +ATF_TC_HEAD(_name, tc) \ +{ \ + DESCRIBE_ROOT_TEST(_descr); \ +} \ +ATF_TC_CLEANUP(_name, tc) \ +{ \ + CLEANUP_AFTER_TEST; \ +} ATF_TC_WITH_CLEANUP(rtm_get_v4_exact_success); ATF_TC_HEAD(rtm_get_v4_exact_success, tc) @@ -219,6 +270,7 @@ ATF_TC_BODY(rtm_get_v4_exact_success, tc) verify_route_message_extra(rtm, c->ifindex, RTF_UP | RTF_DONE | RTF_PINNED); /* Explicitly verify gateway for the interface route */ + verify_link_gateway(rtm, c->ifindex); sa = rtsock_find_rtm_sa(rtm, RTA_GATEWAY); RTSOCK_ATF_REQUIRE_MSG(rtm, sa != NULL, "GATEWAY is not set"); RTSOCK_ATF_REQUIRE_MSG(rtm, sa->sa_family == AF_LINK, "GW sa family is %d", sa->sa_family); @@ -247,7 +299,7 @@ ATF_TC_BODY(rtm_get_v4_lpm_success, tc) rtsock_send_rtm(c->rtsock_fd, rtm); - rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); /* * RTM_GET: Report Metrics: len 312, pid: 67074, seq 1, errno 0, flags: @@ -503,8 +555,432 @@ ATF_TC_CLEANUP(rtm_del_v6_gu_prefix_nogw_success, tc) CLEANUP_AFTER_TEST; } +ATF_TC_WITH_CLEANUP(rtm_add_v4_temporal1_success); +ATF_TC_HEAD(rtm_add_v4_temporal1_success, tc) +{ + DESCRIBE_ROOT_TEST("Tests IPv4 route expiration with expire time set"); +} +ATF_TC_BODY(rtm_add_v4_temporal1_success, tc) +{ + DECLARE_TEST_VARS; + c = presetup_ipv4(tc); + + /* Create IPv4 subnetwork with smaller prefix */ + struct sockaddr_in mask4; + struct sockaddr_in net4; + struct sockaddr_in gw4; + prepare_v4_network(c, &net4, &mask4, &gw4); + + prepare_route_message(rtm, RTM_ADD, (struct sockaddr *)&net4, + (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); + + /* Set expire time to now */ + struct timeval tv; + gettimeofday(&tv, NULL); + rtm->rtm_rmx.rmx_expire = tv.tv_sec - 1; + rtm->rtm_inits |= RTV_EXPIRE; + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + ATF_REQUIRE_MSG(rtm != NULL, "unable to get rtsock reply for RTM_ADD"); + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_inits & RTV_EXPIRE, "RTV_EXPIRE not set"); + + /* The next should be route deletion */ + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + + verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&net4, + (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); + + /* TODO: add RTF_DONE */ + verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_STATIC); +} + +ATF_TC_CLEANUP(rtm_add_v4_temporal1_success, tc) +{ + CLEANUP_AFTER_TEST; +} + +ATF_TC_WITH_CLEANUP(rtm_add_v6_temporal1_success); +ATF_TC_HEAD(rtm_add_v6_temporal1_success, tc) +{ + DESCRIBE_ROOT_TEST("Tests IPv6 global unicast prefix addition with directly-reachable GU GW"); +} + +ATF_TC_BODY(rtm_add_v6_temporal1_success, tc) +{ + DECLARE_TEST_VARS; + + c = presetup_ipv6(tc); + + /* Create IPv6 subnetwork with smaller prefix */ + struct sockaddr_in6 mask6; + struct sockaddr_in6 net6; + struct sockaddr_in6 gw6; + prepare_v6_network(c, &net6, &mask6, &gw6); + + prepare_route_message(rtm, RTM_ADD, (struct sockaddr *)&net6, + (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); + + /* Set expire time to now */ + struct timeval tv; + gettimeofday(&tv, NULL); + rtm->rtm_rmx.rmx_expire = tv.tv_sec - 1; + rtm->rtm_inits |= RTV_EXPIRE; + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + ATF_REQUIRE_MSG(rtm != NULL, "unable to get rtsock reply for RTM_ADD"); + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_inits & RTV_EXPIRE, "RTV_EXPIRE not set"); + + /* The next should be route deletion */ + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + + verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&net6, + (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); + + + /* XXX: Currently kernel sets RTF_UP automatically but does NOT report it in the reply */ + /* TODO: add RTF_DONE */ + verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_STATIC); +} + +ATF_TC_CLEANUP(rtm_add_v6_temporal1_success, tc) +{ + CLEANUP_AFTER_TEST; +} + +/* Interface address messages tests */ + +RTM_DECLARE_ROOT_TEST(rtm_add_v6_gu_ifa_hostroute_success, + "Tests validness for /128 host route announce after ifaddr assignment"); + +ATF_TC_BODY(rtm_add_v6_gu_ifa_hostroute_success, tc) +{ + DECLARE_TEST_VARS; + + c = presetup_ipv6_iface(tc); + + c->rtsock_fd = rtsock_setup_socket(); + + ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); + + /* + * There will be multiple. + * RTM_ADD without llinfo. + */ + + while (true) { + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + if ((rtm->rtm_type == RTM_ADD) && ((rtm->rtm_flags & RTF_LLINFO) == 0)) + break; + } + /* This should be a message for the host route */ + + verify_route_message(rtm, RTM_ADD, (struct sockaddr *)&c->addr6, NULL, NULL); + rtsock_validate_pid_kernel(rtm); + /* No netmask should be set */ + RTSOCK_ATF_REQUIRE_MSG(rtm, rtsock_find_rtm_sa(rtm, RTA_NETMASK) == NULL, "netmask is set"); + + /* gateway should be link sdl with ifindex of an address interface */ + verify_link_gateway(rtm, c->ifindex); + + int expected_rt_flags = RTF_UP | RTF_HOST | RTF_DONE | RTF_STATIC | RTF_PINNED; + verify_route_message_extra(rtm, if_nametoindex("lo0"), expected_rt_flags); +} + +RTM_DECLARE_ROOT_TEST(rtm_add_v6_gu_ifa_prefixroute_success, + "Tests validness for the prefix route announce after ifaddr assignment"); + +ATF_TC_BODY(rtm_add_v6_gu_ifa_prefixroute_success, tc) +{ + DECLARE_TEST_VARS; + + c = presetup_ipv6_iface(tc); + + c->rtsock_fd = rtsock_setup_socket(); + + ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); + + /* + * Multiple RTM_ADD messages will be generated: + * 1) lladdr mapping (RTF_LLDATA) + * 2) host route (one w/o netmask) + * 3) prefix route + */ + + while (true) { + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + /* Find RTM_ADD with netmask - this should skip both host route and LLADDR */ + if ((rtm->rtm_type == RTM_ADD) && (rtsock_find_rtm_sa(rtm, RTA_NETMASK))) + break; + } + + /* This should be a message for the prefix route */ + verify_route_message(rtm, RTM_ADD, (struct sockaddr *)&c->net6, + (struct sockaddr *)&c->mask6, NULL); + + /* gateway should be link sdl with ifindex of an address interface */ + verify_link_gateway(rtm, c->ifindex); + + /* TODO: PINNED? */ + int expected_rt_flags = RTF_UP | RTF_DONE; + verify_route_message_extra(rtm, c->ifindex, expected_rt_flags); +} + +RTM_DECLARE_ROOT_TEST(rtm_add_v6_gu_ifa_ordered_success, + "Tests ordering of the messages for IPv6 global unicast ifaddr assignment"); + +ATF_TC_BODY(rtm_add_v6_gu_ifa_ordered_success, tc) +{ + DECLARE_TEST_VARS; + + c = presetup_ipv6_iface(tc); + + c->rtsock_fd = rtsock_setup_socket(); + + ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); + + int count = 0, tries = 0; + + enum msgtype { + MSG_IFADDR, + MSG_HOSTROUTE, + MSG_PREFIXROUTE, + MSG_MAX, + }; + + int msg_array[MSG_MAX]; + + bzero(msg_array, sizeof(msg_array)); + + while (count < 3 && tries < 20) { + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + tries++; + /* Classify */ + if (rtm->rtm_type == RTM_NEWADDR) { + RLOG("MSG_IFADDR: %d", count); + msg_array[MSG_IFADDR] = count++; + continue; + } + + /* Find RTM_ADD with netmask - this should skip both host route and LLADDR */ + if ((rtm->rtm_type == RTM_ADD) && (rtsock_find_rtm_sa(rtm, RTA_NETMASK))) { + RLOG("MSG_PREFIXROUTE: %d", count); + msg_array[MSG_PREFIXROUTE] = count++; + continue; + } + + if ((rtm->rtm_type == RTM_ADD) && ((rtm->rtm_flags & RTF_LLDATA) == 0)) { + RLOG("MSG_HOSTROUTE: %d", count); + msg_array[MSG_HOSTROUTE] = count++; + continue; + } + + RLOG("skipping msg type %s, try: %d", rtsock_print_cmdtype(rtm->rtm_type), + tries); + } + + /* TODO: verify multicast */ + ATF_REQUIRE_MSG(count == 3, "Received only %d/3 messages", count); + ATF_REQUIRE_MSG(msg_array[MSG_IFADDR] == 0, "ifaddr message is not the first"); +} + +RTM_DECLARE_ROOT_TEST(rtm_del_v6_gu_ifa_hostroute_success, + "Tests validness for /128 host route removal after ifaddr removal"); + +ATF_TC_BODY(rtm_del_v6_gu_ifa_hostroute_success, tc) +{ + DECLARE_TEST_VARS; + + c = presetup_ipv6_iface(tc); + + ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); + + c->rtsock_fd = rtsock_setup_socket(); + + ret = iface_delete_addr(c->ifname, c->addr6_str); + + while (true) { + rtm = rtsock_read_rtm(c->rtsock_fd, buffer, sizeof(buffer)); + if ((rtm->rtm_type == RTM_DELETE) && + ((rtm->rtm_flags & RTF_LLINFO) == 0) && + rtsock_find_rtm_sa(rtm, RTA_NETMASK) == NULL) + break; + } + /* This should be a message for the host route */ + + verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&c->addr6, NULL, NULL); + rtsock_validate_pid_kernel(rtm); + /* No netmask should be set */ + RTSOCK_ATF_REQUIRE_MSG(rtm, rtsock_find_rtm_sa(rtm, RTA_NETMASK) == NULL, "netmask is set"); + + /* gateway should be link sdl with ifindex of an address interface */ + verify_link_gateway(rtm, c->ifindex); + + /* XXX: consider passing ifindex in rtm_index as done in RTM_ADD. */ + int expected_rt_flags = RTF_HOST | RTF_DONE | RTF_STATIC | RTF_PINNED; + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_flags == expected_rt_flags, + "expected rtm flags: 0x%X, got 0x%X", expected_rt_flags, rtm->rtm_flags); +} + +RTM_DECLARE_ROOT_TEST(rtm_del_v6_gu_ifa_prefixroute_success, + "Tests validness for the prefix route removal after ifaddr assignment"); + +ATF_TC_BODY(rtm_del_v6_gu_ifa_prefixroute_success, tc) +{ + DECLARE_TEST_VARS; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 7 21:17:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98541F309C; Tue, 7 Jan 2020 21:17:12 +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 47slZJ5dvvz4fHZ; Tue, 7 Jan 2020 21:17:12 +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 BCCA35318; Tue, 7 Jan 2020 21:17:12 +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 007LHCwl045920; Tue, 7 Jan 2020 21:17:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LHB3i045915; Tue, 7 Jan 2020 21:17:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001072117.007LHB3i045915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 7 Jan 2020 21:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356474 - in head: share/man/man4 sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/nvme X-SVN-Commit-Revision: 356474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:17:13 -0000 Author: mav Date: Tue Jan 7 21:17:11 2020 New Revision: 356474 URL: https://svnweb.freebsd.org/changeset/base/356474 Log: Add Host Memory Buffer support to nvme(4). This allows cheapest DRAM-less NVMe SSDs to use some of host RAM (about 1MB per 1GB on the devices I have) for its metadata cache, significantly improving random I/O performance. Device reports minimal and preferable size of the buffer. The code limits it to 1% of physical RAM by default. If the buffer can not be allocated or below minimal size, the device will just have to work without it. MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Modified: head/share/man/man4/nvme.4 head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_private.h Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Tue Jan 7 21:16:30 2020 (r356473) +++ head/share/man/man4/nvme.4 Tue Jan 7 21:17:11 2020 (r356474) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2019 +.Dd January 6, 2020 .Dt NVME 4 .Os .Sh NAME @@ -119,6 +119,14 @@ hw.nvme.force_intx=1 .Ed .Pp Note that use of INTx implies disabling of per-CPU I/O queue pairs. +.Pp +To control maximum amount of system RAM in bytes to use as Host Memory +Buffer for capable devices, set the following tunable: +.Bd -literal -offset indent +hw.nvme.hmb_max +.Ed +.Pp +The default value is 1% of physical memory size per device. .Pp The .Xr nvd 4 Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Jan 7 21:16:30 2020 (r356473) +++ head/sys/dev/nvme/nvme.h Tue Jan 7 21:17:11 2020 (r356474) @@ -1531,6 +1531,12 @@ struct nvme_get_nsid { uint32_t nsid; }; +struct nvme_hmb_desc { + uint64_t addr; + uint32_t size; + uint32_t reserved; +}; + #define nvme_completion_is_error(cpl) \ (NVME_STATUS_GET_SC((cpl)->status) != 0 || NVME_STATUS_GET_SCT((cpl)->status) != 0) @@ -1566,6 +1572,8 @@ int nvme_ctrlr_passthrough_cmd(struct nvme_controller /* Admin functions */ void nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctrlr, uint8_t feature, uint32_t cdw11, + uint32_t cdw12, uint32_t cdw13, + uint32_t cdw14, uint32_t cdw15, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_get_feature(struct nvme_controller *ctrlr, Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 21:16:30 2020 (r356473) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 21:17:11 2020 (r356474) @@ -841,6 +841,169 @@ nvme_ctrlr_configure_int_coalescing(struct nvme_contro } static void +nvme_ctrlr_hmb_free(struct nvme_controller *ctrlr) +{ + struct nvme_hmb_chunk *hmbc; + int i; + + if (ctrlr->hmb_desc_paddr) { + bus_dmamap_unload(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map); + bus_dmamem_free(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_vaddr, + ctrlr->hmb_desc_map); + ctrlr->hmb_desc_paddr = 0; + } + if (ctrlr->hmb_desc_tag) { + bus_dma_tag_destroy(ctrlr->hmb_desc_tag); + ctrlr->hmb_tag = NULL; + } + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + hmbc = &ctrlr->hmb_chunks[i]; + bus_dmamap_unload(ctrlr->hmb_tag, hmbc->hmbc_map); + bus_dmamem_free(ctrlr->hmb_tag, hmbc->hmbc_vaddr, + hmbc->hmbc_map); + } + ctrlr->hmb_nchunks = 0; + if (ctrlr->hmb_tag) { + bus_dma_tag_destroy(ctrlr->hmb_tag); + ctrlr->hmb_tag = NULL; + } + if (ctrlr->hmb_chunks) { + free(ctrlr->hmb_chunks, M_NVME); + ctrlr->hmb_chunks = NULL; + } +} + +static void +nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) +{ + struct nvme_hmb_chunk *hmbc; + size_t pref, min, minc, size; + int err, i; + uint64_t max; + + /* Limit HMB to 1% of RAM size per device by default. */ + max = (uint64_t)physmem * PAGE_SIZE / 100; + TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); + + min = (long long unsigned)ctrlr->cdata.hmmin * 4096; + if (max < min) + return; + pref = MIN((long long unsigned)ctrlr->cdata.hmpre * 4096, max); + minc = MAX(ctrlr->cdata.hmminds * 4096, PAGE_SIZE); + if (min > 0 && ctrlr->cdata.hmmaxd > 0) + minc = MAX(minc, min / ctrlr->cdata.hmmaxd); + ctrlr->hmb_chunk = pref; + +again: + ctrlr->hmb_chunk = roundup2(ctrlr->hmb_chunk, PAGE_SIZE); + ctrlr->hmb_nchunks = howmany(pref, ctrlr->hmb_chunk); + if (ctrlr->cdata.hmmaxd > 0 && ctrlr->hmb_nchunks > ctrlr->cdata.hmmaxd) + ctrlr->hmb_nchunks = ctrlr->cdata.hmmaxd; + ctrlr->hmb_chunks = malloc(sizeof(struct nvme_hmb_chunk) * + ctrlr->hmb_nchunks, M_NVME, M_WAITOK); + err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), + PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ctrlr->hmb_chunk, 1, ctrlr->hmb_chunk, 0, NULL, NULL, &ctrlr->hmb_tag); + if (err != 0) { + nvme_printf(ctrlr, "HMB tag create failed %d\n", err); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + hmbc = &ctrlr->hmb_chunks[i]; + if (bus_dmamem_alloc(ctrlr->hmb_tag, + (void **)&hmbc->hmbc_vaddr, BUS_DMA_NOWAIT, + &hmbc->hmbc_map)) { + nvme_printf(ctrlr, "failed to alloc HMB\n"); + break; + } + if (bus_dmamap_load(ctrlr->hmb_tag, hmbc->hmbc_map, + hmbc->hmbc_vaddr, ctrlr->hmb_chunk, nvme_single_map, + &hmbc->hmbc_paddr, BUS_DMA_NOWAIT) != 0) { + bus_dmamem_free(ctrlr->hmb_tag, hmbc->hmbc_vaddr, + hmbc->hmbc_map); + nvme_printf(ctrlr, "failed to load HMB\n"); + break; + } + bus_dmamap_sync(ctrlr->hmb_tag, hmbc->hmbc_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + + if (i < ctrlr->hmb_nchunks && i * ctrlr->hmb_chunk < min && + ctrlr->hmb_chunk / 2 >= minc) { + ctrlr->hmb_nchunks = i; + nvme_ctrlr_hmb_free(ctrlr); + ctrlr->hmb_chunk /= 2; + goto again; + } + ctrlr->hmb_nchunks = i; + if (ctrlr->hmb_nchunks * ctrlr->hmb_chunk < min) { + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + size = sizeof(struct nvme_hmb_desc) * ctrlr->hmb_nchunks; + err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), + 16, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + size, 1, size, 0, NULL, NULL, &ctrlr->hmb_desc_tag); + if (err != 0) { + nvme_printf(ctrlr, "HMB desc tag create failed %d\n", err); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + if (bus_dmamem_alloc(ctrlr->hmb_desc_tag, + (void **)&ctrlr->hmb_desc_vaddr, BUS_DMA_WAITOK, + &ctrlr->hmb_desc_map)) { + nvme_printf(ctrlr, "failed to alloc HMB desc\n"); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + if (bus_dmamap_load(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map, + ctrlr->hmb_desc_vaddr, size, nvme_single_map, + &ctrlr->hmb_desc_paddr, BUS_DMA_NOWAIT) != 0) { + bus_dmamem_free(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_vaddr, + ctrlr->hmb_desc_map); + nvme_printf(ctrlr, "failed to load HMB desc\n"); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + ctrlr->hmb_desc_vaddr[i].addr = + htole64(ctrlr->hmb_chunks[i].hmbc_paddr); + ctrlr->hmb_desc_vaddr[i].size = htole32(ctrlr->hmb_chunk / 4096); + } + bus_dmamap_sync(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map, + BUS_DMASYNC_PREWRITE); + + nvme_printf(ctrlr, "Allocated %lluMB host memory buffer\n", + (long long unsigned)ctrlr->hmb_nchunks * ctrlr->hmb_chunk + / 1024 / 1024); +} + +static void +nvme_ctrlr_hmb_enable(struct nvme_controller *ctrlr, bool enable, bool memret) +{ + struct nvme_completion_poll_status status; + uint32_t cdw11; + + cdw11 = 0; + if (enable) + cdw11 |= 1; + if (memret) + cdw11 |= 2; + status.done = 0; + nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_HOST_MEMORY_BUFFER, cdw11, + ctrlr->hmb_nchunks * ctrlr->hmb_chunk / 4096, ctrlr->hmb_desc_paddr, + ctrlr->hmb_desc_paddr >> 32, ctrlr->hmb_nchunks, NULL, 0, + nvme_completion_poll_cb, &status); + nvme_completion_poll(&status); + if (nvme_completion_is_error(&status.cpl)) + nvme_printf(ctrlr, "nvme_ctrlr_hmb_enable failed!\n"); +} + +static void nvme_ctrlr_start(void *ctrlr_arg, bool resetting) { struct nvme_controller *ctrlr = ctrlr_arg; @@ -888,6 +1051,13 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) } } + if (ctrlr->cdata.hmpre > 0 && ctrlr->hmb_nchunks == 0) { + nvme_ctrlr_hmb_alloc(ctrlr); + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, true, false); + } else if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, true, true); + if (nvme_ctrlr_create_qpairs(ctrlr) != 0) { nvme_ctrlr_fail(ctrlr); return; @@ -1240,11 +1410,15 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev destroy_dev(ctrlr->cdev); if (ctrlr->is_initialized) { - if (!gone) + if (!gone) { + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, false, false); nvme_ctrlr_delete_qpairs(ctrlr); + } for (i = 0; i < ctrlr->num_io_queues; i++) nvme_io_qpair_destroy(&ctrlr->ioq[i]); free(ctrlr->ioq, M_NVME); + nvme_ctrlr_hmb_free(ctrlr); nvme_admin_qpair_destroy(&ctrlr->adminq); } @@ -1367,6 +1541,9 @@ nvme_ctrlr_suspend(struct nvme_controller *ctrlr) "Competing reset task didn't finish. Try again later.\n"); return (EWOULDBLOCK); } + + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, false, false); /* * Per Section 7.6.2 of NVMe spec 1.4, to properly suspend, we need to Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jan 7 21:16:30 2020 (r356473) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jan 7 21:17:11 2020 (r356474) @@ -166,7 +166,8 @@ nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ct void nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctrlr, uint8_t feature, - uint32_t cdw11, void *payload, uint32_t payload_size, + uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, uint32_t cdw14, + uint32_t cdw15, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; @@ -178,6 +179,10 @@ nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctr cmd->opc = NVME_OPC_SET_FEATURES; cmd->cdw10 = htole32(feature); cmd->cdw11 = htole32(cdw11); + cmd->cdw12 = htole32(cdw12); + cmd->cdw13 = htole32(cdw13); + cmd->cdw14 = htole32(cdw14); + cmd->cdw15 = htole32(cdw15); nvme_ctrlr_submit_admin_request(ctrlr, req); } @@ -208,7 +213,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvme_controller * cdw11 = ((num_queues - 1) << 16) | (num_queues - 1); nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11, - NULL, 0, cb_fn, cb_arg); + 0, 0, 0, 0, NULL, 0, cb_fn, cb_arg); } void @@ -219,8 +224,8 @@ nvme_ctrlr_cmd_set_async_event_config(struct nvme_cont cdw11 = state; nvme_ctrlr_cmd_set_feature(ctrlr, - NVME_FEAT_ASYNC_EVENT_CONFIGURATION, cdw11, NULL, 0, cb_fn, - cb_arg); + NVME_FEAT_ASYNC_EVENT_CONFIGURATION, cdw11, 0, 0, 0, 0, NULL, 0, + cb_fn, cb_arg); } void @@ -245,7 +250,7 @@ nvme_ctrlr_cmd_set_interrupt_coalescing(struct nvme_co cdw11 = ((microseconds/100) << 8) | threshold; nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_INTERRUPT_COALESCING, cdw11, - NULL, 0, cb_fn, cb_arg); + 0, 0, 0, 0, NULL, 0, cb_fn, cb_arg); } void Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Tue Jan 7 21:16:30 2020 (r356473) +++ head/sys/dev/nvme/nvme_private.h Tue Jan 7 21:17:11 2020 (r356474) @@ -279,9 +279,6 @@ struct nvme_controller { struct resource *res; void *tag; - bus_dma_tag_t hw_desc_tag; - bus_dmamap_t hw_desc_map; - /** maximum i/o size in bytes */ uint32_t max_xfer_size; @@ -324,6 +321,20 @@ struct nvme_controller { bool is_failed; STAILQ_HEAD(, nvme_request) fail_req; + + /* Host Memory Buffer */ + int hmb_nchunks; + size_t hmb_chunk; + bus_dma_tag_t hmb_tag; + struct nvme_hmb_chunk { + bus_dmamap_t hmbc_map; + void *hmbc_vaddr; + uint64_t hmbc_paddr; + } *hmb_chunks; + bus_dma_tag_t hmb_desc_tag; + bus_dmamap_t hmb_desc_map; + struct nvme_hmb_desc *hmb_desc_vaddr; + uint64_t hmb_desc_paddr; }; #define nvme_mmio_offsetof(reg) \ From owner-svn-src-head@freebsd.org Tue Jan 7 21:29:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF0A91F361E; Tue, 7 Jan 2020 21:29:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47slrk3Lljz4gBk; Tue, 7 Jan 2020 21:29:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E2365512; Tue, 7 Jan 2020 21:29:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007LTgf9051922; Tue, 7 Jan 2020 21:29:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LTglf051921; Tue, 7 Jan 2020 21:29:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001072129.007LTglf051921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 7 Jan 2020 21:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356475 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 356475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:29:42 -0000 Author: glebius Date: Tue Jan 7 21:29:42 2020 New Revision: 356475 URL: https://svnweb.freebsd.org/changeset/base/356475 Log: Fix a typo - passing wrong mbuf pointer to needs_udp_csum(). Will trigger panic only on a kernel with RATELIMIT. Submitted by: rrs Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jan 7 21:17:11 2020 (r356474) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jan 7 21:29:42 2020 (r356475) @@ -2700,7 +2700,7 @@ restart: V_FW_ETH_TX_EO_WR_TSOFF(sizeof(*tcp) / 2 + 1)); } else set_mbuf_eo_tsclk_tsoff(m0, 0); - } else if (needs_udp_csum(m)) { + } else if (needs_udp_csum(m0)) { m0->m_pkthdr.l4hlen = sizeof(struct udphdr); #endif } From owner-svn-src-head@freebsd.org Tue Jan 7 21:44:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11FA11F3A4F; Tue, 7 Jan 2020 21:44:28 +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 47sm9l6YcPz3CKt; Tue, 7 Jan 2020 21:44:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC2BA58AB; Tue, 7 Jan 2020 21:44:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007LiRHL063463; Tue, 7 Jan 2020 21:44:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LiRb7063462; Tue, 7 Jan 2020 21:44:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001072144.007LiRb7063462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 21:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356476 - head/lib/libjail X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libjail X-SVN-Commit-Revision: 356476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:44:28 -0000 Author: markj Date: Tue Jan 7 21:44:27 2020 New Revision: 356476 URL: https://svnweb.freebsd.org/changeset/base/356476 Log: libjail: Handle an error from reallocarray() when trimming the buffer. There is no API guarantee that realloc() will not fail when the buffer is shrinking. Handle it by simply returning the untrimmed buffer. While this is unlikely to ever happen in practice, it seems worth handling just to silence static analyzer warnings. PR: 243106 Submitted by: Hans Christian Woithe MFC after: 1 week Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Tue Jan 7 21:29:42 2020 (r356475) +++ head/lib/libjail/jail.c Tue Jan 7 21:44:27 2020 (r356476) @@ -262,7 +262,10 @@ jailparam_all(struct jailparam **jpp) goto error; mib1[1] = 2; } - jp = reallocarray(jp, njp, sizeof(*jp)); + /* Just return the untrimmed buffer if reallocarray() somehow fails. */ + tjp = reallocarray(jp, njp, sizeof(*jp)); + if (tjp != NULL) + jp = tjp; *jpp = jp; return (njp); From owner-svn-src-head@freebsd.org Tue Jan 7 21:56:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 305111F3D42; Tue, 7 Jan 2020 21:56:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47smRT0JKvz3CwN; Tue, 7 Jan 2020 21:56:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 014435A94; Tue, 7 Jan 2020 21:56:21 +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 007LuK9K069451; Tue, 7 Jan 2020 21:56:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LuKYN069450; Tue, 7 Jan 2020 21:56:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001072156.007LuKYN069450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 21:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356477 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 356477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:56:21 -0000 Author: markj Date: Tue Jan 7 21:56:20 2020 New Revision: 356477 URL: https://svnweb.freebsd.org/changeset/base/356477 Log: Use a deterministic hash for USDT symbol names. Previously libdtrace used ftok(3), which hashes the inode number of the input object file. To increase reproducibility of builds that embed USDT probes, include a hash of the object file path in the symbol name instead. Reported and tested by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Jan 7 21:44:27 2020 (r356476) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Jan 7 21:56:20 2020 (r356477) @@ -57,7 +57,6 @@ #include #endif #include -#include #include #include @@ -1249,13 +1248,32 @@ dt_link_error(dtrace_hdl_t *dtp, Elf *elf, int fd, dt_ return (dt_set_errno(dtp, EDT_COMPILER)); } +/* + * Provide a unique identifier used when adding global symbols to an object. + * This is the FNV-1a hash of an absolute path for the file. + */ +static unsigned int +hash_obj(const char *obj, int fd) +{ + char path[PATH_MAX]; + unsigned int h; + + if (realpath(obj, path) == NULL) + return (-1); + + for (h = 2166136261u, obj = &path[0]; *obj != '\0'; obj++) + h = (h ^ *obj) * 16777619; + h &= 0x7fffffff; + return (h); +} + static int process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) { static const char dt_prefix[] = "__dtrace"; static const char dt_enabled[] = "enabled"; static const char dt_symprefix[] = "$dtrace"; - static const char dt_symfmt[] = "%s%ld.%s"; + static const char dt_symfmt[] = "%s%u.%s"; static const char dt_weaksymfmt[] = "%s.%s"; char probename[DTRACE_NAMELEN]; int fd, i, ndx, eprobe, mod = 0; @@ -1272,7 +1290,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e dt_probe_t *prp; uint32_t off, eclass, emachine1, emachine2; size_t symsize, osym, nsym, isym, istr, len; - key_t objkey; + unsigned int objkey; dt_link_pair_t *pair, *bufs = NULL; dt_strtab_t *strtab; void *tmp; @@ -1350,10 +1368,9 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * system in order to disambiguate potential conflicts between files of * the same name which contain identially named local symbols. */ - if ((objkey = ftok(obj, 0)) == (key_t)-1) { + if ((objkey = hash_obj(obj, fd)) == (unsigned int)-1) return (dt_link_error(dtp, elf, fd, bufs, "failed to generate unique key for object file: %s", obj)); - } scn_rel = NULL; while ((scn_rel = elf_nextscn(elf, scn_rel)) != NULL) { From owner-svn-src-head@freebsd.org Tue Jan 7 21:56:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52FEB1F3D82; Tue, 7 Jan 2020 21:56:29 +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 47smRd1c21z3D3N; Tue, 7 Jan 2020 21:56:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327805A96; Tue, 7 Jan 2020 21:56:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007LuT4m069501; Tue, 7 Jan 2020 21:56:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007LuTwa069500; Tue, 7 Jan 2020 21:56:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001072156.007LuTwa069500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Jan 2020 21:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356478 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 21:56:29 -0000 Author: jhb Date: Tue Jan 7 21:56:28 2020 New Revision: 356478 URL: https://svnweb.freebsd.org/changeset/base/356478 Log: Don't fail universe kernel stage for TARGET_ARCHes without a kernel config. This fixes a regression in r356418 where the entire universe would fail early due to an undefined make target when a given TARGET_ARCH had no associated kernel configs. This is true for all of the hard-float mips TARGET_ARCHes currently. Pointy hat to: me Reviewed by: emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D23071 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jan 7 21:56:20 2020 (r356477) +++ head/Makefile Tue Jan 7 21:56:28 2020 (r356478) @@ -728,6 +728,7 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE .endfor .for target_arch in ${TARGET_ARCHES_${TARGET}} universe_kernconfs: universe_kernconfs_${target_arch} .PHONY +universe_kernconfs_${target_arch}: .endfor .endif # make(universe_kernels) universe: universe_epilogue From owner-svn-src-head@freebsd.org Tue Jan 7 22:45:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D441D1F4D75; Tue, 7 Jan 2020 22:45:02 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47snWf514Vz3GS2; Tue, 7 Jan 2020 22:45:02 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2CA864FE; Tue, 7 Jan 2020 22:45:02 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007Mj2Jj098844; Tue, 7 Jan 2020 22:45:02 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007Mj2lK098843; Tue, 7 Jan 2020 22:45:02 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202001072245.007Mj2lK098843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 7 Jan 2020 22:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356479 - head/lib/clang/libllvmminimal X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/clang/libllvmminimal X-SVN-Commit-Revision: 356479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 22:45:02 -0000 Author: bdragon Date: Tue Jan 7 22:45:02 2020 New Revision: 356479 URL: https://svnweb.freebsd.org/changeset/base/356479 Log: [PowerPC] Fix libllvmminimal build when building from powerpc64 ELFv1. When bootstrapping on powerpc64 ELFv1, it is necessary to use binutils ld.bfd from ports for the bootstrap, as this is the only modern linker for ELFv1 host tools. As binutils ld.bfd is rather strict in its handling of undefined symbols, it is necessary to pull in Support/Atomic.cpp to avoid an undefined symbol. Reviewed by: dim, emaste Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23072 Modified: head/lib/clang/libllvmminimal/Makefile Modified: head/lib/clang/libllvmminimal/Makefile ============================================================================== --- head/lib/clang/libllvmminimal/Makefile Tue Jan 7 21:56:28 2020 (r356478) +++ head/lib/clang/libllvmminimal/Makefile Tue Jan 7 22:45:02 2020 (r356479) @@ -10,6 +10,7 @@ SRCS+= Demangle/ItaniumDemangle.cpp SRCS+= Support/APFloat.cpp SRCS+= Support/APInt.cpp SRCS+= Support/ARMTargetParser.cpp +SRCS+= Support/Atomic.cpp SRCS+= Support/CodeGenCoverage.cpp SRCS+= Support/CommandLine.cpp SRCS+= Support/ConvertUTF.cpp From owner-svn-src-head@freebsd.org Tue Jan 7 23:10:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E3321F564A; Tue, 7 Jan 2020 23:10:39 +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 47sp5C2plBz3HvQ; Tue, 7 Jan 2020 23:10:39 +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 5BC0F690C; Tue, 7 Jan 2020 23:10:39 +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 007NAd1k011347; Tue, 7 Jan 2020 23:10:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007NAdmV011346; Tue, 7 Jan 2020 23:10:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001072310.007NAdmV011346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 7 Jan 2020 23:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356480 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 356480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 23:10:39 -0000 Author: mav Date: Tue Jan 7 23:10:38 2020 New Revision: 356480 URL: https://svnweb.freebsd.org/changeset/base/356480 Log: Increate HMB limit from 1% to 5%. SSD capacity in laptops is growing faster then RAM size, so my original guess seems too low on second thought. Hopefully nobody will build large array of those crappy SSDs. MFC after: 2 weeks X-MFC-with: 356474 Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 22:45:02 2020 (r356479) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 23:10:38 2020 (r356480) @@ -881,8 +881,8 @@ nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) int err, i; uint64_t max; - /* Limit HMB to 1% of RAM size per device by default. */ - max = (uint64_t)physmem * PAGE_SIZE / 100; + /* Limit HMB to 5% of RAM size per device by default. */ + max = (uint64_t)physmem * PAGE_SIZE / 20; TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); min = (long long unsigned)ctrlr->cdata.hmmin * 4096; From owner-svn-src-head@freebsd.org Tue Jan 7 23:18:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15E851F5865; Tue, 7 Jan 2020 23:18:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47spGH6kCPz3JLM; Tue, 7 Jan 2020 23:18:31 +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 DDA456AC0; Tue, 7 Jan 2020 23:18:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007NIVjm017248; Tue, 7 Jan 2020 23:18:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007NIVqE017246; Tue, 7 Jan 2020 23:18:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001072318.007NIVqE017246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Jan 2020 23:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356481 - in head/sys: conf riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: conf riscv/riscv X-SVN-Commit-Revision: 356481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 23:18:32 -0000 Author: jhb Date: Tue Jan 7 23:18:31 2020 New Revision: 356481 URL: https://svnweb.freebsd.org/changeset/base/356481 Log: Work around lld's inability to handle undefined weak symbols on risc-v. lld on RISC-V is not yet able to handle undefined weak symbols for non-PIC code in the code model (medany/medium) used by the RISC-V kernel. Both GCC and clang emit an auipc / addi pair of instructions to generate an address relative to the current PC with a 31-bit offset. Undefined weak symbols need to have an address of 0, but the kernel runs with PC values much greater than 2^31, so there is no way to construct a NULL pointer as a PC-relative value. The bfd linker rewrites the instruction pair to use lui / addi with values of 0 to force a NULL pointer address. (There are similar cases for 'ld' becoming auipc / ld that bfd rewrites to lui / ld with an address of 0.) To work around this, compile the kernel with -fPIE when using lld. This does not make the kernel position-independent, but it does force the compiler to indirect address lookups through GOT entries (so auipc / ld against a GOT entry to fetch the address). This adds extra memory indirections for global symbols, so should be disabled once lld is finally fixed. A few 'la' instructions in locore that depend on PC-relative addressing to load physical addresses before paging is enabled have to use auipc / addi and not indirect via GOT entries, so change those to use 'lla' which always uses auipc / addi for both PIC and non-PIC. Submitted by: jrtc27 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23064 Modified: head/sys/conf/kern.pre.mk head/sys/riscv/riscv/locore.S Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 7 23:10:38 2020 (r356480) +++ head/sys/conf/kern.pre.mk Tue Jan 7 23:18:31 2020 (r356481) @@ -170,6 +170,17 @@ LDFLAGS+= -z notext -z ifunc-noplt .endif .endif +.if ${MACHINE_CPUARCH} == "riscv" +# Hack: Work around undefined weak symbols being out of range when linking with +# LLD (address is a PC-relative calculation, and BFD works around this by +# rewriting the instructions to generate an absolute address of 0); -fPIE +# avoids this since it uses the GOT for all extern symbols, which is overly +# inefficient for us. Drop once undefined weak symbols work with medany. +.if ${LINKER_TYPE} == "lld" +CFLAGS+= -fPIE +.endif +.endif + NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Tue Jan 7 23:10:38 2020 (r356480) +++ head/sys/riscv/riscv/locore.S Tue Jan 7 23:18:31 2020 (r356481) @@ -54,7 +54,7 @@ .globl _start _start: /* Get the physical address kernel loaded to */ - la t0, virt_map + lla t0, virt_map ld t1, 0(t0) sub t1, t1, t0 li t2, KERNBASE @@ -66,7 +66,7 @@ _start: */ /* Pick a hart to run the boot process. */ - la t0, hart_lottery + lla t0, hart_lottery li t1, 1 amoadd.w t0, t1, 0(t0) @@ -82,8 +82,8 @@ _start: */ 1: /* Add L1 entry for kernel */ - la s1, pagetable_l1 - la s2, pagetable_l2 /* Link to next level PN */ + lla s1, pagetable_l1 + lla s2, pagetable_l2 /* Link to next level PN */ srli s2, s2, PAGE_SHIFT li a5, KERNBASE @@ -100,7 +100,7 @@ _start: sd t6, (t0) /* Level 2 superpages (512 x 2MiB) */ - la s1, pagetable_l2 + lla s1, pagetable_l2 srli t4, s9, 21 /* Div physmem base by 2 MiB */ li t2, 512 /* Build 512 entries */ add t3, t4, t2 @@ -116,8 +116,8 @@ _start: bltu t4, t3, 2b /* Create an L1 page for early devmap */ - la s1, pagetable_l1 - la s2, pagetable_l2_devmap /* Link to next level PN */ + lla s1, pagetable_l1 + lla s2, pagetable_l2_devmap /* Link to next level PN */ srli s2, s2, PAGE_SHIFT li a5, (VM_MAX_KERNEL_ADDRESS - L2_SIZE) @@ -134,7 +134,7 @@ _start: sd t6, (t0) /* Create an L2 page superpage for DTB */ - la s1, pagetable_l2_devmap + lla s1, pagetable_l2_devmap mv s2, a1 srli s2, s2, PAGE_SHIFT @@ -152,14 +152,14 @@ _start: /* Page tables END */ /* Setup supervisor trap vector */ - la t0, va + lla t0, va sub t0, t0, s9 li t1, KERNBASE add t0, t0, t1 csrw stvec, t0 /* Set page tables base register */ - la s2, pagetable_l1 + lla s2, pagetable_l1 srli s2, s2, PAGE_SHIFT li t0, SATP_MODE_SV39 or s2, s2, t0 From owner-svn-src-head@freebsd.org Tue Jan 7 23:29:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 005881F5B7A; Tue, 7 Jan 2020 23:29:55 +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 47spWQ6Hm5z3JpB; Tue, 7 Jan 2020 23:29:54 +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 D33E46C8F; Tue, 7 Jan 2020 23:29:54 +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 007NTsPE022988; Tue, 7 Jan 2020 23:29:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007NTslE022986; Tue, 7 Jan 2020 23:29:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001072329.007NTslE022986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 7 Jan 2020 23:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356482 - in head: share/man/man4 sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/nvme X-SVN-Commit-Revision: 356482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 23:29:55 -0000 Author: mav Date: Tue Jan 7 23:29:54 2020 New Revision: 356482 URL: https://svnweb.freebsd.org/changeset/base/356482 Log: Minor adjustments to r356474 and r356480. Reported by: jkim, imp MFC after: 2 weeks X-MFC-with: r356474 Modified: head/share/man/man4/nvme.4 head/sys/dev/nvme/nvme_ctrlr.c Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Tue Jan 7 23:18:31 2020 (r356481) +++ head/share/man/man4/nvme.4 Tue Jan 7 23:29:54 2020 (r356482) @@ -126,7 +126,7 @@ Buffer for capable devices, set the following tunable: hw.nvme.hmb_max .Ed .Pp -The default value is 1% of physical memory size per device. +The default value is 5% of physical memory size per device. .Pp The .Xr nvd 4 Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 23:18:31 2020 (r356481) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 23:29:54 2020 (r356482) @@ -886,7 +886,7 @@ nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); min = (long long unsigned)ctrlr->cdata.hmmin * 4096; - if (max < min) + if (max == 0 || max < min) return; pref = MIN((long long unsigned)ctrlr->cdata.hmpre * 4096, max); minc = MAX(ctrlr->cdata.hmminds * 4096, PAGE_SIZE); From owner-svn-src-head@freebsd.org Tue Jan 7 23:30:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 293791F5C08 for ; Tue, 7 Jan 2020 23:30:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 47spXN61Qyz3JxN for ; Tue, 7 Jan 2020 23:30:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id d18so1248058qtj.10 for ; Tue, 07 Jan 2020 15:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BSngzVfvY/agjI1pdvDX420nzK1Dwm8FKf9fIIfbjps=; b=Cwef7ab4X129OarwFy4ynAoABQp3s3rr1tZVD3v4sxsXfhsgd8Nz6/oCw89kUQ5YII MsB56myeKphPVwdOYAnfVuMqTN3jl6bYHM35PRJZlhwS0lehXRdRcv4n3afdpWNKfWxp XwhPvVijcU0cXmm4pQxZbQYghQ4GdSPA8r9eObFMMYcJsoUhxECUG+wxaTNpXcYCW0W8 s9wL2hsNLUmCcW4DcnK44WUQ9JFnaT36HpLTPgOzMxvE2F/Ebys66u5/OaRjyosTK74O 9ETYnTnIHcDIDQg9OZh//nO+MDr118870gqvK4FqSzf2gk7J3pu494XMXnDGZVPFq0TQ GMCQ== 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=BSngzVfvY/agjI1pdvDX420nzK1Dwm8FKf9fIIfbjps=; b=CBPTkpmz+B3JpP1a9kkOkqcqvxdoCKto5KWeooVaUw121BwGhA4mx4KwuwIFGU8BuA Qgo4vCJIRguZuJza5m1Z7BF9pycfWNMBicC6VYPAjgCjAXAWj7TOjeo4+d8x0s6KtMWY psytA79YOVPNBJ968QHRqpS0utpj+sGUjUrFmIpmFXP2Rfcn0gpQODXeGKVooVveVeVH Wnq2Sehe5QtfdlPL9A8yw43kcOVViqlLej3azPOj56u35/jolQLio5MZKnlbBm3JYtsn Q6tNM8d2mGs+Na+i6zE9FpXCe3lA00xRk6Cq10Xpm7zTxkZZA2jincPf/FP+B4J3JZG3 wFuw== X-Gm-Message-State: APjAAAV8y1Ln9xDSDMx/SbOb6DuHVIasjLgenUkVK5SScyncpRS5/I9q zLfMsWMw1O7pXZ+PfclmhXKXnKqEnl1CLgXs3ilpfg== X-Google-Smtp-Source: APXvYqy0gY2Hom+YRTSDy8oJinKpV9U/lqG/ytFU/shCQbM32/NqWbd9QBs2fmLsYzPf6JjVFmfaZ3jjWpY6AFgLz5U= X-Received: by 2002:ac8:490f:: with SMTP id e15mr1256217qtq.32.1578439843948; Tue, 07 Jan 2020 15:30:43 -0800 (PST) MIME-Version: 1.0 References: <202001072310.007NAdmV011346@repo.freebsd.org> In-Reply-To: <202001072310.007NAdmV011346@repo.freebsd.org> From: Warner Losh Date: Tue, 7 Jan 2020 16:30:32 -0700 Message-ID: Subject: Re: svn commit: r356480 - head/sys/dev/nvme To: Alexander Motin Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47spXN61Qyz3JxN X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Cwef7ab4; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::829) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.66 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.67)[ip: (-9.30), ipnet: 2607:f8b0::/32(-2.12), asn: 15169(-1.85), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 23:30:46 -0000 On Tue, Jan 7, 2020 at 4:10 PM Alexander Motin wrote: > Author: mav > Date: Tue Jan 7 23:10:38 2020 > New Revision: 356480 > URL: https://svnweb.freebsd.org/changeset/base/356480 > > Log: > Increate HMB limit from 1% to 5%. > > SSD capacity in laptops is growing faster then RAM size, so my original > guess seems too low on second thought. Hopefully nobody will build large > array of those crappy SSDs. > If they do, they will likely want to turn off host buffer support anyway, since it uses PCIe bandwidth and large arrays tend to oversubscribe the PCIe bus... Warner > MFC after: 2 weeks > X-MFC-with: 356474 > > Modified: > head/sys/dev/nvme/nvme_ctrlr.c > > Modified: head/sys/dev/nvme/nvme_ctrlr.c > > ============================================================================== > --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 22:45:02 2020 > (r356479) > +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 23:10:38 2020 > (r356480) > @@ -881,8 +881,8 @@ nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) > int err, i; > uint64_t max; > > - /* Limit HMB to 1% of RAM size per device by default. */ > - max = (uint64_t)physmem * PAGE_SIZE / 100; > + /* Limit HMB to 5% of RAM size per device by default. */ > + max = (uint64_t)physmem * PAGE_SIZE / 20; > TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); > > min = (long long unsigned)ctrlr->cdata.hmmin * 4096; > From owner-svn-src-head@freebsd.org Wed Jan 8 07:25:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BA2F1FDBB6; Wed, 8 Jan 2020 07:25:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47t14K6NvWz49wq; Wed, 8 Jan 2020 07:25:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1CDAC657; Wed, 8 Jan 2020 07:25:37 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0087PbS8009040; Wed, 8 Jan 2020 07:25:37 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0087PbMj009039; Wed, 8 Jan 2020 07:25:37 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202001080725.0087PbMj009039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 8 Jan 2020 07:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356483 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 07:25:38 -0000 Author: mmel Date: Wed Jan 8 07:25:37 2020 New Revision: 356483 URL: https://svnweb.freebsd.org/changeset/base/356483 Log: Switch 32-bit arm back to LLVM libunwind. Actual LLVM libunwind passed all testing without issues, switch back to it. PR: 233664 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Jan 7 23:29:54 2020 (r356482) +++ head/share/mk/src.opts.mk Wed Jan 8 07:25:37 2020 (r356483) @@ -317,7 +317,7 @@ BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BO .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif -.if ${__T} != "armv6" && ${__T} != "armv7" && ${__T} != "sparc64" +.if ${__T} != "sparc64" __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND From owner-svn-src-head@freebsd.org Wed Jan 8 09:29:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE7F01E887B; Wed, 8 Jan 2020 09:29:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47t3pv4zr5z4H13; Wed, 8 Jan 2020 09:29:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 0089Suks040892 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 8 Jan 2020 11:28:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0089Suks040892 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 0089SuJY040891; Wed, 8 Jan 2020 11:28:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 8 Jan 2020 11:28:56 +0200 From: Konstantin Belousov To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356480 - head/sys/dev/nvme Message-ID: <20200108092856.GW23031@kib.kiev.ua> References: <202001072310.007NAdmV011346@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001072310.007NAdmV011346@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 47t3pv4zr5z4H13 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 09:29:12 -0000 On Tue, Jan 07, 2020 at 11:10:39PM +0000, Alexander Motin wrote: > Author: mav > Date: Tue Jan 7 23:10:38 2020 > New Revision: 356480 > URL: https://svnweb.freebsd.org/changeset/base/356480 > > Log: > Increate HMB limit from 1% to 5%. > > SSD capacity in laptops is growing faster then RAM size, so my original > guess seems too low on second thought. Hopefully nobody will build large > array of those crappy SSDs. It seems that this should be a knob. > > MFC after: 2 weeks > X-MFC-with: 356474 > > Modified: > head/sys/dev/nvme/nvme_ctrlr.c > > Modified: head/sys/dev/nvme/nvme_ctrlr.c > ============================================================================== > --- head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 22:45:02 2020 (r356479) > +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Jan 7 23:10:38 2020 (r356480) > @@ -881,8 +881,8 @@ nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) > int err, i; > uint64_t max; > > - /* Limit HMB to 1% of RAM size per device by default. */ > - max = (uint64_t)physmem * PAGE_SIZE / 100; > + /* Limit HMB to 5% of RAM size per device by default. */ > + max = (uint64_t)physmem * PAGE_SIZE / 20; > TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); > > min = (long long unsigned)ctrlr->cdata.hmmin * 4096; From owner-svn-src-head@freebsd.org Wed Jan 8 10:06:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3099B1E9934; Wed, 8 Jan 2020 10:06:33 +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 47t4f10X0rz4K29; Wed, 8 Jan 2020 10:06:33 +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 0D52BE3C2; Wed, 8 Jan 2020 10:06:33 +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 008A6W5x003824; Wed, 8 Jan 2020 10:06:32 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008A6WWO003823; Wed, 8 Jan 2020 10:06:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001081006.008A6WWO003823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 8 Jan 2020 10:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356484 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 356484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 10:06:33 -0000 Author: kp Date: Wed Jan 8 10:06:32 2020 New Revision: 356484 URL: https://svnweb.freebsd.org/changeset/base/356484 Log: vtnet: Pre-allocate debugnet data immediately Don't wait until the vtnet_debugnet_init() call happens, because at that point we might already have allocated something from vtnet_tx_header_zone. Some systems showed this panic: vtnet0: link state changed to UP panic: keg vtnet_tx_hdr initialization after use. cpuid = 5 time = 1578427700 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004db427f0 vpanic() at vpanic+0x17e/frame 0xfffffe004db42850 panic() at panic+0x43/frame 0xfffffe004db428b0 uma_zone_reserve() at uma_zone_reserve+0xf6/frame 0xfffffe004db428f0 vtnet_debugnet_init() at vtnet_debugnet_init+0x77/frame 0xfffffe004db42930 debugnet_any_ifnet_update() at debugnet_any_ifnet_update+0x42/frame 0xfffffe004db42980 do_link_state_change() at do_link_state_change+0x1b3/frame 0xfffffe004db429d0 taskqueue_run_locked() at taskqueue_run_locked+0x178/frame 0xfffffe004db42a30 taskqueue_run() at taskqueue_run+0x4d/frame 0xfffffe004db42a50 ithread_loop() at ithread_loop+0x1d6/frame 0xfffffe004db42ab0 fork_exit() at fork_exit+0x80/frame 0xfffffe004db42af0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004db42af0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 12 tid 100011 ] Stopped at kdb_enter+0x37: movq $0,0x1084eb6(%rip) db> Reviewed by: cem, markj Differential Revision: https://reviews.freebsd.org/D23073 Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Wed Jan 8 07:25:37 2020 (r356483) +++ head/sys/dev/virtio/network/if_vtnet.c Wed Jan 8 10:06:32 2020 (r356484) @@ -337,10 +337,21 @@ vtnet_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: - if (loaded++ == 0) + if (loaded++ == 0) { vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", sizeof(struct vtnet_tx_header), NULL, NULL, NULL, NULL, 0, 0); +#ifdef DEBUGNET + /* + * We need to allocate from this zone in the transmit path, so ensure + * that we have at least one item per header available. + * XXX add a separate zone like we do for mbufs? otherwise we may alloc + * buckets + */ + uma_zone_reserve(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2); + uma_prealloc(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2); +#endif + } break; case MOD_QUIESCE: if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) @@ -3982,15 +3993,6 @@ vtnet_debugnet_init(struct ifnet *ifp, int *nrxr, int *ncl = DEBUGNET_MAX_IN_FLIGHT; *clsize = sc->vtnet_rx_clsize; VTNET_CORE_UNLOCK(sc); - - /* - * We need to allocate from this zone in the transmit path, so ensure - * that we have at least one item per header available. - * XXX add a separate zone like we do for mbufs? otherwise we may alloc - * buckets - */ - uma_zone_reserve(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2); - uma_prealloc(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2); } static void From owner-svn-src-head@freebsd.org Wed Jan 8 11:29:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60F781EB3A7; Wed, 8 Jan 2020 11:29:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47t6Tb1wNxz4NR0; Wed, 8 Jan 2020 11:29:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D307F2B8; Wed, 8 Jan 2020 11:29:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008BTNGg051738; Wed, 8 Jan 2020 11:29:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008BTNa5051737; Wed, 8 Jan 2020 11:29:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001081129.008BTNa5051737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Jan 2020 11:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356485 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 356485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 11:29:23 -0000 Author: manu Date: Wed Jan 8 11:29:22 2020 New Revision: 356485 URL: https://svnweb.freebsd.org/changeset/base/356485 Log: rk808: Add min/max for the switch regulators The two switch regulator are always 3.0V. Add a special case in get_voltage that if min=max we directly return the value without calculating it. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D23004 Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Wed Jan 8 10:06:32 2020 (r356484) +++ head/sys/arm64/rockchip/rk805.c Wed Jan 8 11:29:22 2020 (r356485) @@ -204,6 +204,7 @@ static struct rk805_regdef rk808_regdefs[] = { .voltage_nstep = 64, }, { + /* BUCK3 voltage is calculated based on external resistor */ .id = RK805_DCDC3, .name = "DCDC_REG3", .enable_reg = RK805_DCDC_EN, @@ -322,12 +323,16 @@ static struct rk805_regdef rk808_regdefs[] = { .name = "SWITCH_REG1", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x20, + .voltage_min = 3000000, + .voltage_max = 3000000, }, { .id = RK808_SWITCH2, .name = "SWITCH_REG2", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x40, + .voltage_min = 3000000, + .voltage_max = 3000000, }, }; @@ -449,6 +454,11 @@ rk805_regnode_get_voltage(struct regnode *regnode, int uint8_t val; sc = regnode_get_softc(regnode); + + if (sc->def->voltage_min == sc->def->voltage_max) { + *uvolt = sc->def->voltage_min; + return (0); + } if (!sc->def->voltage_step) return (ENXIO); From owner-svn-src-head@freebsd.org Wed Jan 8 11:30:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6901D1EB45C; Wed, 8 Jan 2020 11:30:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47t6VN2DY1z4NZL; Wed, 8 Jan 2020 11:30:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47CB3F2CC; Wed, 8 Jan 2020 11:30:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008BU4he051849; Wed, 8 Jan 2020 11:30:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008BU4Qh051848; Wed, 8 Jan 2020 11:30:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001081130.008BU4Qh051848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Jan 2020 11:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356486 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 356486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 11:30:04 -0000 Author: manu Date: Wed Jan 8 11:30:03 2020 New Revision: 356486 URL: https://svnweb.freebsd.org/changeset/base/356486 Log: rk805: Add regnode_status method This allow consumers to check if the regulator is enable or not. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D23005 Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Wed Jan 8 11:29:22 2020 (r356485) +++ head/sys/arm64/rockchip/rk805.c Wed Jan 8 11:30:03 2020 (r356486) @@ -413,6 +413,22 @@ rk805_regnode_voltage_to_reg(struct rk805_reg_sc *sc, } static int +rk805_regnode_status(struct regnode *regnode, int *status) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + *status = 0; + rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (val & sc->def->enable_mask) + *status = REGULATOR_STATUS_ENABLED; + + return (0); +} + +static int rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { @@ -477,6 +493,7 @@ static regnode_method_t rk805_regnode_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, rk805_regnode_init), REGNODEMETHOD(regnode_enable, rk805_regnode_enable), + REGNODEMETHOD(regnode_status, rk805_regnode_status), REGNODEMETHOD(regnode_set_voltage, rk805_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, rk805_regnode_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), From owner-svn-src-head@freebsd.org Wed Jan 8 11:30:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 654D81EB4E3; Wed, 8 Jan 2020 11:30:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47t6W725LPz4Nk5; Wed, 8 Jan 2020 11:30:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 430CAF2EE; Wed, 8 Jan 2020 11:30:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008BUhkd051921; Wed, 8 Jan 2020 11:30:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008BUh3V051920; Wed, 8 Jan 2020 11:30:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001081130.008BUh3V051920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Jan 2020 11:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356487 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 356487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 11:30:43 -0000 Author: manu Date: Wed Jan 8 11:30:42 2020 New Revision: 356487 URL: https://svnweb.freebsd.org/changeset/base/356487 Log: regulator: fix regnode_method_get_voltage This method is supposed to write the voltage into uvolt and return an errno compatible value. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D23006 Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Wed Jan 8 11:30:03 2020 (r356486) +++ head/sys/dev/extres/regulator/regulator.c Wed Jan 8 11:30:42 2020 (r356487) @@ -275,8 +275,9 @@ static int regnode_method_get_voltage(struct regnode *regnode, int *uvolt) { - return (regnode->std_param.min_uvolt + - (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2); + *uvolt = regnode->std_param.min_uvolt + + (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2; + return (0); } int From owner-svn-src-head@freebsd.org Wed Jan 8 14:01:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2FF31EF862; Wed, 8 Jan 2020 14:01:15 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47t9rq6FtLz4Wk4; Wed, 8 Jan 2020 14:01:15 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D21A819036; Wed, 8 Jan 2020 14:01:15 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008E1FfV042483; Wed, 8 Jan 2020 14:01:15 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008E1FtH042482; Wed, 8 Jan 2020 14:01:15 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <202001081401.008E1FtH042482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Wed, 8 Jan 2020 14:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356488 - head/usr.sbin/bsdinstall X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/usr.sbin/bsdinstall X-SVN-Commit-Revision: 356488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 14:01:16 -0000 Author: maxim Date: Wed Jan 8 14:01:15 2020 New Revision: 356488 URL: https://svnweb.freebsd.org/changeset/base/356488 Log: o Spell "Redundancy" and "Remember" correctly. PR: 243187 Submitted by: mikael.urankar@gmail.com (partially) Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Wed Jan 8 11:30:42 2020 (r356487) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Wed Jan 8 14:01:15 2020 (r356488) @@ -336,8 +336,8 @@ Default: The type of pool to be created for the base system. This variable can take one of this values: stripe (No redundacy), mirror (n-Way mirroring), raid10 (RAID 1+0 - n x 2-Way Mirrors), -raidz1 (RAID-Z1 - Single Redundacy RAID), raidz2 (RAID-Z2 - Double Redundacy RAID) -or raidz3 (RAID-Z3 Triple Redundacy RAID). +raidz1 (RAID-Z1 - Single Redundancy RAID), raidz2 (RAID-Z2 - Double Redundancy RAID) +or raidz3 (RAID-Z3 Triple Redundancy RAID). Default: .Dq stripe .It Ev ZFSBOOT_FORCE_4K_SECTORS @@ -505,7 +505,7 @@ ZFSBOOT_DISKS="ada0 ada1" ZFSBOOT_VDEV_TYPE=mirror .Ed .Pp -Remenber to export all the variables for the +Remember to export all the variables for the .Cm zfsboot command, otherwise it will not get set. .Ss SETUP SCRIPT From owner-svn-src-head@freebsd.org Wed Jan 8 16:57:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 043871F44E4; Wed, 8 Jan 2020 16:57:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tFlm6JQtz3KdD; Wed, 8 Jan 2020 16:57:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D39201B1B6; Wed, 8 Jan 2020 16:57:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008Gv8I6056125; Wed, 8 Jan 2020 16:57:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008Gv837056124; Wed, 8 Jan 2020 16:57:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001081657.008Gv837056124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Jan 2020 16:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356494 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 356494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 16:57:09 -0000 Author: markj Date: Wed Jan 8 16:57:08 2020 New Revision: 356494 URL: https://svnweb.freebsd.org/changeset/base/356494 Log: linprocfs: Fix some bugs in the maps file implementation. - Export the offset into the backing object, not the object size. - Fix a bug where we would print the previous entry's "offset" when a map_entry has no object. - Try to identify shared mappings. Linux prints "s" when the mapping "may be shared". This attempt is not perfect, for example, we print "p" for anonymous memory that may be shared via minherit(INHERIT_SHARE). PR: 240992 Reviewed by: kib MFC after: 1 week MFC note: no OBJ_ANON in stable/12 Differential Revision: https://reviews.freebsd.org/D23062 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Jan 8 16:32:16 2020 (r356493) +++ head/sys/compat/linprocfs/linprocfs.c Wed Jan 8 16:57:08 2020 (r356494) @@ -1146,7 +1146,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; - vm_ooffset_t off = 0; + vm_ooffset_t off; vm_prot_t e_prot; unsigned int last_timestamp; char *name = "", *freename = NULL; @@ -1156,6 +1156,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) int error; struct vnode *vp; struct vattr vat; + bool private; PROC_LOCK(p); error = p_candebug(td, p); @@ -1186,17 +1187,20 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) e_start = entry->start; e_end = entry->end; obj = entry->object.vm_object; - for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { + off = entry->offset; + for (lobj = tobj = obj; tobj != NULL; + lobj = tobj, tobj = tobj->backing_object) { VM_OBJECT_RLOCK(tobj); + off += lobj->backing_object_offset; if (lobj != obj) VM_OBJECT_RUNLOCK(lobj); - lobj = tobj; } + private = (entry->eflags & MAP_ENTRY_COW) != 0 || obj == NULL || + (obj->flags & OBJ_ANON) != 0; last_timestamp = map->timestamp; vm_map_unlock_read(map); ino = 0; if (lobj) { - off = IDX_TO_OFF(lobj->size); vp = vm_object_vnode(lobj); if (vp != NULL) vref(vp); @@ -1233,7 +1237,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) (e_prot & VM_PROT_READ)?"r":"-", (e_prot & VM_PROT_WRITE)?"w":"-", (e_prot & VM_PROT_EXECUTE)?"x":"-", - "p", + private ? "p" : "s", (u_long)off, 0, 0, From owner-svn-src-head@freebsd.org Wed Jan 8 17:26:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DF621F51E5; Wed, 8 Jan 2020 17:26:00 +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 47tGP43hQ0z3MkW; Wed, 8 Jan 2020 17:26:00 +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 79E9B1B7B6; Wed, 8 Jan 2020 17:26:00 +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 008HQ078074178; Wed, 8 Jan 2020 17:26:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008HPxJl074172; Wed, 8 Jan 2020 17:25:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081725.008HPxJl074172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 17:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356499 - in head: . share/man/man7 share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: . share/man/man7 share/mk X-SVN-Commit-Revision: 356499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:26:00 -0000 Author: jhb Date: Wed Jan 8 17:25:59 2020 New Revision: 356499 URL: https://svnweb.freebsd.org/changeset/base/356499 Log: Use clang and lld as the default toolchain for RISCV. - Enable clang and lld as system toolchains. - Don't use external GCC for universe by default. - Re-enable riscv64sf since it builds fine with clang + lld. Reviewed by: emaste, mhorne Relnotes: yes Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23089 Modified: head/Makefile head/share/man/man7/arch.7 head/share/mk/src.opts.mk Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jan 8 17:23:52 2020 (r356498) +++ head/Makefile Wed Jan 8 17:25:59 2020 (r356499) @@ -495,23 +495,20 @@ TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf # powerpcspe excluded until clang fixed TARGET_ARCHES_powerpc?= powerpc powerpc64 -# riscv64sf excluded due to PR 232085 -TARGET_ARCHES_riscv?= riscv64 +TARGET_ARCHES_riscv?= riscv64 riscv64sf .for target in ${TARGETS} TARGET_ARCHES_${target}?= ${target} .endfor -MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc MAKE_PARAMS_mips?= CROSS_TOOLCHAIN=mips-gcc6 MAKE_PARAMS_sparc64?= CROSS_TOOLCHAIN=sparc64-gcc6 TOOLCHAINS_mips= mips-gcc6 -TOOLCHAINS_riscv= riscv64-gcc TOOLCHAINS_sparc64= sparc64-gcc6 # Remove architectures only supported by external toolchain from # universe if required toolchain packages are missing. -.for target in mips riscv sparc64 +.for target in mips sparc64 .if ${_UNIVERSE_TARGETS:M${target}} .for toolchain in ${TOOLCHAINS_${target}} .if !exists(/usr/local/share/toolchains/${toolchain}.mk) Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Wed Jan 8 17:23:52 2020 (r356498) +++ head/share/man/man7/arch.7 Wed Jan 8 17:25:59 2020 (r356499) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2020 +.Dd January 8, 2020 .Dt ARCH 7 .Os .Sh NAME @@ -319,8 +319,8 @@ This table shows the default tool chain for each archi .It powerpc Ta Clang Ta GNU ld 2.17.50 .It powerpcspe Ta Clang Ta GNU ld 2.17.50 .It powerpc64 Ta Clang Ta lld -.It riscv64 Ta GCC(1) Ta GNU ld(1) -.It riscv64sf Ta GCC(1) Ta GNU ld(1) +.It riscv64 Ta Clang Ta lld +.It riscv64sf Ta Clang Ta lld .It sparc64 Ta GCC(1) Ta GNU ld(1) .El .Pp Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jan 8 17:23:52 2020 (r356498) +++ head/share/mk/src.opts.mk Wed Jan 8 17:25:59 2020 (r356499) @@ -295,8 +295,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF # If the compiler is not C++11 capable, disable Clang. External toolchain will # be required. -.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && \ - ${__TT} != "riscv" && ${__TT} != "sparc64") +.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && ${__TT} != "sparc64") # Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD .elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64" @@ -323,7 +322,7 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && \ - ${__TT} != "riscv" && ${__T} != "sparc64" + ${__T} != "sparc64" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD From owner-svn-src-head@freebsd.org Wed Jan 8 17:31:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52CF91F5309; Wed, 8 Jan 2020 17:31:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tGWC1Zfdz3NBv; Wed, 8 Jan 2020 17:31:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 318071B91F; Wed, 8 Jan 2020 17:31:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008HVIvx075903; Wed, 8 Jan 2020 17:31:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008HVIAp075902; Wed, 8 Jan 2020 17:31:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081731.008HVIAp075902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 17:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356501 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 356501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:31:19 -0000 Author: jhb Date: Wed Jan 8 17:31:18 2020 New Revision: 356501 URL: https://svnweb.freebsd.org/changeset/base/356501 Log: Remove a mention of MAKE_OBSOLETE_GCC. This should have been included in r356452. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Wed Jan 8 17:30:14 2020 (r356500) +++ head/share/man/man7/arch.7 Wed Jan 8 17:31:18 2020 (r356501) @@ -330,9 +330,7 @@ Note that GCC 4.2.1 is deprecated, and scheduled for r Any CPU architectures not migrated by then (to either base system Clang or external toolchain) may be removed from the tree after that date. -Unless the make variable -.Dv MAKE_OBSOLETE_GCC -is defined, make universe will not build mips or sparc64 +make universe will not build mips or sparc64 architectures unless the xtoolchain binaries have been installed for the architecture. .Ss MACHINE_ARCH vs MACHINE_CPUARCH vs MACHINE From owner-svn-src-head@freebsd.org Wed Jan 8 17:31:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F8E71F5391; Wed, 8 Jan 2020 17:31:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tGWv20RBz3NMJ; Wed, 8 Jan 2020 17:31:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FEEB1B94C; Wed, 8 Jan 2020 17:31:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008HVtqN079161; Wed, 8 Jan 2020 17:31:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008HVtGY079160; Wed, 8 Jan 2020 17:31:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081731.008HVtGY079160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 17:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356502 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:31:55 -0000 Author: jhb Date: Wed Jan 8 17:31:54 2020 New Revision: 356502 URL: https://svnweb.freebsd.org/changeset/base/356502 Log: Add notes for MAKE_OBSOLETE_GCC going away and riscv switching to clang/lld. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 8 17:31:18 2020 (r356501) +++ head/UPDATING Wed Jan 8 17:31:54 2020 (r356502) @@ -26,6 +26,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200108: + Clang/LLVM is now the default compiler and LLD the default + linker for riscv64. + +20200107: + make universe no longer uses GCC 4.2.1 on any architectures. + Architectures not supported by in-tree Clang/LLVM require an + external toolchain package. + 20200104: GCC 4.2.1 is now not built by default, as part of the GCC 4.2.1 retirement plan. Specifically, the GCC, GCC_BOOTSTRAP, and GNUCXX From owner-svn-src-head@freebsd.org Wed Jan 8 17:37:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B5711F57C8; Wed, 8 Jan 2020 17:37: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 47tGf92BXHz3Nmg; Wed, 8 Jan 2020 17:37:21 +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 4666A1B99C; Wed, 8 Jan 2020 17:37:21 +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 008HbLcR080418; Wed, 8 Jan 2020 17:37:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008HbLxl080417; Wed, 8 Jan 2020 17:37:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001081737.008HbLxl080417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Jan 2020 17:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356503 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 356503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:37:21 -0000 Author: kib Date: Wed Jan 8 17:37:20 2020 New Revision: 356503 URL: https://svnweb.freebsd.org/changeset/base/356503 Log: rtld: fix after r356300 binpath local was changed from char array to a char pointer, update strlcpy/strlcat uses. Reported by: Coverity through vangyzen CID: 1412239 and 1412240 Reviewed by: emaste, imp, vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23090 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 8 17:31:54 2020 (r356502) +++ head/libexec/rtld-elf/rtld.c Wed Jan 8 17:37:20 2020 (r356503) @@ -5531,15 +5531,12 @@ open_binary_fd(const char *argv0, bool search_in_path, fd = -1; errno = ENOENT; while ((pe = strsep(&pathenv, ":")) != NULL) { - if (strlcpy(binpath, pe, sizeof(binpath)) >= - sizeof(binpath)) + if (strlcpy(binpath, pe, PATH_MAX) >= PATH_MAX) continue; if (binpath[0] != '\0' && - strlcat(binpath, "/", sizeof(binpath)) >= - sizeof(binpath)) + strlcat(binpath, "/", PATH_MAX) >= PATH_MAX) continue; - if (strlcat(binpath, argv0, sizeof(binpath)) >= - sizeof(binpath)) + if (strlcat(binpath, argv0, PATH_MAX) >= PATH_MAX) continue; fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY); if (fd != -1 || errno != ENOENT) { From owner-svn-src-head@freebsd.org Wed Jan 8 17:49:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A83F1F5C51; Wed, 8 Jan 2020 17:49:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tGwH05Ysz3PcP; Wed, 8 Jan 2020 17:49:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE2821BBCC; Wed, 8 Jan 2020 17:49:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008HnYDE086550; Wed, 8 Jan 2020 17:49:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008HnY2w086547; Wed, 8 Jan 2020 17:49:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081749.008HnY2w086547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 17:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356504 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:49:35 -0000 Author: jhb Date: Wed Jan 8 17:49:34 2020 New Revision: 356504 URL: https://svnweb.freebsd.org/changeset/base/356504 Log: Add -mno-relax to CFLAGS in bsd.prog/lib.mk instead of bsd.cpu.mk. bsd.cpu.mk is included by bsd.init.mk before bsd.linker.mk, so it was always setting the flag since LINKER_FEATURES wasn't defined. Reported by: mhorne Reviewed by: imp, mhorne Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23076 Modified: head/share/mk/bsd.cpu.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Jan 8 17:37:20 2020 (r356503) +++ head/share/mk/bsd.cpu.mk Wed Jan 8 17:49:34 2020 (r356504) @@ -375,10 +375,6 @@ CFLAGS += -march=rv64imac -mabi=lp64 .else CFLAGS += -march=rv64imafdc -mabi=lp64d .endif - -.if ${LINKER_FEATURES:U:Mriscv-relaxations} == "" -CFLAGS += -mno-relax -.endif .endif # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Jan 8 17:37:20 2020 (r356503) +++ head/share/mk/bsd.lib.mk Wed Jan 8 17:49:34 2020 (r356504) @@ -98,6 +98,10 @@ STATIC_CFLAGS+= -ftls-model=initial-exec STATIC_CXXFLAGS+= -ftls-model=initial-exec .endif +.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" +CFLAGS += -mno-relax +.endif + .include # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Jan 8 17:37:20 2020 (r356503) +++ head/share/mk/bsd.prog.mk Wed Jan 8 17:49:34 2020 (r356504) @@ -57,6 +57,10 @@ LDFLAGS+= -Wl,-zretpolineplt .endif .endif +.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" +CFLAGS += -mno-relax +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} .else From owner-svn-src-head@freebsd.org Wed Jan 8 17:54:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F283D1F5EA0; Wed, 8 Jan 2020 17:54:44 +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 47tH2D6rJsz3Q3N; Wed, 8 Jan 2020 17:54:44 +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 E5D4A1BDA2; Wed, 8 Jan 2020 17:54:44 +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 008Hsin0092239; Wed, 8 Jan 2020 17:54:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008Hsi0w092238; Wed, 8 Jan 2020 17:54:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001081754.008Hsi0w092238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 17:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356505 - 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: 356505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 17:54:45 -0000 Author: emaste Date: Wed Jan 8 17:54:44 2020 New Revision: 356505 URL: https://svnweb.freebsd.org/changeset/base/356505 Log: src.conf.5: regen after r356423 and r356499 riscv now using Clang/lld, riscv64sf reenabled, and googletest adjusted to avoid only the affected fuse test on mips Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jan 8 17:49:34 2020 (r356504) +++ head/share/man/man5/src.conf.5 Wed Jan 8 17:54:44 2020 (r356505) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 6, 2020 +.Dd January 8, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -186,7 +186,7 @@ of the normal system build. The resulting system cannot build programs from source. .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS Set to build and install GNU .Xr as 1 , @@ -197,7 +197,7 @@ as part of the normal system build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP Set to not build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -207,7 +207,7 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -268,7 +268,7 @@ and .Pa crtend.o . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 @@ -380,7 +380,7 @@ When set, it enforces these options: Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 WITHOUT_CLANG_BOOTSTRAP Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -388,12 +388,12 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint and clang-format. @@ -408,7 +408,7 @@ Set to build the ARCMigrate, Rewriter and StaticAnalyz Clang C/C++ compiler. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 WITHOUT_CLANG_IS_CC Set to install the GCC compiler as .Pa /usr/bin/cc , @@ -417,7 +417,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -426,7 +426,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CPP Set to not build .Xr cpp 1 . @@ -495,7 +495,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -658,7 +658,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -743,13 +743,13 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GDB Set to build .Xr gdb 1 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GDB_LIBEXEC Set to install .Xr gdb 1 @@ -770,7 +770,7 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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_GNUCXX Build the GNU C++ stack (g++, libstdc++). This option is deprecated and will be removed before @@ -792,17 +792,6 @@ Set to neither build nor install .Lb libgmock , .Lb libgtest , and dependent tests. -.Pp -This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. -.It Va WITH_GOOGLETEST -Set to build and install -.Lb libgmock , -.Lb libgtest , -and dependent tests. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 @@ -826,7 +815,7 @@ Set to build and install simple_httpd Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -980,7 +969,7 @@ On 64-bit platforms, set to not build 32-bit library s runtime linker. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LIBCPLUSPLUS Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD @@ -1011,12 +1000,12 @@ sparc64/sparc64. Set to build LLVM's lld linker. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 WITHOUT_LLDB Set to not build the LLDB debugger. .Pp This is a default setting on -arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1029,23 +1018,23 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build, and use it during buildworld and buildkernel. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and powerpc/powerpc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and powerpc/powerpc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_COV Set to not build the .Xr llvm-cov 1 @@ -1059,17 +1048,17 @@ Set to build the tool. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp This is a default setting on -arm/armv6, arm/armv7 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_LLVM_LIBUNWIND Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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 WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1161,7 +1150,7 @@ powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64 Set to build GELI bootloader support. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_LUA Set to not build LUA bindings for the boot loader. .Pp @@ -1171,12 +1160,12 @@ powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64 Set to build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1186,12 +1175,12 @@ powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64 Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp This is a default setting on -arm/armv6, arm/armv7, powerpc/powerpc, powerpc/powerpc64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_LOADER_VERBOSE Set to build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. @@ -1351,7 +1340,7 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 @@ -1422,7 +1411,7 @@ and related programs. Set to not build nvme related tools and kernel modules. .Pp This is a default setting on -arm/armv6, arm/armv7, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_NVME Set to build nvme related tools and kernel modules. @@ -1443,7 +1432,7 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/armv6, arm/armv7, arm64/aarch64, powerpc/powerpc, riscv/riscv64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp @@ -1538,7 +1527,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1628,7 +1617,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-head@freebsd.org Wed Jan 8 18:26:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 533B11F71C6; Wed, 8 Jan 2020 18:26:24 +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 47tHkm1YXgz3xVg; Wed, 8 Jan 2020 18:26:24 +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 30B201C342; Wed, 8 Jan 2020 18:26:24 +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 008IQO1x010340; Wed, 8 Jan 2020 18:26:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008IQOkF010339; Wed, 8 Jan 2020 18:26:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001081826.008IQOkF010339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 Jan 2020 18:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356506 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 356506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 18:26:24 -0000 Author: mav Date: Wed Jan 8 18:26:23 2020 New Revision: 356506 URL: https://svnweb.freebsd.org/changeset/base/356506 Log: Fix copy-paste bug in HMB free code. MFC after: 2 weeks X-MFC-with: r356474 Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Jan 8 17:54:44 2020 (r356505) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Jan 8 18:26:23 2020 (r356506) @@ -854,7 +854,7 @@ nvme_ctrlr_hmb_free(struct nvme_controller *ctrlr) } if (ctrlr->hmb_desc_tag) { bus_dma_tag_destroy(ctrlr->hmb_desc_tag); - ctrlr->hmb_tag = NULL; + ctrlr->hmb_desc_tag = NULL; } for (i = 0; i < ctrlr->hmb_nchunks; i++) { hmbc = &ctrlr->hmb_chunks[i]; From owner-svn-src-head@freebsd.org Wed Jan 8 18:59:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08EEF1F7FE2; Wed, 8 Jan 2020 18:59:24 +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 47tJSq6VDGz41QC; Wed, 8 Jan 2020 18:59:23 +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 D58CD1C8EE; Wed, 8 Jan 2020 18:59:23 +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 008IxNSo029871; Wed, 8 Jan 2020 18:59:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008IxNZY029870; Wed, 8 Jan 2020 18:59:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081859.008IxNZY029870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 18:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356507 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 356507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 18:59:24 -0000 Author: jhb Date: Wed Jan 8 18:59:23 2020 New Revision: 356507 URL: https://svnweb.freebsd.org/changeset/base/356507 Log: Add a reference count to cryptodev sessions. This prevents use-after-free races with crypto requests (which may sleep) and CIOCFSESSION as well as races from current CIOCFSESSION requests. admbugs: 949 Reported by: Yuval Kanarenstein Reviewed by: cem MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D23077 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Jan 8 18:26:23 2020 (r356506) +++ head/sys/opencrypto/cryptodev.c Wed Jan 8 18:59:23 2020 (r356507) @@ -266,6 +266,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c struct csession { TAILQ_ENTRY(csession) next; crypto_session_t cses; + volatile u_int refs; u_int32_t ses; struct mtx lock; /* for op submission */ @@ -292,6 +293,7 @@ struct cryptop_data { struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; + struct mtx lock; }; static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; @@ -323,8 +325,8 @@ static struct fileops cryptofops = { }; static struct csession *csefind(struct fcrypt *, u_int); -static int csedelete(struct fcrypt *, struct csession *); -static struct csession *cseadd(struct fcrypt *, struct csession *); +static bool csedelete(struct fcrypt *, u_int); +static void cseadd(struct fcrypt *, struct csession *); static struct csession *csecreate(struct fcrypt *, crypto_session_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); @@ -668,13 +670,10 @@ bail: break; case CIOCFSESSION: ses = *(u_int32_t *)data; - cse = csefind(fcr, ses); - if (cse == NULL) { + if (!csedelete(fcr, ses)) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } - csedelete(fcr, cse); - csefree(cse); break; case CIOCCRYPT: #ifdef COMPAT_FREEBSD32 @@ -691,6 +690,7 @@ bail: return (EINVAL); } error = cryptodev_op(cse, cop, active_cred, td); + csefree(cse); #ifdef COMPAT_FREEBSD32 if (error == 0 && cmd == CIOCCRYPT32) crypt_op_to_32(cop, data); @@ -757,6 +757,7 @@ bail: return (EINVAL); } error = cryptodev_aead(cse, caead, active_cred, td); + csefree(cse); break; default: error = EINVAL; @@ -1375,6 +1376,9 @@ cryptof_close(struct file *fp, struct thread *td) while ((cse = TAILQ_FIRST(&fcr->csessions))) { TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(cse->refs == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + cse->refs)); csefree(cse); } free(fcr, M_XDATA); @@ -1395,34 +1399,36 @@ csefind(struct fcrypt *fcr, u_int ses) { struct csession *cse; - TAILQ_FOREACH(cse, &fcr->csessions, next) - if (cse->ses == ses) + mtx_lock(&fcr->lock); + TAILQ_FOREACH(cse, &fcr->csessions, next) { + if (cse->ses == ses) { + refcount_acquire(&cse->refs); + mtx_unlock(&fcr->lock); return (cse); + } + } + mtx_unlock(&fcr->lock); return (NULL); } -static int -csedelete(struct fcrypt *fcr, struct csession *cse_del) +static bool +csedelete(struct fcrypt *fcr, u_int ses) { struct csession *cse; + mtx_lock(&fcr->lock); TAILQ_FOREACH(cse, &fcr->csessions, next) { - if (cse == cse_del) { + if (cse->ses == ses) { TAILQ_REMOVE(&fcr->csessions, cse, next); - return (1); + mtx_unlock(&fcr->lock); + csefree(cse); + return (true); } } - return (0); + mtx_unlock(&fcr->lock); + return (false); } -static struct csession * -cseadd(struct fcrypt *fcr, struct csession *cse) -{ - TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); - cse->ses = fcr->sesn++; - return (cse); -} - struct csession * csecreate(struct fcrypt *fcr, crypto_session_t cses, caddr_t key, u_int64_t keylen, caddr_t mackey, u_int64_t mackeylen, u_int32_t cipher, u_int32_t mac, @@ -1434,6 +1440,7 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); + refcount_init(&cse->refs, 1); cse->key = key; cse->keylen = keylen/8; cse->mackey = mackey; @@ -1443,7 +1450,10 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c cse->mac = mac; cse->txform = txform; cse->thash = thash; - cseadd(fcr, cse); + mtx_lock(&fcr->lock); + TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); + cse->ses = fcr->sesn++; + mtx_unlock(&fcr->lock); return (cse); } @@ -1451,6 +1461,8 @@ static void csefree(struct csession *cse) { + if (!refcount_release(&cse->refs)) + return; crypto_freesession(cse->cses); mtx_destroy(&cse->lock); if (cse->key) @@ -1487,13 +1499,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); - fcr->sesn = 0; + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); error = falloc(td, &f, &fd, 0); if (error) { + mtx_destroy(&fcr->lock); free(fcr, M_XDATA); return (error); } From owner-svn-src-head@freebsd.org Wed Jan 8 19:03:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C47E1F82CC; Wed, 8 Jan 2020 19:03:25 +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 47tJYT0tmKz41t0; Wed, 8 Jan 2020 19:03:25 +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 19BB11CAC5; Wed, 8 Jan 2020 19:03:25 +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 008J3OVB035533; Wed, 8 Jan 2020 19:03:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008J3O93035532; Wed, 8 Jan 2020 19:03:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081903.008J3O93035532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 19:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356508 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 356508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 19:03:25 -0000 Author: jhb Date: Wed Jan 8 19:03:24 2020 New Revision: 356508 URL: https://svnweb.freebsd.org/changeset/base/356508 Log: Use falloc_noinstall + finstall for crypto file descriptors. Reviewed by: cem, kib MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D23078 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Jan 8 18:59:23 2020 (r356507) +++ head/sys/opencrypto/cryptodev.c Wed Jan 8 19:03:24 2020 (r356508) @@ -1499,20 +1499,21 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: + error = falloc_noinstall(td, &f); + if (error) + break; + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); - error = falloc(td, &f, &fd, 0); - + finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops); + error = finstall(td, f, &fd, 0, NULL); if (error) { mtx_destroy(&fcr->lock); free(fcr, M_XDATA); - return (error); - } - /* falloc automatically provides an extra reference to 'f'. */ - finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops); - *(u_int32_t *)data = fd; + } else + *(uint32_t *)data = fd; fdrop(f, td); break; case CRIOFINDDEV: From owner-svn-src-head@freebsd.org Wed Jan 8 19:05:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E841A1F837F; Wed, 8 Jan 2020 19:05:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tJbl5qpkz422V; Wed, 8 Jan 2020 19:05:23 +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 C2DB11CACC; Wed, 8 Jan 2020 19:05:23 +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 008J5NLD035682; Wed, 8 Jan 2020 19:05:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008J5NuY035681; Wed, 8 Jan 2020 19:05:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001081905.008J5NuY035681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 19:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356509 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 356509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 19:05:24 -0000 Author: jhb Date: Wed Jan 8 19:05:23 2020 New Revision: 356509 URL: https://svnweb.freebsd.org/changeset/base/356509 Log: Remove unneeded cdevsw methods and D_NEEDGIANT. Reviewed by: kib MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D23079 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Jan 8 19:03:24 2020 (r356508) +++ head/sys/opencrypto/cryptodev.c Wed Jan 8 19:05:23 2020 (r356509) @@ -1473,24 +1473,6 @@ csefree(struct csession *cse) } static int -cryptoopen(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - return (0); -} - -static int -cryptoread(struct cdev *dev, struct uio *uio, int ioflag) -{ - return (EIO); -} - -static int -cryptowrite(struct cdev *dev, struct uio *uio, int ioflag) -{ - return (EIO); -} - -static int cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { struct file *f; @@ -1531,10 +1513,6 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data static struct cdevsw crypto_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_open = cryptoopen, - .d_read = cryptoread, - .d_write = cryptowrite, .d_ioctl = cryptoioctl, .d_name = "crypto", }; From owner-svn-src-head@freebsd.org Wed Jan 8 19:05:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CFAE1F83C6; Wed, 8 Jan 2020 19:05: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 47tJby113rz428W; Wed, 8 Jan 2020 19:05: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 1DD8B1CACD; Wed, 8 Jan 2020 19:05: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 008J5YJ3035737; Wed, 8 Jan 2020 19:05:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008J5XRc035731; Wed, 8 Jan 2020 19:05:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001081905.008J5XRc035731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Jan 2020 19:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356510 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/sys X-SVN-Commit-Revision: 356510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 19:05:34 -0000 Author: kevans Date: Wed Jan 8 19:05:32 2020 New Revision: 356510 URL: https://svnweb.freebsd.org/changeset/base/356510 Log: posix_fallocate: push vnop implementation into the fileop layer This opens the door for other descriptor types to implement posix_fallocate(2) as needed. Reviewed by: kib, bcr (manpages) Differential Revision: https://reviews.freebsd.org/D23042 Modified: head/lib/libc/sys/posix_fallocate.2 head/sys/kern/sys_generic.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/file.h Modified: head/lib/libc/sys/posix_fallocate.2 ============================================================================== --- head/lib/libc/sys/posix_fallocate.2 Wed Jan 8 19:05:23 2020 (r356509) +++ head/lib/libc/sys/posix_fallocate.2 Wed Jan 8 19:05:32 2020 (r356510) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd November 4, 2017 +.Dd January 5, 2020 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -115,7 +115,8 @@ An I/O error occurred while reading from or writing to .It Bq Er ENODEV The .Fa fd -argument does not refer to a regular file. +argument does not refer to a file that supports +.Nm . .It Bq Er ENOSPC There is insufficient free space remaining on the file system storage media. Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Wed Jan 8 19:05:23 2020 (r356509) +++ head/sys/kern/sys_generic.c Wed Jan 8 19:05:32 2020 (r356510) @@ -819,6 +819,47 @@ out: } int +sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) +{ + int error; + + error = kern_posix_fallocate(td, uap->fd, uap->offset, uap->len); + return (kern_posix_error(td, error)); +} + +int +kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) +{ + struct file *fp; + int error; + + AUDIT_ARG_FD(fd); + if (offset < 0 || len <= 0) + return (EINVAL); + /* Check for wrap. */ + if (offset > OFF_MAX - len) + return (EFBIG); + AUDIT_ARG_FD(fd); + error = fget(td, fd, &cap_pwrite_rights, &fp); + if (error != 0) + return (error); + AUDIT_ARG_FILE(td->td_proc, fp); + if ((fp->f_ops->fo_flags & DFLAG_SEEKABLE) == 0) { + error = ESPIPE; + goto out; + } + if ((fp->f_flag & FWRITE) == 0) { + error = EBADF; + goto out; + } + + error = fo_fallocate(fp, offset, len, td); + out: + fdrop(fp, td); + return (error); +} + +int poll_no_poll(int events) { /* Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jan 8 19:05:23 2020 (r356509) +++ head/sys/kern/vfs_syscalls.c Wed Jan 8 19:05:32 2020 (r356510) @@ -4565,99 +4565,6 @@ out: return (error); } -int -kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) -{ - struct file *fp; - struct mount *mp; - struct vnode *vp; - off_t olen, ooffset; - int error; -#ifdef AUDIT - int audited_vnode1 = 0; -#endif - - AUDIT_ARG_FD(fd); - if (offset < 0 || len <= 0) - return (EINVAL); - /* Check for wrap. */ - if (offset > OFF_MAX - len) - return (EFBIG); - AUDIT_ARG_FD(fd); - error = fget(td, fd, &cap_pwrite_rights, &fp); - if (error != 0) - return (error); - AUDIT_ARG_FILE(td->td_proc, fp); - if ((fp->f_ops->fo_flags & DFLAG_SEEKABLE) == 0) { - error = ESPIPE; - goto out; - } - if ((fp->f_flag & FWRITE) == 0) { - error = EBADF; - goto out; - } - if (fp->f_type != DTYPE_VNODE) { - error = ENODEV; - goto out; - } - vp = fp->f_vnode; - if (vp->v_type != VREG) { - error = ENODEV; - goto out; - } - - /* Allocating blocks may take a long time, so iterate. */ - for (;;) { - olen = len; - ooffset = offset; - - bwillwrite(); - mp = NULL; - error = vn_start_write(vp, &mp, V_WAIT | PCATCH); - if (error != 0) - break; - error = vn_lock(vp, LK_EXCLUSIVE); - if (error != 0) { - vn_finished_write(mp); - break; - } -#ifdef AUDIT - if (!audited_vnode1) { - AUDIT_ARG_VNODE1(vp); - audited_vnode1 = 1; - } -#endif -#ifdef MAC - error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_ALLOCATE(vp, &offset, &len); - VOP_UNLOCK(vp); - vn_finished_write(mp); - - if (olen + ooffset != offset + len) { - panic("offset + len changed from %jx/%jx to %jx/%jx", - ooffset, olen, offset, len); - } - if (error != 0 || len == 0) - break; - KASSERT(olen > len, ("Iteration did not make progress?")); - maybe_yield(); - } - out: - fdrop(fp, td); - return (error); -} - -int -sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) -{ - int error; - - error = kern_posix_fallocate(td, uap->fd, uap->offset, uap->len); - return (kern_posix_error(td, error)); -} - /* * Unlike madvise(2), we do not make a best effort to remember every * possible caching hint. Instead, we remember the last setting with Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Jan 8 19:05:23 2020 (r356509) +++ head/sys/kern/vfs_vnops.c Wed Jan 8 19:05:32 2020 (r356510) @@ -103,6 +103,7 @@ static fo_kqfilter_t vn_kqfilter; static fo_stat_t vn_statfile; static fo_close_t vn_closefile; static fo_mmap_t vn_mmap; +static fo_fallocate_t vn_fallocate; struct fileops vnops = { .fo_read = vn_io_fault, @@ -119,6 +120,7 @@ struct fileops vnops = { .fo_seek = vn_seek, .fo_fill_kinfo = vn_fill_kinfo, .fo_mmap = vn_mmap, + .fo_fallocate = vn_fallocate, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -3148,5 +3150,62 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * out: *lenp = savlen - len; free(dat, M_TEMP); + return (error); +} + +static int +vn_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) +{ + struct mount *mp; + struct vnode *vp; + off_t olen, ooffset; + int error; +#ifdef AUDIT + int audited_vnode1 = 0; +#endif + + vp = fp->f_vnode; + if (vp->v_type != VREG) + return (ENODEV); + + /* Allocating blocks may take a long time, so iterate. */ + for (;;) { + olen = len; + ooffset = offset; + + bwillwrite(); + mp = NULL; + error = vn_start_write(vp, &mp, V_WAIT | PCATCH); + if (error != 0) + break; + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) { + vn_finished_write(mp); + break; + } +#ifdef AUDIT + if (!audited_vnode1) { + AUDIT_ARG_VNODE1(vp); + audited_vnode1 = 1; + } +#endif +#ifdef MAC + error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); + if (error == 0) +#endif + error = VOP_ALLOCATE(vp, &offset, &len); + VOP_UNLOCK(vp); + vn_finished_write(mp); + + if (olen + ooffset != offset + len) { + panic("offset + len changed from %jx/%jx to %jx/%jx", + ooffset, olen, offset, len); + } + if (error != 0 || len == 0) + break; + KASSERT(olen > len, ("Iteration did not make progress?")); + maybe_yield(); + } + return (error); } Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Wed Jan 8 19:05:23 2020 (r356509) +++ head/sys/sys/file.h Wed Jan 8 19:05:32 2020 (r356510) @@ -125,6 +125,8 @@ typedef int fo_mmap_t(struct file *fp, vm_map_t map, v typedef int fo_aio_queue_t(struct file *fp, struct kaiocb *job); typedef int fo_add_seals_t(struct file *fp, int flags); typedef int fo_get_seals_t(struct file *fp, int *flags); +typedef int fo_fallocate_t(struct file *fp, off_t offset, off_t len, + struct thread *td); typedef int fo_flags_t; struct fileops { @@ -145,6 +147,7 @@ struct fileops { fo_aio_queue_t *fo_aio_queue; fo_add_seals_t *fo_add_seals; fo_get_seals_t *fo_get_seals; + fo_fallocate_t *fo_fallocate; fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -444,6 +447,15 @@ fo_get_seals(struct file *fp, int *seals) if (fp->f_ops->fo_get_seals == NULL) return (EINVAL); return ((*fp->f_ops->fo_get_seals)(fp, seals)); +} + +static __inline int +fo_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) +{ + + if (fp->f_ops->fo_fallocate == NULL) + return (ENODEV); + return ((*fp->f_ops->fo_fallocate)(fp, offset, len, td)); } #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Wed Jan 8 19:06:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8B781F8457; Wed, 8 Jan 2020 19:06: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 47tJct43QJz42J3; Wed, 8 Jan 2020 19:06: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 868D11CAE1; Wed, 8 Jan 2020 19:06: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 008J6MDQ035814; Wed, 8 Jan 2020 19:06:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008J6MDO035813; Wed, 8 Jan 2020 19:06:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001081906.008J6MDO035813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Jan 2020 19:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356511 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 356511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 19:06:22 -0000 Author: kevans Date: Wed Jan 8 19:06:22 2020 New Revision: 356511 URL: https://svnweb.freebsd.org/changeset/base/356511 Log: Bump __FreeBSD_version after r356510 linuxkpi kmod would need to rebuilt at a minimum; fileops layout has changed. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jan 8 19:05:32 2020 (r356510) +++ head/sys/sys/param.h Wed Jan 8 19:06:22 2020 (r356511) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300075 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300076 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Jan 8 19:08:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 071C31F84F2; Wed, 8 Jan 2020 19:08:45 +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 47tJgc6SC6z42R2; Wed, 8 Jan 2020 19:08:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D477C1CAE6; Wed, 8 Jan 2020 19:08:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008J8iKJ035969; Wed, 8 Jan 2020 19:08:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008J8ioq035968; Wed, 8 Jan 2020 19:08:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001081908.008J8ioq035968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Jan 2020 19:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356512 - in head: sys/kern tests/sys/posixshm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: sys/kern tests/sys/posixshm X-SVN-Commit-Revision: 356512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 19:08:45 -0000 Author: kevans Date: Wed Jan 8 19:08:44 2020 New Revision: 356512 URL: https://svnweb.freebsd.org/changeset/base/356512 Log: posixshm: implement posix_fallocate(2) Linux expects to be able to use posix_fallocate(2) on a memfd. Other places would use this with shm_open(2) to act as a smarter ftruncate(2). Test has been added to go along with this. Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D23042 Modified: head/sys/kern/uipc_shm.c head/tests/sys/posixshm/posixshm_test.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Jan 8 19:06:22 2020 (r356511) +++ head/sys/kern/uipc_shm.c Wed Jan 8 19:08:44 2020 (r356512) @@ -138,6 +138,7 @@ static fo_fill_kinfo_t shm_fill_kinfo; static fo_mmap_t shm_mmap; static fo_get_seals_t shm_get_seals; static fo_add_seals_t shm_add_seals; +static fo_fallocate_t shm_fallocate; /* File descriptor operations. */ struct fileops shm_ops = { @@ -157,6 +158,7 @@ struct fileops shm_ops = { .fo_mmap = shm_mmap, .fo_get_seals = shm_get_seals, .fo_add_seals = shm_add_seals, + .fo_fallocate = shm_fallocate, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -1435,6 +1437,32 @@ shm_get_seals(struct file *fp, int *seals) shmfd = fp->f_data; *seals = shmfd->shm_seals; return (0); +} + +static int +shm_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) +{ + void *rl_cookie; + struct shmfd *shmfd; + size_t size; + int error; + + /* This assumes that the caller already checked for overflow. */ + error = 0; + shmfd = fp->f_data; + size = offset + len; + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + if (size > shmfd->shm_size) { + VM_OBJECT_WLOCK(shmfd->shm_object); + error = shm_dotruncate_locked(shmfd, size, rl_cookie); + VM_OBJECT_WUNLOCK(shmfd->shm_object); + } + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + /* Translate to posix_fallocate(2) return value as needed. */ + if (error == ENOMEM) + error = ENOSPC; + return (error); } static int Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Wed Jan 8 19:06:22 2020 (r356511) +++ head/tests/sys/posixshm/posixshm_test.c Wed Jan 8 19:08:44 2020 (r356512) @@ -918,6 +918,44 @@ ATF_TC_BODY(mode, tc) umask(restore_mask); } +ATF_TC_WITHOUT_HEAD(fallocate); +ATF_TC_BODY(fallocate, tc) +{ + struct stat st; + int error, fd, sz; + + /* + * Primitive test case for posix_fallocate with shmd. Effectively + * expected to work like a smarter ftruncate that will grow the region + * as needed in a race-free way. + */ + fd = shm_open(SHM_ANON, O_RDWR, 0666); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno=%d", errno); + /* Set the initial size. */ + sz = 32; + ATF_REQUIRE(ftruncate(fd, sz) == 0); + + /* Now grow it. */ + error = 0; + sz *= 2; + ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, sz)) == 0, + "posix_fallocate failed; error=%d", error); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE(st.st_size == sz); + /* Attempt to shrink it; should succeed, but not change the size. */ + ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, sz / 2)) == 0, + "posix_fallocate failed; error=%d", error); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE(st.st_size == sz); + /* Grow it using an offset of sz and len of sz. */ + ATF_REQUIRE_MSG((error = posix_fallocate(fd, sz, sz)) == 0, + "posix_fallocate failed; error=%d", error); + ATF_REQUIRE(fstat(fd, &st) == 0); + ATF_REQUIRE(st.st_size == (sz * 2)); + + close(fd); +} + ATF_TP_ADD_TCS(tp) { @@ -951,6 +989,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, object_resize); ATF_TP_ADD_TC(tp, cloexec); ATF_TP_ADD_TC(tp, mode); + ATF_TP_ADD_TC(tp, fallocate); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Wed Jan 8 20:37:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC6461FA1FC; Wed, 8 Jan 2020 20:37:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tLdX4cFTz46qb; Wed, 8 Jan 2020 20:37:04 +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 94AAF1DBBD; Wed, 8 Jan 2020 20:37:04 +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 008Kb4QR089850; Wed, 8 Jan 2020 20:37:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008Kb4kH089848; Wed, 8 Jan 2020 20:37:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001082037.008Kb4kH089848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 20:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356513 - in head/contrib/llvm-project/libunwind: include src X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/contrib/llvm-project/libunwind: include src X-SVN-Commit-Revision: 356513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 20:37:04 -0000 Author: emaste Date: Wed Jan 8 20:37:03 2020 New Revision: 356513 URL: https://svnweb.freebsd.org/changeset/base/356513 Log: libunwind: untested attempt to fix sparc64 build sparc64 is the only architecture currently using the DWARF unwinder from GCC 4.2.1. Old GCC and related libraries are being removed soon; absent other changes sparc64 would be left with no unwinder when that happens. Instead, commit these changes which should at least allow the LLVM unwinder to build. Someone with access to the obolete sparc64 hardware supported by FreeBSD will need to test the result. PR: 233405 Submitted by: cem Modified: head/contrib/llvm-project/libunwind/include/__libunwind_config.h head/contrib/llvm-project/libunwind/src/config.h Modified: head/contrib/llvm-project/libunwind/include/__libunwind_config.h ============================================================================== --- head/contrib/llvm-project/libunwind/include/__libunwind_config.h Wed Jan 8 19:08:44 2020 (r356512) +++ head/contrib/llvm-project/libunwind/include/__libunwind_config.h Wed Jan 8 20:37:03 2020 (r356513) @@ -124,7 +124,7 @@ #define _LIBUNWIND_TARGET_SPARC 1 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC #define _LIBUNWIND_CONTEXT_SIZE 16 - #define _LIBUNWIND_CURSOR_SIZE 23 + #define _LIBUNWIND_CURSOR_SIZE 28 # else # error "Unsupported architecture." # endif Modified: head/contrib/llvm-project/libunwind/src/config.h ============================================================================== --- head/contrib/llvm-project/libunwind/src/config.h Wed Jan 8 19:08:44 2020 (r356512) +++ head/contrib/llvm-project/libunwind/src/config.h Wed Jan 8 20:37:03 2020 (r356513) @@ -104,7 +104,8 @@ (!defined(__APPLE__) && defined(__arm__)) || \ (defined(__arm64__) || defined(__aarch64__)) || \ defined(__mips__) || \ - defined(__riscv) + defined(__riscv) || \ + defined(__sparc__) #if !defined(_LIBUNWIND_BUILD_SJLJ_APIS) #define _LIBUNWIND_BUILD_ZERO_COST_APIS #endif From owner-svn-src-head@freebsd.org Wed Jan 8 20:45:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A58091FA55C; Wed, 8 Jan 2020 20:45:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tLq23s0yz47LC; Wed, 8 Jan 2020 20:45:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B29A1DD89; Wed, 8 Jan 2020 20:45:18 +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 008KjIWW095702; Wed, 8 Jan 2020 20:45:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008KjIlD095701; Wed, 8 Jan 2020 20:45:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001082045.008KjIlD095701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 20:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356514 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 20:45:18 -0000 Author: emaste Date: Wed Jan 8 20:45:18 2020 New Revision: 356514 URL: https://svnweb.freebsd.org/changeset/base/356514 Log: src.opts.mk: enable LLVM_UNWIND by default for all archs Only sparc64 did not enable LLVM_LIBUNWIND. After r356513 LLVM_LIBUNWIND should at least build on sparc64. The old DWARF unwinder will be removed along with GCC 4.2.1 in the near future, so switch sparc64 to use LLVM's unwinder in advance of the removal. Someone with access to the obsolete sparc64 hardware supported by FreeBSD will have to test, and investigate any failures. I will gladly help, but I don't have any suitable hardware myself. PR: 233405 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jan 8 20:37:03 2020 (r356513) +++ head/share/mk/src.opts.mk Wed Jan 8 20:45:18 2020 (r356514) @@ -129,6 +129,7 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ + LLVM_LIBUNWIND \ LLVM_TARGET_ALL \ LOADER_GELI \ LOADER_LUA \ @@ -315,11 +316,6 @@ BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BO .endif .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED -.endif -.if ${__T} != "sparc64" -__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND -.else -__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif .if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && \ ${__T} != "sparc64" From owner-svn-src-head@freebsd.org Wed Jan 8 20:49:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 021AB1FA6BF for ; Wed, 8 Jan 2020 20:49:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 47tLw80tcYz47YN for ; Wed, 8 Jan 2020 20:49:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x836.google.com with SMTP id n15so3979873qtp.5 for ; Wed, 08 Jan 2020 12:49:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IOn35Vanh4HI2219y7f+q4YHjgJo3rpLGp1fY6ImarU=; b=epVhzZfTcvsiHk4BtY7zgFU6uYD2ww/1Fn0GzFOOVMvGsZU4vu4DFnNGJZALFe1fSb OJyjsuXWa6ZwDRXeFLNzwVOaDzLO8+sWgLW7uuelBYBYgmly8WBE0BfgcjoRixTdYOe6 xcS+oJsxiwx20VT0XuscdOnTzuUGwPvE9zR2Bt03OmzqFmwXYKb2mKeB6aChzSvo9pfb X+aqGY70EJhURjfU6bef4Vt+/wJvONrWoBWDi65U8DNldc6EjhsL/BiFeJOO1T9BEMJe 1+dzkdCF2dtKWdE8JVgCayIQwjif3FBN9XYgjbQNhCSrbX+p+ssas92Cp9AOFcKxsaND +lIQ== 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=IOn35Vanh4HI2219y7f+q4YHjgJo3rpLGp1fY6ImarU=; b=YjSjvaUSslTRvemDU74WYnGC/IseRDEIdUnyrT2i/m6glUSjpU65HRnwsPTLDJyzRP +wPH+Ox4D91mpQQuMZqdXD7httemzxHZQZtuvsaIU2bkJpECxIQdqJepFxEcQkOMjkR8 J2GCJ8iR+51QZJ3R3lQnHgySYMiE/CxYK3gjzy0ZUuUvWkkc5KhgpaRAJpOgyT7I10L4 vS4nTNdfFwTY6h1L8sUC5/LOXjJ3l57q/Zzt+FYnyjlAiQiP+KVYnZAoNMkPSVDFVTyZ X3TYNIo4pI5cPWpTWNBRriMLxpviYa+ZCNJsov6cNrk5I8+cNi0m8/fspnmxGF8P5rCo ugpQ== X-Gm-Message-State: APjAAAWvUZG8YHYqCYev0iiCkdfkdNu4bvY/olFDqUqUdN0X/2kYW9mf S11+v4CxAzf3yqNweg6BJv5oi58xyZMcfdjxs7fP9Q== X-Google-Smtp-Source: APXvYqx5F8x0wQ/3awb+joLu+DP3XceX84UEjdbQ3tPb5dt+/SSYSwQ0A/v8WEz9MzOM+G6mzQkmDJlmXSQ1iWv/o8E= X-Received: by 2002:ac8:21ec:: with SMTP id 41mr5321202qtz.242.1578516583084; Wed, 08 Jan 2020 12:49:43 -0800 (PST) MIME-Version: 1.0 References: <202001082045.008KjIlD095701@repo.freebsd.org> In-Reply-To: <202001082045.008KjIlD095701@repo.freebsd.org> From: Warner Losh Date: Wed, 8 Jan 2020 13:49:29 -0700 Message-ID: Subject: Re: svn commit: r356514 - head/share/mk To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47tLw80tcYz47YN X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=epVhzZfT; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::836) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[6.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.64)[ip: (-9.17), ipnet: 2607:f8b0::/32(-2.12), asn: 15169(-1.85), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 20:49:45 -0000 On Wed, Jan 8, 2020 at 1:45 PM Ed Maste wrote: > Author: emaste > Date: Wed Jan 8 20:45:18 2020 > New Revision: 356514 > URL: https://svnweb.freebsd.org/changeset/base/356514 > > Log: > src.opts.mk: enable LLVM_UNWIND by default for all archs > > Only sparc64 did not enable LLVM_LIBUNWIND. After r356513 LLVM_LIBUNWIND > should at least build on sparc64. The old DWARF unwinder will be removed > along with GCC 4.2.1 in the near future, so switch sparc64 to use LLVM's > unwinder in advance of the removal. Someone with access to the obsolete > sparc64 hardware supported by FreeBSD will have to test, and investigate > any failures. I will gladly help, but I don't have any suitable hardware > myself. > > PR: 233405 > One fewer option defaults based on Arch! And there was much rejoicing. Warner > Modified: > head/share/mk/src.opts.mk > > Modified: head/share/mk/src.opts.mk > > ============================================================================== > --- head/share/mk/src.opts.mk Wed Jan 8 20:37:03 2020 (r356513) > +++ head/share/mk/src.opts.mk Wed Jan 8 20:45:18 2020 (r356514) > @@ -129,6 +129,7 @@ __DEFAULT_YES_OPTIONS = \ > LIBPTHREAD \ > LIBTHR \ > LLVM_COV \ > + LLVM_LIBUNWIND \ > LLVM_TARGET_ALL \ > LOADER_GELI \ > LOADER_LUA \ > @@ -315,11 +316,6 @@ BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BO > .endif > .if ${__T:Mriscv*} != "" > BROKEN_OPTIONS+=OFED > -.endif > -.if ${__T} != "sparc64" > -__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND > -.else > -__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND > .endif > .if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && > \ > ${__T} != "sparc64" > From owner-svn-src-head@freebsd.org Wed Jan 8 20:51:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BFA51FA79C; Wed, 8 Jan 2020 20:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tLxm0C1mz47r2; Wed, 8 Jan 2020 20:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0242A1DED4; Wed, 8 Jan 2020 20:51:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008Kp7Eo097477; Wed, 8 Jan 2020 20:51:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008Kp7AA097476; Wed, 8 Jan 2020 20:51:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001082051.008Kp7AA097476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 20:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356515 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 20:51:08 -0000 Author: emaste Date: Wed Jan 8 20:51:07 2020 New Revision: 356515 URL: https://svnweb.freebsd.org/changeset/base/356515 Log: src.opts.mk: Remove sparc64 LLVM_LIBUNWIND BROKEN_OPTIONS After r356513 it should build. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jan 8 20:45:18 2020 (r356514) +++ head/share/mk/src.opts.mk Wed Jan 8 20:51:07 2020 (r356515) @@ -392,8 +392,6 @@ BROKEN_OPTIONS+=NVME .if ${__T:Msparc64} # Sparc64 need extra crt*.o files - PR 239851 BROKEN_OPTIONS+=BSD_CRTBEGIN -# PR 233405 -BROKEN_OPTIONS+=LLVM_LIBUNWIND .endif .if ${COMPILER_FEATURES:Mc++11} && \ From owner-svn-src-head@freebsd.org Wed Jan 8 20:56:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC20A1FA9DA; Wed, 8 Jan 2020 20:56:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tM3y4Yx5z486d; Wed, 8 Jan 2020 20:56:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97E2B1DF59; Wed, 8 Jan 2020 20:56:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008KuUaY001619; Wed, 8 Jan 2020 20:56:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008KuUcp001618; Wed, 8 Jan 2020 20:56:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001082056.008KuUcp001618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 20:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356516 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 20:56:30 -0000 Author: emaste Date: Wed Jan 8 20:56:30 2020 New Revision: 356516 URL: https://svnweb.freebsd.org/changeset/base/356516 Log: Remove prereq lib support for GNU unwinder LLVM's libunwind is used for all archs, as of r356514. As GCC 4.2.1 will soon be removed, and with it the GNU unwinder, start simplifying the prereq/startup lib logic in Makefile.inc1. From here if there are any unwinder bugs (on any arch) the path foward is to fix LLVM's libunwind. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jan 8 20:51:07 2020 (r356515) +++ head/Makefile.inc1 Wed Jan 8 20:56:30 2020 (r356516) @@ -2815,17 +2815,6 @@ lib/libgcc_s__L: lib/libc_nonshared__L .if ${MK_LIBCPLUSPLUS} != "no" lib/libcxxrt__L: lib/libgcc_s__L .endif - -.else # MK_LLVM_LIBUNWIND == no - -_prereq_libs+= gnu/lib/libgcc -_startup_libs+= gnu/lib/libgcc - -gnu/lib/libgcc__L: lib/libc__L -gnu/lib/libgcc__L: lib/libc_nonshared__L -.if ${MK_LIBCPLUSPLUS} != "no" -lib/libcxxrt__L: gnu/lib/libgcc__L -.endif .endif _prebuild_libs= ${_kerberos5_lib_libasn1} \ From owner-svn-src-head@freebsd.org Wed Jan 8 21:07:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 042091FAFA4; Wed, 8 Jan 2020 21:07:56 +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 47tMK76P9Nz48mf; Wed, 8 Jan 2020 21:07:55 +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 D28601E141; Wed, 8 Jan 2020 21:07:55 +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 008L7t8R007733; Wed, 8 Jan 2020 21:07:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008L7t5A007732; Wed, 8 Jan 2020 21:07:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001082107.008L7t5A007732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Jan 2020 21:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356517 - in head/gnu/lib: . libgcc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/gnu/lib: . libgcc X-SVN-Commit-Revision: 356517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 21:07:56 -0000 Author: emaste Date: Wed Jan 8 21:07:55 2020 New Revision: 356517 URL: https://svnweb.freebsd.org/changeset/base/356517 Log: Retire build support for GCC's DWARF unwinder As of r356514 LLVM's libunwind is used as the DWARF unwinder on all supported CPU architectures, and GCC and its libraries will be removed soon. Retire the build infrastructure for GCC's unwinder; from here if there are any unwinder bugs (on any arch) the path forward is to fix LLVM's libunwind. Deleted: head/gnu/lib/libgcc/ Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Wed Jan 8 20:56:30 2020 (r356516) +++ head/gnu/lib/Makefile Wed Jan 8 21:07:55 2020 (r356517) @@ -19,10 +19,6 @@ SUBDIR+= csu SUBDIR+= libregex .endif -.if ${MK_LLVM_LIBUNWIND} == "no" -SUBDIR+= libgcc -.endif - # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. .if ${MK_GNUCXX} != "no" From owner-svn-src-head@freebsd.org Wed Jan 8 22:06:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD42B1FC8C8; Wed, 8 Jan 2020 22:06:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tNcl4Z3Gz4D7C; Wed, 8 Jan 2020 22:06:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97E0A1EC68; Wed, 8 Jan 2020 22:06:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008M6VDS043678; Wed, 8 Jan 2020 22:06:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008M6VsZ043677; Wed, 8 Jan 2020 22:06:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001082206.008M6VsZ043677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 8 Jan 2020 22:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356519 - head/sys/dev/iicbus/mux X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/mux X-SVN-Commit-Revision: 356519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 22:06:31 -0000 Author: ian Date: Wed Jan 8 22:06:31 2020 New Revision: 356519 URL: https://svnweb.freebsd.org/changeset/base/356519 Log: Ensure any reserved gpio pins get released if an early exit is taken from the attach function. Modified: head/sys/dev/iicbus/mux/iic_gpiomux.c Modified: head/sys/dev/iicbus/mux/iic_gpiomux.c ============================================================================== --- head/sys/dev/iicbus/mux/iic_gpiomux.c Wed Jan 8 21:22:44 2020 (r356518) +++ head/sys/dev/iicbus/mux/iic_gpiomux.c Wed Jan 8 22:06:31 2020 (r356519) @@ -119,6 +119,15 @@ gpiomux_probe(device_t dev) return (rv); } +static void +gpiomux_release_pins(struct gpiomux_softc *sc) +{ + int i; + + for (i = 0; i < sc->numpins; ++i) + gpio_pin_release(sc->pins[i]); +} + static int gpiomux_attach(device_t dev) { @@ -145,13 +154,16 @@ gpiomux_attach(device_t dev) sc->numpins = i; if (sc->numpins == 0) { device_printf(dev, "cannot acquire pins listed in mux-gpios\n"); - return ((err == 0) ? ENXIO : err); + if (err == 0) + err = ENXIO; + goto errexit; } numchannels = 1u << sc->numpins; if (numchannels > IICMUX_MAX_BUSES) { device_printf(dev, "too many mux-gpios pins for max %d buses\n", IICMUX_MAX_BUSES); - return (EINVAL); + err = EINVAL; + goto errexit; } /* @@ -163,13 +175,15 @@ gpiomux_attach(device_t dev) len = OF_getencprop(node, "i2c-parent", &propval, sizeof(propval)); if (len != sizeof(propval)) { device_printf(dev, "cannot obtain i2c-parent property\n"); - return (ENXIO); + err = ENXIO; + goto errexit; } busdev = OF_device_from_xref((phandle_t)propval); if (busdev == NULL) { device_printf(dev, "cannot find device referenced by i2c-parent property\n"); - return (ENXIO); + err = ENXIO; + goto errexit; } device_printf(dev, "upstream bus is %s\n", device_get_nameunit(busdev)); @@ -202,6 +216,11 @@ gpiomux_attach(device_t dev) if ((err = iicmux_attach(dev, busdev, numchannels)) == 0) bus_generic_attach(dev); +errexit: + + if (err != 0) + gpiomux_release_pins(sc); + return (err); } @@ -209,13 +228,12 @@ static int gpiomux_detach(device_t dev) { struct gpiomux_softc *sc = device_get_softc(dev); - int err, i; + int err; if ((err = iicmux_detach(dev)) != 0) return (err); - for (i = 0; i < sc->numpins; ++i) - gpio_pin_release(sc->pins[i]); + gpiomux_release_pins(sc); return (0); } From owner-svn-src-head@freebsd.org Wed Jan 8 22:16:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E93E1FCD13; Wed, 8 Jan 2020 22:16:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tNrC04bjz4Djm; Wed, 8 Jan 2020 22:16:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1D371EE48; Wed, 8 Jan 2020 22:16:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008MGQ5S049662; Wed, 8 Jan 2020 22:16:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008MGQpX049661; Wed, 8 Jan 2020 22:16:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001082216.008MGQpX049661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 Jan 2020 22:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356520 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 356520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 22:16:27 -0000 Author: jhb Date: Wed Jan 8 22:16:26 2020 New Revision: 356520 URL: https://svnweb.freebsd.org/changeset/base/356520 Log: Remove no-longer-used function prototype. Reported by: amd64-gcc Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Jan 8 22:06:31 2020 (r356519) +++ head/sys/opencrypto/cryptodev.c Wed Jan 8 22:16:26 2020 (r356520) @@ -326,7 +326,6 @@ static struct fileops cryptofops = { static struct csession *csefind(struct fcrypt *, u_int); static bool csedelete(struct fcrypt *, u_int); -static void cseadd(struct fcrypt *, struct csession *); static struct csession *csecreate(struct fcrypt *, crypto_session_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); From owner-svn-src-head@freebsd.org Wed Jan 8 22:45:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 085001FD68C; Wed, 8 Jan 2020 22:45:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tPTm6VQtz4FyW; Wed, 8 Jan 2020 22:45:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6271F3AF; Wed, 8 Jan 2020 22:45:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008MjW2M067264; Wed, 8 Jan 2020 22:45:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008MjWBY067263; Wed, 8 Jan 2020 22:45:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001082245.008MjWBY067263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 8 Jan 2020 22:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356521 - head/sys/dev/iicbus/mux X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/mux X-SVN-Commit-Revision: 356521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 22:45:33 -0000 Author: ian Date: Wed Jan 8 22:45:32 2020 New Revision: 356521 URL: https://svnweb.freebsd.org/changeset/base/356521 Log: Init sc->maxbus to -1, not 0. It represents the highest array index that has a non-NULL child bus stored in it, so the "none" value can't be zero since that's a valid array index. Also, when adding all possible buses because there is no specific per-bus config, there's no need to reset sc->maxbus on each loop iteration, it can be set once after the loop. Modified: head/sys/dev/iicbus/mux/iicmux.c Modified: head/sys/dev/iicbus/mux/iicmux.c ============================================================================== --- head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 22:16:26 2020 (r356520) +++ head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 22:45:32 2020 (r356521) @@ -249,6 +249,7 @@ iicmux_attach(device_t dev, device_t busdev, int numbu sc->dev = dev; sc->busdev = busdev; + sc->maxbus = -1; sc->numbuses = numbuses; SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), @@ -262,7 +263,8 @@ iicmux_attach(device_t dev, device_t busdev, int numbu #ifdef FDT phandle_t child, node, parent; - pcell_t idx; + pcell_t reg; + int idx; /* * Find our FDT node. Child nodes within our node will become our @@ -285,11 +287,12 @@ iicmux_attach(device_t dev, device_t busdev, int numbu * Attach the children represented in the device tree. */ for (child = OF_child(parent); child != 0; child = OF_peer(child)) { - if (OF_getencprop(child, "reg", &idx, sizeof(idx)) == -1) { + if (OF_getencprop(child, "reg", ®, sizeof(reg)) == -1) { device_printf(dev, "child bus missing required 'reg' property\n"); continue; } + idx = (int)reg; if (idx >= sc->numbuses) { device_printf(dev, "child bus 'reg' property %d exceeds the number " @@ -314,9 +317,8 @@ iicmux_attach(device_t dev, device_t busdev, int numbu for (i = 0; i < sc->numbuses; ++i) { sc->childdevs[i] = device_add_child(sc->dev, "iicbus", -1); - if (sc->maxbus < i) - sc->maxbus = i; } + sc->maxbus = sc->numbuses - 1; return (0); } From owner-svn-src-head@freebsd.org Wed Jan 8 22:48:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F39781FD760; Wed, 8 Jan 2020 22:48:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tPXt4hcJz4G6m; Wed, 8 Jan 2020 22:48:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C5C41F3B2; Wed, 8 Jan 2020 22:48:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008MmECA067420; Wed, 8 Jan 2020 22:48:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008MmE6D067419; Wed, 8 Jan 2020 22:48:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001082248.008MmE6D067419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 8 Jan 2020 22:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356522 - head/sys/dev/iicbus/mux X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/mux X-SVN-Commit-Revision: 356522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 22:48:15 -0000 Author: ian Date: Wed Jan 8 22:48:14 2020 New Revision: 356522 URL: https://svnweb.freebsd.org/changeset/base/356522 Log: Change some KASSERT to device_printf + return EINVAL. There's no need to bring the whole kernel down due to a configuration error detected when a module is loaded, it suffices to just not attach the device. Modified: head/sys/dev/iicbus/mux/iicmux.c Modified: head/sys/dev/iicbus/mux/iicmux.c ============================================================================== --- head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 22:45:32 2020 (r356521) +++ head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 22:48:14 2020 (r356522) @@ -222,10 +222,16 @@ iicmux_add_child(device_t dev, device_t child, int bus { struct iicmux_softc *sc = device_get_softc(dev); - KASSERT(busidx < sc->numbuses, - ("iicmux_add_child: bus idx %d too big", busidx)); - KASSERT(sc->childdevs[busidx] == NULL, - ("iicmux_add_child: bus idx %d already added", busidx)); + if (busidx >= sc->numbuses) { + device_printf(dev, + "iicmux_add_child: bus idx %d too big", busidx); + return (EINVAL); + } + if (sc->childdevs[busidx] != NULL) { + device_printf(dev, "iicmux_add_child: bus idx %d already added", + busidx); + return (EINVAL); + } sc->childdevs[busidx] = child; if (sc->maxbus < busidx) @@ -240,12 +246,11 @@ iicmux_attach(device_t dev, device_t busdev, int numbu struct iicmux_softc *sc = device_get_softc(dev); int i, numadded; - /* - * Init the softc... - */ - KASSERT(numbuses <= IICMUX_MAX_BUSES, - ("iicmux_attach: numbuses %d exceeds max %d\n", - numbuses, IICMUX_MAX_BUSES)); + if (numbuses >= IICMUX_MAX_BUSES) { + device_printf(dev, "iicmux_attach: numbuses %d > max %d\n", + numbuses, IICMUX_MAX_BUSES); + return (EINVAL); + } sc->dev = dev; sc->busdev = busdev; From owner-svn-src-head@freebsd.org Wed Jan 8 22:55:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B1501FDD49; Wed, 8 Jan 2020 22:55:25 +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 47tPj91YNtz4Gqj; Wed, 8 Jan 2020 22:55:25 +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 2FD531F578; Wed, 8 Jan 2020 22:55:25 +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 008MtPB6073655; Wed, 8 Jan 2020 22:55:25 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008MtMsY073642; Wed, 8 Jan 2020 22:55:22 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001082255.008MtMsY073642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 8 Jan 2020 22:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356523 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 356523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 22:55:25 -0000 Author: vmaffione Date: Wed Jan 8 22:55:22 2020 New Revision: 356523 URL: https://svnweb.freebsd.org/changeset/base/356523 Log: bhyve: add wrapper for debug printf statements Add printf() wrapper to use CR/CRLF terminators depending on whether stdio is mapped to a tty open in raw mode. Try to use the wrapper everywhere. For now we leave the custom DPRINTF/WPRINTF defined by device models, but we may remove them in the future. Reviewed by: grehan, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22657 Added: head/usr.sbin/bhyve/debug.h (contents, props changed) Modified: head/usr.sbin/bhyve/audio.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/bootrom.c head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/hda_codec.c head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/net_utils.c head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_fbuf.c head/usr.sbin/bhyve/pci_hda.c head/usr.sbin/bhyve/pci_hda.h head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyve/pci_nvme.c head/usr.sbin/bhyve/pci_uart.c head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/pci_virtio_scsi.c head/usr.sbin/bhyve/pci_xhci.c head/usr.sbin/bhyve/ps2kbd.c head/usr.sbin/bhyve/ps2mouse.c head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/smbiostbl.c head/usr.sbin/bhyve/task_switch.c head/usr.sbin/bhyve/uart_emul.c head/usr.sbin/bhyve/usb_mouse.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/xmsr.c Modified: head/usr.sbin/bhyve/audio.c ============================================================================== --- head/usr.sbin/bhyve/audio.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/audio.c Wed Jan 8 22:55:22 2020 (r356523) @@ -92,7 +92,7 @@ audio_init(const char *dev_name, uint8_t dir) if (strlen(dev_name) < sizeof(aud->dev_name)) memcpy(aud->dev_name, dev_name, strlen(dev_name) + 1); else { - DPRINTF("dev_name too big\n\r"); + DPRINTF("dev_name too big"); free(aud); return NULL; } @@ -101,7 +101,7 @@ audio_init(const char *dev_name, uint8_t dir) aud->fd = open(aud->dev_name, aud->dir ? O_WRONLY : O_RDONLY, 0); if (aud->fd == -1) { - DPRINTF("Failed to open dev: %s, errno: %d\n\r", + DPRINTF("Failed to open dev: %s, errno: %d", aud->dev_name, errno); free(aud); return (NULL); @@ -137,7 +137,7 @@ audio_set_params(struct audio *aud, struct audio_param assert(params); if ((audio_fd = aud->fd) < 0) { - DPRINTF("Incorrect audio device descriptor for %s\n\r", + DPRINTF("Incorrect audio device descriptor for %s", aud->dev_name); return (-1); } @@ -146,7 +146,7 @@ audio_set_params(struct audio *aud, struct audio_param if (aud->inited) { err = ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); if (err == -1) { - DPRINTF("Failed to reset fd: %d, errno: %d\n\r", + DPRINTF("Failed to reset fd: %d, errno: %d", aud->fd, errno); return (-1); } @@ -157,14 +157,14 @@ audio_set_params(struct audio *aud, struct audio_param format = params->format; err = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format); if (err == -1) { - DPRINTF("Fail to set fmt: 0x%x errno: %d\n\r", + DPRINTF("Fail to set fmt: 0x%x errno: %d", params->format, errno); return -1; } /* The device does not support the requested audio format */ if (format != params->format) { - DPRINTF("Mismatch format: 0x%x params->format: 0x%x\n\r", + DPRINTF("Mismatch format: 0x%x params->format: 0x%x", format, params->format); return -1; } @@ -173,14 +173,14 @@ audio_set_params(struct audio *aud, struct audio_param channels = params->channels; err = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &channels); if (err == -1) { - DPRINTF("Fail to set channels: %d errno: %d\n\r", + DPRINTF("Fail to set channels: %d errno: %d", params->channels, errno); return -1; } /* The device does not support the requested no. of channels */ if (channels != params->channels) { - DPRINTF("Mismatch channels: %d params->channels: %d\n\r", + DPRINTF("Mismatch channels: %d params->channels: %d", channels, params->channels); return -1; } @@ -189,14 +189,14 @@ audio_set_params(struct audio *aud, struct audio_param rate = params->rate; err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &rate); if (err == -1) { - DPRINTF("Fail to set speed: %d errno: %d\n\r", + DPRINTF("Fail to set speed: %d errno: %d", params->rate, errno); return -1; } /* The device does not support the requested rate / speed */ if (rate != params->rate) { - DPRINTF("Mismatch rate: %d params->rate: %d\n\r", + DPRINTF("Mismatch rate: %d params->rate: %d", rate, params->rate); return -1; } @@ -205,10 +205,10 @@ audio_set_params(struct audio *aud, struct audio_param err = ioctl(audio_fd, aud->dir ? SNDCTL_DSP_GETOSPACE : SNDCTL_DSP_GETISPACE, &info); if (err == -1) { - DPRINTF("Fail to get audio buf info errno: %d\n\r", errno); + DPRINTF("Fail to get audio buf info errno: %d", errno); return -1; } - DPRINTF("fragstotal: 0x%x fragsize: 0x%x\n\r", + DPRINTF("fragstotal: 0x%x fragsize: 0x%x", info.fragstotal, info.fragsize); #endif return 0; @@ -237,7 +237,7 @@ audio_playback(struct audio *aud, const void *buf, siz while (total < count) { len = write(audio_fd, buf + total, count - total); if (len == -1) { - DPRINTF("Fail to write to fd: %d, errno: %d\n\r", + DPRINTF("Fail to write to fd: %d, errno: %d", audio_fd, errno); return -1; } @@ -273,7 +273,7 @@ audio_record(struct audio *aud, void *buf, size_t coun while (total < count) { len = read(audio_fd, buf + total, count - total); if (len == -1) { - DPRINTF("Fail to write to fd: %d, errno: %d\n\r", + DPRINTF("Fail to write to fd: %d, errno: %d", audio_fd, errno); return -1; } Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/bhyverun.c Wed Jan 8 22:55:22 2020 (r356523) @@ -167,6 +167,8 @@ uint16_t cores, maxcpus, sockets, threads; char *guest_uuid_str; +int raw_stdio = 0; + static int gdb_port = 0; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/block_if.c Wed Jan 8 22:55:22 2020 (r356523) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include "bhyverun.h" +#include "debug.h" #include "mevent.h" #include "block_if.h" @@ -442,7 +443,7 @@ blockif_open(const char *optstr, const char *ident) else if (sscanf(cp, "sectorsize=%d", &ssopt) == 1) pssopt = ssopt; else { - fprintf(stderr, "Invalid device option \"%s\"\n", cp); + EPRINTLN("Invalid device option \"%s\"", cp); goto err; } } @@ -514,7 +515,7 @@ blockif_open(const char *optstr, const char *ident) if (ssopt != 0) { if (!powerof2(ssopt) || !powerof2(pssopt) || ssopt < 512 || ssopt > pssopt) { - fprintf(stderr, "Invalid sector size %d/%d\n", + EPRINTLN("Invalid sector size %d/%d", ssopt, pssopt); goto err; } @@ -528,8 +529,8 @@ blockif_open(const char *optstr, const char *ident) */ if (S_ISCHR(sbuf.st_mode)) { if (ssopt < sectsz || (ssopt % sectsz) != 0) { - fprintf(stderr, "Sector size %d incompatible " - "with underlying device sector size %d\n", + EPRINTLN("Sector size %d incompatible " + "with underlying device sector size %d", ssopt, sectsz); goto err; } Modified: head/usr.sbin/bhyve/bootrom.c ============================================================================== --- head/usr.sbin/bhyve/bootrom.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/bootrom.c Wed Jan 8 22:55:22 2020 (r356523) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include "bhyverun.h" #include "bootrom.h" +#include "debug.h" #define MAX_BOOTROM_SIZE (16 * 1024 * 1024) /* 16 MB */ @@ -60,13 +61,13 @@ bootrom_init(struct vmctx *ctx, const char *romfile) rv = -1; fd = open(romfile, O_RDONLY); if (fd < 0) { - fprintf(stderr, "Error opening bootrom \"%s\": %s\n", + EPRINTLN("Error opening bootrom \"%s\": %s", romfile, strerror(errno)); goto done; } if (fstat(fd, &sbuf) < 0) { - fprintf(stderr, "Could not fstat bootrom file \"%s\": %s\n", + EPRINTLN("Could not fstat bootrom file \"%s\": %s", romfile, strerror(errno)); goto done; } @@ -76,13 +77,13 @@ bootrom_init(struct vmctx *ctx, const char *romfile) * MMIO space (e.g. APIC, HPET, MSI). */ if (sbuf.st_size > MAX_BOOTROM_SIZE || sbuf.st_size < PAGE_SIZE) { - fprintf(stderr, "Invalid bootrom size %ld\n", sbuf.st_size); + EPRINTLN("Invalid bootrom size %ld", sbuf.st_size); goto done; } if (sbuf.st_size & PAGE_MASK) { - fprintf(stderr, "Bootrom size %ld is not a multiple of the " - "page size\n", sbuf.st_size); + EPRINTLN("Bootrom size %ld is not a multiple of the " + "page size", sbuf.st_size); goto done; } @@ -100,8 +101,8 @@ bootrom_init(struct vmctx *ctx, const char *romfile) for (i = 0; i < sbuf.st_size / PAGE_SIZE; i++) { rlen = read(fd, ptr + i * PAGE_SIZE, PAGE_SIZE); if (rlen != PAGE_SIZE) { - fprintf(stderr, "Incomplete read of page %d of bootrom " - "file %s: %ld bytes\n", i, romfile, rlen); + EPRINTLN("Incomplete read of page %d of bootrom " + "file %s: %ld bytes", i, romfile, rlen); goto done; } } Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/consport.c Wed Jan 8 22:55:22 2020 (r356523) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "inout.h" #include "pci_lpc.h" +#include "debug.h" #define BVM_CONSOLE_PORT 0x220 #define BVM_CONS_SIG ('b' << 8 | 'v') @@ -70,6 +71,7 @@ ttyopen(void) cfmakeraw(&tio_new); tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); + raw_stdio = 1; atexit(ttyclose); } Added: head/usr.sbin/bhyve/debug.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/debug.h Wed Jan 8 22:55:22 2020 (r356523) @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Vincenzo Maffione + * + * 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 ``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 _DEBUG_H_ +#define _DEBUG_H_ + + +extern int raw_stdio; + +#define FPRINTLN(filep, fmt, arg...) \ + do { \ + if (raw_stdio) \ + fprintf(filep, fmt "\r\n", ##arg); \ + else \ + fprintf(filep, fmt "\n", ##arg); \ + } while (0) + +#define PRINTLN(fmt, arg...) FPRINTLN(stdout, fmt, ##arg) +#define EPRINTLN(fmt, arg...) FPRINTLN(stderr, fmt, ##arg) + +#endif Modified: head/usr.sbin/bhyve/hda_codec.c ============================================================================== --- head/usr.sbin/bhyve/hda_codec.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/hda_codec.c Wed Jan 8 22:55:22 2020 (r356523) @@ -400,7 +400,7 @@ hda_codec_init(struct hda_codec_inst *hci, const char if (!(play || rec)) return (-1); - DPRINTF("cad: 0x%x opts: %s\n\r", hci->cad, opts); + DPRINTF("cad: 0x%x opts: %s", hci->cad, opts); sc = calloc(1, sizeof(*sc)); if (!sc) @@ -420,7 +420,7 @@ hda_codec_init(struct hda_codec_inst *hci, const char sc->conf_default = hda_codec_conf_default; sc->pin_ctrl_default = hda_codec_pin_ctrl_default; sc->verb_handlers = hda_codec_verb_handlers; - DPRINTF("HDA Codec nodes: %d\n\r", sc->no_nodes); + DPRINTF("HDA Codec nodes: %d", sc->no_nodes); /* * Initialize the Audio Output stream @@ -435,7 +435,7 @@ hda_codec_init(struct hda_codec_inst *hci, const char st->aud = audio_init(play, 1); if (!st->aud) { - DPRINTF("Fail to init the output audio player\n\r"); + DPRINTF("Fail to init the output audio player"); return (-1); } } @@ -453,7 +453,7 @@ hda_codec_init(struct hda_codec_inst *hci, const char st->aud = audio_init(rec, 0); if (!st->aud) { - DPRINTF("Fail to init the input audio player\n\r"); + DPRINTF("Fail to init the input audio player"); return (-1); } } @@ -488,11 +488,11 @@ hda_codec_reset(struct hda_codec_inst *hci) st->right_mute = HDA_CODEC_SET_AMP_GAIN_MUTE_MUTE; } - DPRINTF("cad: 0x%x\n\r", hci->cad); + DPRINTF("cad: 0x%x", hci->cad); if (!hops->signal) { DPRINTF("The controller ops does not implement \ - the signal function\n\r"); + the signal function"); return (-1); } @@ -538,7 +538,7 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t if (!hops->response) { DPRINTF("The controller ops does not implement \ - the response function\n\r"); + the response function"); return (-1); } @@ -566,11 +566,11 @@ hda_codec_command(struct hda_codec_inst *hci, uint32_t if (sc->verb_handlers[nid]) res = sc->verb_handlers[nid](sc, verb, payload); else - DPRINTF("Unknown VERB: 0x%x\n\r", verb); + DPRINTF("Unknown VERB: 0x%x", verb); break; } - DPRINTF("cad: 0x%x nid: 0x%x verb: 0x%x payload: 0x%x response: 0x%x\n\r", + DPRINTF("cad: 0x%x nid: 0x%x verb: 0x%x payload: 0x%x response: 0x%x", cad, nid, verb, payload, res); return (hops->response(hci, res, HDA_CODEC_RESPONSE_EX_SOL)); @@ -595,11 +595,11 @@ hda_codec_notify(struct hda_codec_inst *hci, uint8_t r i = dir ? HDA_CODEC_STREAM_OUTPUT : HDA_CODEC_STREAM_INPUT; st = &sc->streams[i]; - DPRINTF("run: %d, stream: 0x%x, st->stream: 0x%x dir: %d\n\r", + DPRINTF("run: %d, stream: 0x%x, st->stream: 0x%x dir: %d", run, stream, st->stream, dir); if (stream != st->stream) { - DPRINTF("Stream not found\n\r"); + DPRINTF("Stream not found"); return (0); } @@ -653,7 +653,7 @@ hda_codec_parse_format(uint16_t fmt, struct audio_para params->format = AFMT_S32_LE; break; default: - DPRINTF("Unknown format bits: 0x%x\n\r", + DPRINTF("Unknown format bits: 0x%x", fmt & HDA_CODEC_FMT_BITS_MASK); return (-1); } @@ -719,7 +719,7 @@ hda_codec_audio_output_do_setup(void *arg) if (err) return (-1); - DPRINTF("rate: %d, channels: %d, format: 0x%x\n\r", + DPRINTF("rate: %d, channels: %d, format: 0x%x", params.rate, params.channels, params.format); return (audio_set_params(aud, ¶ms)); @@ -778,7 +778,7 @@ hda_codec_audio_input_do_setup(void *arg) if (err) return (-1); - DPRINTF("rate: %d, channels: %d, format: 0x%x\n\r", + DPRINTF("rate: %d, channels: %d, format: 0x%x", params.rate, params.channels, params.format); return (audio_set_params(aud, ¶ms)); @@ -792,7 +792,7 @@ hda_codec_audio_inout_nid(struct hda_codec_stream *st, uint8_t mute = 0; uint8_t gain = 0; - DPRINTF("%s verb: 0x%x, payload, 0x%x\n\r", st->actx.name, verb, payload); + DPRINTF("%s verb: 0x%x, payload, 0x%x", st->actx.name, verb, payload); switch (verb) { case HDA_CMD_VERB_GET_CONV_FMT: @@ -804,10 +804,10 @@ hda_codec_audio_inout_nid(struct hda_codec_stream *st, case HDA_CMD_VERB_GET_AMP_GAIN_MUTE: if (payload & HDA_CMD_GET_AMP_GAIN_MUTE_LEFT) { res = st->left_gain | st->left_mute; - DPRINTF("GET_AMP_GAIN_MUTE_LEFT: 0x%x\n\r", res); + DPRINTF("GET_AMP_GAIN_MUTE_LEFT: 0x%x", res); } else { res = st->right_gain | st->right_mute; - DPRINTF("GET_AMP_GAIN_MUTE_RIGHT: 0x%x\n\r", res); + DPRINTF("GET_AMP_GAIN_MUTE_RIGHT: 0x%x", res); } break; case HDA_CMD_VERB_SET_AMP_GAIN_MUTE: @@ -818,14 +818,14 @@ hda_codec_audio_inout_nid(struct hda_codec_stream *st, st->left_mute = mute; st->left_gain = gain; DPRINTF("SET_AMP_GAIN_MUTE_LEFT: \ - mute: 0x%x gain: 0x%x\n\r", mute, gain); + mute: 0x%x gain: 0x%x", mute, gain); } if (payload & HDA_CMD_SET_AMP_GAIN_MUTE_RIGHT) { st->right_mute = mute; st->right_gain = gain; DPRINTF("SET_AMP_GAIN_MUTE_RIGHT: \ - mute: 0x%x gain: 0x%x\n\r", mute, gain); + mute: 0x%x gain: 0x%x", mute, gain); } break; case HDA_CMD_VERB_GET_CONV_STREAM_CHAN: @@ -834,13 +834,13 @@ hda_codec_audio_inout_nid(struct hda_codec_stream *st, case HDA_CMD_VERB_SET_CONV_STREAM_CHAN: st->channel = payload & 0x0f; st->stream = (payload >> 4) & 0x0f; - DPRINTF("st->channel: 0x%x st->stream: 0x%x\n\r", + DPRINTF("st->channel: 0x%x st->stream: 0x%x", st->channel, st->stream); if (!st->stream) hda_audio_ctxt_stop(&st->actx); break; default: - DPRINTF("Unknown VERB: 0x%x\n\r", verb); + DPRINTF("Unknown VERB: 0x%x", verb); break; } @@ -867,7 +867,7 @@ hda_audio_ctxt_thr(void *arg) { struct hda_audio_ctxt *actx = arg; - DPRINTF("Start Thread: %s\n\r", actx->name); + DPRINTF("Start Thread: %s", actx->name); pthread_mutex_lock(&actx->mtx); while (1) { Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/mptbl.c Wed Jan 8 22:55:22 2020 (r356523) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi.h" +#include "debug.h" #include "bhyverun.h" #include "mptbl.h" #include "pci_emul.h" @@ -312,7 +313,7 @@ mptable_build(struct vmctx *ctx, int ncpu) startaddr = paddr_guest2host(ctx, MPTABLE_BASE, MPTABLE_MAX_LENGTH); if (startaddr == NULL) { - fprintf(stderr, "mptable requires mapped mem\n"); + EPRINTLN("mptable requires mapped mem"); return (ENOMEM); } @@ -323,10 +324,10 @@ mptable_build(struct vmctx *ctx, int ncpu) */ for (bus = 1; bus <= PCI_BUSMAX; bus++) { if (pci_bus_configured(bus)) { - fprintf(stderr, "MPtable is incompatible with " - "multiple PCI hierarchies.\r\n"); - fprintf(stderr, "MPtable generation can be disabled " - "by passing the -Y option to bhyve(8).\r\n"); + EPRINTLN("MPtable is incompatible with " + "multiple PCI hierarchies."); + EPRINTLN("MPtable generation can be disabled " + "by passing the -Y option to bhyve(8)."); return (EINVAL); } } Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/net_backends.c Wed Jan 8 22:55:22 2020 (r356523) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include +#include "debug.h" #include "iov.h" #include "mevent.h" #include "net_backends.h" @@ -156,7 +157,7 @@ SET_DECLARE(net_backend_set, struct net_backend); #define VNET_HDR_LEN sizeof(struct virtio_net_rxhdr) -#define WPRINTF(params) printf params +#define WPRINTF(params) PRINTLN params /* * The tap backend @@ -192,7 +193,7 @@ tap_init(struct net_backend *be, const char *devname, #endif if (cb == NULL) { - WPRINTF(("TAP backend requires non-NULL callback\n\r")); + WPRINTF(("TAP backend requires non-NULL callback")); return (-1); } @@ -201,7 +202,7 @@ tap_init(struct net_backend *be, const char *devname, be->fd = open(tbuf, O_RDWR); if (be->fd == -1) { - WPRINTF(("open of tap device %s failed\n\r", tbuf)); + WPRINTF(("open of tap device %s failed", tbuf)); goto error; } @@ -210,7 +211,7 @@ tap_init(struct net_backend *be, const char *devname, * notifications with the event loop */ if (ioctl(be->fd, FIONBIO, &opt) < 0) { - WPRINTF(("tap device O_NONBLOCK failed\n\r")); + WPRINTF(("tap device O_NONBLOCK failed")); goto error; } @@ -222,7 +223,7 @@ tap_init(struct net_backend *be, const char *devname, priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { - WPRINTF(("Could not register event\n\r")); + WPRINTF(("Could not register event")); goto error; } @@ -363,7 +364,7 @@ netmap_set_vnet_hdr_len(struct net_backend *be, int vn req.nr_arg1 = vnet_hdr_len; err = ioctl(be->fd, NIOCREGIF, &req); if (err) { - WPRINTF(("Unable to set vnet header length %d\n\r", + WPRINTF(("Unable to set vnet header length %d", vnet_hdr_len)); return (err); } @@ -420,7 +421,7 @@ netmap_init(struct net_backend *be, const char *devnam priv->nmd = nm_open(priv->ifname, NULL, NETMAP_NO_TX_POLL, NULL); if (priv->nmd == NULL) { - WPRINTF(("Unable to nm_open(): interface '%s', errno (%s)\n\r", + WPRINTF(("Unable to nm_open(): interface '%s', errno (%s)", devname, strerror(errno))); free(priv); return (-1); @@ -435,7 +436,7 @@ netmap_init(struct net_backend *be, const char *devnam priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { - WPRINTF(("Could not register event\n\r")); + WPRINTF(("Could not register event")); return (-1); } @@ -472,7 +473,7 @@ netmap_send(struct net_backend *be, struct iovec *iov, ring = priv->tx; head = ring->head; if (head == ring->tail) { - WPRINTF(("No space, drop %zu bytes\n\r", count_iov(iov, iovcnt))); + WPRINTF(("No space, drop %zu bytes", count_iov(iov, iovcnt))); goto txsync; } nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); @@ -513,7 +514,7 @@ netmap_send(struct net_backend *be, struct iovec *iov, * We ran out of netmap slots while * splitting the iovec fragments. */ - WPRINTF(("No space, drop %zu bytes\n\r", + WPRINTF(("No space, drop %zu bytes", count_iov(iov, iovcnt))); goto txsync; } @@ -585,7 +586,7 @@ netmap_recv(struct net_backend *be, struct iovec *iov, iovcnt--; if (iovcnt == 0) { /* No space to receive. */ - WPRINTF(("Short iov, drop %zd bytes\n\r", + WPRINTF(("Short iov, drop %zd bytes", totlen)); return (-ENOSPC); } Modified: head/usr.sbin/bhyve/net_utils.c ============================================================================== --- head/usr.sbin/bhyve/net_utils.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/net_utils.c Wed Jan 8 22:55:22 2020 (r356523) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include "bhyverun.h" +#include "debug.h" #include "net_utils.h" int @@ -53,7 +54,7 @@ net_parsemac(char *mac_str, uint8_t *mac_addr) if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { - fprintf(stderr, "Invalid MAC %s\n", mac_str); + EPRINTLN("Invalid MAC %s", mac_str); return (EINVAL); } else memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/pci_ahci.c Wed Jan 8 22:55:22 2020 (r356523) @@ -240,7 +240,7 @@ ahci_generate_intr(struct pci_ahci_softc *sc, uint32_t if (p->is & p->ie) sc->is |= (1 << i); } - DPRINTF("%s(%08x) %08x\n\r", __func__, mask, sc->is); + DPRINTF("%s(%08x) %08x", __func__, mask, sc->is); /* If there is nothing enabled -- clear legacy interrupt and exit. */ if (sc->is == 0 || (sc->ghc & AHCI_GHC_IE) == 0) { @@ -282,7 +282,7 @@ ahci_port_intr(struct ahci_port *p) struct pci_devinst *pi = sc->asc_pi; int nmsg; - DPRINTF("%s(%d) %08x/%08x %08x\n\r", __func__, + DPRINTF("%s(%d) %08x/%08x %08x", __func__, p->port, p->is, p->ie, sc->is); /* If there is nothing enabled -- we are done. */ @@ -341,7 +341,7 @@ ahci_write_fis(struct ahci_port *p, enum sata_fis_type irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_PS : 0; break; default: - WPRINTF("unsupported fis type %d\n\r", ft); + WPRINTF("unsupported fis type %d", ft); return; } if (fis[2] & ATA_S_ERROR) { @@ -1601,7 +1601,7 @@ handle_packet_cmd(struct ahci_port *p, int slot, uint8 DPRINTF("ACMD:"); for (i = 0; i < 16; i++) DPRINTF("%02x ", acmd[i]); - DPRINTF("\n\r"); + DPRINTF(""); } #endif @@ -1788,7 +1788,7 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t handle_packet_cmd(p, slot, cfis); break; default: - WPRINTF("Unsupported cmd:%02x\n\r", cfis[2]); + WPRINTF("Unsupported cmd:%02x", cfis[2]); ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; @@ -1818,22 +1818,22 @@ ahci_handle_slot(struct ahci_port *p, int slot) #ifdef AHCI_DEBUG prdt = (struct ahci_prdt_entry *)(cfis + 0x80); - DPRINTF("\n\rcfis:"); + DPRINTF("cfis:"); for (i = 0; i < cfl; i++) { if (i % 10 == 0) - DPRINTF("\n\r"); + DPRINTF(""); DPRINTF("%02x ", cfis[i]); } - DPRINTF("\n\r"); + DPRINTF(""); for (i = 0; i < hdr->prdtl; i++) { - DPRINTF("%d@%08"PRIx64"\n\r", prdt->dbc & 0x3fffff, prdt->dba); + DPRINTF("%d@%08"PRIx64"", prdt->dbc & 0x3fffff, prdt->dba); prdt++; } #endif if (cfis[0] != FIS_TYPE_REGH2D) { - WPRINTF("Not a H2D FIS:%02x\n\r", cfis[0]); + WPRINTF("Not a H2D FIS:%02x", cfis[0]); return; } @@ -1889,7 +1889,7 @@ ata_ioreq_cb(struct blockif_req *br, int err) uint8_t *cfis; int slot, ncq, dsm; - DPRINTF("%s %d\n\r", __func__, err); + DPRINTF("%s %d", __func__, err); ncq = dsm = 0; aior = br->br_param; @@ -1949,7 +1949,7 @@ ata_ioreq_cb(struct blockif_req *br, int err) ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); - DPRINTF("%s exit\n\r", __func__); + DPRINTF("%s exit", __func__); } static void @@ -1963,7 +1963,7 @@ atapi_ioreq_cb(struct blockif_req *br, int err) uint32_t tfd; int slot; - DPRINTF("%s %d\n\r", __func__, err); + DPRINTF("%s %d", __func__, err); aior = br->br_param; p = aior->io_pr; @@ -2011,7 +2011,7 @@ atapi_ioreq_cb(struct blockif_req *br, int err) ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); - DPRINTF("%s exit\n\r", __func__); + DPRINTF("%s exit", __func__); } static void @@ -2048,7 +2048,7 @@ pci_ahci_port_write(struct pci_ahci_softc *sc, uint64_ offset = (offset - AHCI_OFFSET) % AHCI_STEP; struct ahci_port *p = &sc->port[port]; - DPRINTF("pci_ahci_port %d: write offset 0x%"PRIx64" value 0x%"PRIx64"\n\r", + DPRINTF("pci_ahci_port %d: write offset 0x%"PRIx64" value 0x%"PRIx64"", port, offset, value); switch (offset) { @@ -2120,7 +2120,7 @@ pci_ahci_port_write(struct pci_ahci_softc *sc, uint64_ case AHCI_P_TFD: case AHCI_P_SIG: case AHCI_P_SSTS: - WPRINTF("pci_ahci_port: read only registers 0x%"PRIx64"\n\r", offset); + WPRINTF("pci_ahci_port: read only registers 0x%"PRIx64"", offset); break; case AHCI_P_SCTL: p->sctl = value; @@ -2149,7 +2149,7 @@ pci_ahci_port_write(struct pci_ahci_softc *sc, uint64_ static void pci_ahci_host_write(struct pci_ahci_softc *sc, uint64_t offset, uint64_t value) { - DPRINTF("pci_ahci_host: write offset 0x%"PRIx64" value 0x%"PRIx64"\n\r", + DPRINTF("pci_ahci_host: write offset 0x%"PRIx64" value 0x%"PRIx64"", offset, value); switch (offset) { @@ -2157,7 +2157,7 @@ pci_ahci_host_write(struct pci_ahci_softc *sc, uint64_ case AHCI_PI: case AHCI_VS: case AHCI_CAP2: - DPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"\n\r", offset); + DPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"", offset); break; case AHCI_GHC: if (value & AHCI_GHC_HR) { @@ -2195,7 +2195,7 @@ pci_ahci_write(struct vmctx *ctx, int vcpu, struct pci else if (offset < AHCI_OFFSET + sc->ports * AHCI_STEP) pci_ahci_port_write(sc, offset, value); else - WPRINTF("pci_ahci: unknown i/o write offset 0x%"PRIx64"\n\r", offset); + WPRINTF("pci_ahci: unknown i/o write offset 0x%"PRIx64"", offset); pthread_mutex_unlock(&sc->mtx); } @@ -2226,7 +2226,7 @@ pci_ahci_host_read(struct pci_ahci_softc *sc, uint64_t value = 0; break; } - DPRINTF("pci_ahci_host: read offset 0x%"PRIx64" value 0x%x\n\r", + DPRINTF("pci_ahci_host: read offset 0x%"PRIx64" value 0x%x", offset, value); return (value); @@ -2267,7 +2267,7 @@ pci_ahci_port_read(struct pci_ahci_softc *sc, uint64_t break; } - DPRINTF("pci_ahci_port %d: read offset 0x%"PRIx64" value 0x%x\n\r", + DPRINTF("pci_ahci_port %d: read offset 0x%"PRIx64" value 0x%x", port, offset, value); return value; @@ -2294,7 +2294,7 @@ pci_ahci_read(struct vmctx *ctx, int vcpu, struct pci_ value = pci_ahci_port_read(sc, offset); else { value = 0; - WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"\n\r", + WPRINTF("pci_ahci: unknown i/o read offset 0x%"PRIx64"", regoff); } value >>= 8 * (regoff & 0x3); Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Wed Jan 8 22:48:14 2020 (r356522) +++ head/usr.sbin/bhyve/pci_e82545.c Wed Jan 8 22:55:22 2020 (r356523) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "mii.h" #include "bhyverun.h" +#include "debug.h" #include "pci_emul.h" #include "mevent.h" #include "net_utils.h" @@ -229,8 +230,8 @@ struct ck_info { * Debug printf */ static int e82545_debug = 0; -#define DPRINTF(msg,params...) if (e82545_debug) fprintf(stderr, "e82545: " msg, params) -#define WPRINTF(msg,params...) fprintf(stderr, "e82545: " msg, params) +#define WPRINTF(msg,params...) PRINTLN("e82545: " msg, params) +#define DPRINTF(msg,params...) if (e82545_debug) WPRINTF(msg, params) #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) @@ -399,21 +400,21 @@ e82545_init_eeprom(struct e82545_softc *sc) } checksum = NVM_SUM - checksum; sc->eeprom_data[NVM_CHECKSUM_REG] = checksum; - DPRINTF("eeprom checksum: 0x%x\r\n", checksum); + DPRINTF("eeprom checksum: 0x%x", checksum); } static void e82545_write_mdi(struct e82545_softc *sc, uint8_t reg_addr, uint8_t phy_addr, uint32_t data) { - DPRINTF("Write mdi reg:0x%x phy:0x%x data: 0x%x\r\n", reg_addr, phy_addr, data); + DPRINTF("Write mdi reg:0x%x phy:0x%x data: 0x%x", reg_addr, phy_addr, data); } static uint32_t e82545_read_mdi(struct e82545_softc *sc, uint8_t reg_addr, uint8_t phy_addr) { - //DPRINTF("Read mdi reg:0x%x phy:0x%x\r\n", reg_addr, phy_addr); + //DPRINTF("Read mdi reg:0x%x phy:0x%x", reg_addr, phy_addr); switch (reg_addr) { case PHY_STATUS: return (MII_SR_LINK_STATUS | MII_SR_AUTONEG_CAPS | @@ -430,7 +431,7 @@ e82545_read_mdi(struct e82545_softc *sc, uint8_t reg_a case PHY_ID2: return (M88E1011_I_PHY_ID | E82545_REVISION_4) & 0xFFFF; default: - DPRINTF("Unknown mdi read reg:0x%x phy:0x%x\r\n", reg_addr, phy_addr); + DPRINTF("Unknown mdi read reg:0x%x phy:0x%x", reg_addr, phy_addr); return 0; } /* not reached */ @@ -442,13 +443,13 @@ e82545_eecd_strobe(struct e82545_softc *sc) /* Microwire state machine */ /* DPRINTF("eeprom state machine srtobe " - "0x%x 0x%x 0x%x 0x%x\r\n", + "0x%x 0x%x 0x%x 0x%x", sc->nvm_mode, sc->nvm_bits, sc->nvm_opaddr, sc->nvm_data);*/ if (sc->nvm_bits == 0) { DPRINTF("eeprom state machine not expecting data! " - "0x%x 0x%x 0x%x 0x%x\r\n", + "0x%x 0x%x 0x%x 0x%x", sc->nvm_mode, sc->nvm_bits, sc->nvm_opaddr, sc->nvm_data); return; @@ -479,13 +480,13 @@ e82545_eecd_strobe(struct e82545_softc *sc) uint16_t op = sc->nvm_opaddr & E82545_NVM_OPCODE_MASK; uint16_t addr = sc->nvm_opaddr & E82545_NVM_ADDR_MASK; if (op != E82545_NVM_OPCODE_WRITE) { - DPRINTF("Illegal eeprom write op 0x%x\r\n", + DPRINTF("Illegal eeprom write op 0x%x", sc->nvm_opaddr); } else if (addr >= E82545_NVM_EEPROM_SIZE) { - DPRINTF("Illegal eeprom write addr 0x%x\r\n", + DPRINTF("Illegal eeprom write addr 0x%x", sc->nvm_opaddr); } else { - DPRINTF("eeprom write eeprom[0x%x] = 0x%x\r\n", + DPRINTF("eeprom write eeprom[0x%x] = 0x%x", addr, sc->nvm_data); sc->eeprom_data[addr] = sc->nvm_data; } @@ -503,7 +504,7 @@ e82545_eecd_strobe(struct e82545_softc *sc) uint16_t op = sc->nvm_opaddr & E82545_NVM_OPCODE_MASK; switch (op) { case E82545_NVM_OPCODE_EWEN: - DPRINTF("eeprom write enable: 0x%x\r\n", + DPRINTF("eeprom write enable: 0x%x", sc->nvm_opaddr); /* back to opcode mode */ sc->nvm_opaddr = 0; @@ -518,10 +519,10 @@ e82545_eecd_strobe(struct e82545_softc *sc) sc->nvm_bits = E82545_NVM_DATA_BITS; if (addr < E82545_NVM_EEPROM_SIZE) { sc->nvm_data = sc->eeprom_data[addr]; - DPRINTF("eeprom read: eeprom[0x%x] = 0x%x\r\n", + DPRINTF("eeprom read: eeprom[0x%x] = 0x%x", addr, sc->nvm_data); } else { - DPRINTF("eeprom illegal read: 0x%x\r\n", + DPRINTF("eeprom illegal read: 0x%x", sc->nvm_opaddr); sc->nvm_data = 0; } @@ -533,7 +534,7 @@ e82545_eecd_strobe(struct e82545_softc *sc) sc->nvm_data = 0; break; default: - DPRINTF("eeprom unknown op: 0x%x\r\n", + DPRINTF("eeprom unknown op: 0x%x", sc->nvm_opaddr); /* back to opcode mode */ sc->nvm_opaddr = 0; @@ -543,7 +544,7 @@ e82545_eecd_strobe(struct e82545_softc *sc) } } else { DPRINTF("eeprom state machine wrong state! " - "0x%x 0x%x 0x%x 0x%x\r\n", + "0x%x 0x%x 0x%x 0x%x", sc->nvm_mode, sc->nvm_bits, sc->nvm_opaddr, sc->nvm_data); } @@ -558,7 +559,7 @@ e82545_itr_callback(int fd, enum ev_type type, void *p pthread_mutex_lock(&sc->esc_mtx); new = sc->esc_ICR & sc->esc_IMS; if (new && !sc->esc_irq_asserted) { - DPRINTF("itr callback: lintr assert %x\r\n", new); + DPRINTF("itr callback: lintr assert %x", new); sc->esc_irq_asserted = 1; pci_lintr_assert(sc->esc_pi); } else { @@ -573,7 +574,7 @@ e82545_icr_assert(struct e82545_softc *sc, uint32_t bi { uint32_t new; - DPRINTF("icr assert: 0x%x\r\n", bits); + DPRINTF("icr assert: 0x%x", bits); /* * An interrupt is only generated if bits are set that @@ -584,11 +585,11 @@ e82545_icr_assert(struct e82545_softc *sc, uint32_t bi sc->esc_ICR |= bits; if (new == 0) { - DPRINTF("icr assert: masked %x, ims %x\r\n", new, sc->esc_IMS); + DPRINTF("icr assert: masked %x, ims %x", new, sc->esc_IMS); } else if (sc->esc_mevpitr != NULL) { - DPRINTF("icr assert: throttled %x, ims %x\r\n", new, sc->esc_IMS); + DPRINTF("icr assert: throttled %x, ims %x", new, sc->esc_IMS); } else if (!sc->esc_irq_asserted) { - DPRINTF("icr assert: lintr assert %x\r\n", new); + DPRINTF("icr assert: lintr assert %x", new); sc->esc_irq_asserted = 1; pci_lintr_assert(sc->esc_pi); if (sc->esc_ITR != 0) { @@ -612,11 +613,11 @@ e82545_ims_change(struct e82545_softc *sc, uint32_t bi sc->esc_IMS |= bits; if (new == 0) { - DPRINTF("ims change: masked %x, ims %x\r\n", new, sc->esc_IMS); + DPRINTF("ims change: masked %x, ims %x", new, sc->esc_IMS); } else if (sc->esc_mevpitr != NULL) { - DPRINTF("ims change: throttled %x, ims %x\r\n", new, sc->esc_IMS); + DPRINTF("ims change: throttled %x, ims %x", new, sc->esc_IMS); } else if (!sc->esc_irq_asserted) { - DPRINTF("ims change: lintr assert %x\r\n", new); + DPRINTF("ims change: lintr assert %x", new); sc->esc_irq_asserted = 1; pci_lintr_assert(sc->esc_pi); if (sc->esc_ITR != 0) { @@ -631,7 +632,7 @@ static void e82545_icr_deassert(struct e82545_softc *sc, uint32_t bits) { - DPRINTF("icr deassert: 0x%x\r\n", bits); + DPRINTF("icr deassert: 0x%x", bits); sc->esc_ICR &= ~bits; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 8 23:03:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D0091FE062; Wed, 8 Jan 2020 23:03:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tPtr1CkYz4HPB; Wed, 8 Jan 2020 23:03:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24F0C1F767; Wed, 8 Jan 2020 23:03:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008N3mCS079558; Wed, 8 Jan 2020 23:03:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008N3mvh079557; Wed, 8 Jan 2020 23:03:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001082303.008N3mvh079557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 8 Jan 2020 23:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356525 - head/sys/dev/iicbus/mux X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/mux X-SVN-Commit-Revision: 356525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 23:03:48 -0000 Author: ian Date: Wed Jan 8 23:03:47 2020 New Revision: 356525 URL: https://svnweb.freebsd.org/changeset/base/356525 Log: Split the code to find and add iicbus children out to its own function. Move the decision to take an early exit from that function after adding children based on FDT data into the #ifdef FDT block, so that it doesn't offend coverity's notion of how the code should be written. (What's the point of compilers optimizing away dead code if static analyzers won't let you use the feature in conjuction with an #ifdef block?) Reported by: coverity via vangyzen@ Modified: head/sys/dev/iicbus/mux/iicmux.c Modified: head/sys/dev/iicbus/mux/iicmux.c ============================================================================== --- head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 22:59:31 2020 (r356524) +++ head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 23:03:47 2020 (r356525) @@ -240,36 +240,13 @@ iicmux_add_child(device_t dev, device_t child, int bus return (0); } -int -iicmux_attach(device_t dev, device_t busdev, int numbuses) +static int +iicmux_attach_children(struct iicmux_softc *sc) { - struct iicmux_softc *sc = device_get_softc(dev); - int i, numadded; - - if (numbuses >= IICMUX_MAX_BUSES) { - device_printf(dev, "iicmux_attach: numbuses %d > max %d\n", - numbuses, IICMUX_MAX_BUSES); - return (EINVAL); - } - - sc->dev = dev; - sc->busdev = busdev; - sc->maxbus = -1; - sc->numbuses = numbuses; - - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, - "debugmux", CTLFLAG_RWTUN, &sc->debugmux, 0, "debug mux operations"); - - /* - * Add children... - */ - numadded = 0; - + int i; #ifdef FDT phandle_t child, node, parent; - pcell_t reg; - int idx; + pcell_t idx; /* * Find our FDT node. Child nodes within our node will become our @@ -292,14 +269,13 @@ iicmux_attach(device_t dev, device_t busdev, int numbu * Attach the children represented in the device tree. */ for (child = OF_child(parent); child != 0; child = OF_peer(child)) { - if (OF_getencprop(child, "reg", ®, sizeof(reg)) == -1) { - device_printf(dev, + if (OF_getencprop(child, "reg", &idx, sizeof(idx)) == -1) { + device_printf(sc->dev, "child bus missing required 'reg' property\n"); continue; } - idx = (int)reg; if (idx >= sc->numbuses) { - device_printf(dev, + device_printf(sc->dev, "child bus 'reg' property %d exceeds the number " "of buses supported by the device (%d)\n", idx, sc->numbuses); @@ -309,21 +285,48 @@ iicmux_attach(device_t dev, device_t busdev, int numbu sc->childnodes[idx] = child; if (sc->maxbus < idx) sc->maxbus = idx; - ++numadded; } + + /* If we configured anything using FDT data, we're done. */ + if (sc->maxbus >= 0) + return (0); #endif /* FDT */ /* - * If we configured anything using FDT data, we're done. Otherwise add - * an iicbus child for every downstream bus supported by the mux chip. + * If we make it to here, we didn't add any children based on FDT data. + * Add an iicbus child for every downstream bus supported by the mux. */ - if (numadded > 0) - return (0); - for (i = 0; i < sc->numbuses; ++i) { sc->childdevs[i] = device_add_child(sc->dev, "iicbus", -1); + sc->maxbus = i; } - sc->maxbus = sc->numbuses - 1; + + return (0); +} + +int +iicmux_attach(device_t dev, device_t busdev, int numbuses) +{ + struct iicmux_softc *sc = device_get_softc(dev); + int err; + + if (numbuses >= IICMUX_MAX_BUSES) { + device_printf(dev, "iicmux_attach: numbuses %d > max %d\n", + numbuses, IICMUX_MAX_BUSES); + return (EINVAL); + } + + sc->dev = dev; + sc->busdev = busdev; + sc->maxbus = -1; + sc->numbuses = numbuses; + + if ((err = iicmux_attach_children(sc)) != 0) + return (err); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, + "debugmux", CTLFLAG_RWTUN, &sc->debugmux, 0, "debug mux operations"); return (0); } From owner-svn-src-head@freebsd.org Wed Jan 8 23:06:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 196B61FE140; Wed, 8 Jan 2020 23:06:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tPxd6xMfz4HXD; Wed, 8 Jan 2020 23:06:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E97E61F769; Wed, 8 Jan 2020 23:06:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008N6Dpk079721; Wed, 8 Jan 2020 23:06:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008N6DRK079720; Wed, 8 Jan 2020 23:06:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001082306.008N6DRK079720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 8 Jan 2020 23:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356526 - head/sys/dev/iicbus/mux X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus/mux X-SVN-Commit-Revision: 356526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 23:06:14 -0000 Author: ian Date: Wed Jan 8 23:06:13 2020 New Revision: 356526 URL: https://svnweb.freebsd.org/changeset/base/356526 Log: Remove some trailing whitespace; no functional changes. Modified: head/sys/dev/iicbus/mux/iicmux.c Modified: head/sys/dev/iicbus/mux/iicmux.c ============================================================================== --- head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 23:03:47 2020 (r356525) +++ head/sys/dev/iicbus/mux/iicmux.c Wed Jan 8 23:06:13 2020 (r356526) @@ -153,7 +153,7 @@ iicmux_intr(device_t dev, int event, char *buf) /* XXX iicbus_intr() in iiconf.c should return status. */ iicbus_intr(sc->busdev, event, buf); - return (0); + return (0); } static int @@ -213,7 +213,7 @@ iicmux_write(device_t dev, const char *buf, int len, i } /*------------------------------------------------------------------------------ - * iicmux helper functions, called by hardware-specific drivers. + * iicmux helper functions, called by hardware-specific drivers. * All these functions return a standard errno value. *----------------------------------------------------------------------------*/ @@ -324,7 +324,7 @@ iicmux_attach(device_t dev, device_t busdev, int numbu if ((err = iicmux_attach_children(sc)) != 0) return (err); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "debugmux", CTLFLAG_RWTUN, &sc->debugmux, 0, "debug mux operations"); From owner-svn-src-head@freebsd.org Wed Jan 8 23:30:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B651C1FEA7B; Wed, 8 Jan 2020 23:30:29 +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 47tQTd4Kwhz4JfN; Wed, 8 Jan 2020 23:30:29 +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 8B0AF1FB13; Wed, 8 Jan 2020 23:30:29 +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 008NUTXG091693; Wed, 8 Jan 2020 23:30:29 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008NURMB091682; Wed, 8 Jan 2020 23:30:27 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001082330.008NURMB091682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 8 Jan 2020 23:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356527 - in head/sys: dev/cxgbe/tom netinet netinet/tcp_stacks netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: dev/cxgbe/tom netinet netinet/tcp_stacks netinet6 X-SVN-Commit-Revision: 356527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 23:30:29 -0000 Author: bz Date: Wed Jan 8 23:30:26 2020 New Revision: 356527 URL: https://svnweb.freebsd.org/changeset/base/356527 Log: 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 [1]. 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. PR: 243193 [1] MFC after: 2 weeks Modified: head/sys/dev/cxgbe/tom/t4_tom.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/udp6_usrreq.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/dev/cxgbe/tom/t4_tom.c Wed Jan 8 23:30:26 2020 (r356527) @@ -1146,7 +1146,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: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_input.c Wed Jan 8 23:30:26 2020 (r356527) @@ -132,9 +132,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; @@ -892,8 +892,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: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_stacks/bbr.c Wed Jan 8 23:30:26 2020 (r356527) @@ -835,7 +835,7 @@ bbr_start_hpts_timer(struct tcp_bbr *bbr, struct tcpcb */ 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 @@ -998,7 +998,7 @@ bbr_timer_audit(struct tcpcb *tp, struct tcp_bbr *bbr, * (and the hptsi timer). */ return; - } else if (((tcp_always_keepalive || + } else if (((V_tcp_always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)) && (tmr_up == PACE_TMR_KEEP) && @@ -4919,7 +4919,7 @@ bbr_timeout_keepalive(struct tcpcb *tp, struct tcp_bbr 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; @@ -11790,7 +11790,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr ((bbr->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 || bbr->rc_inp->inp_socket->so_options & SO_KEEPALIVE) && + ((V_tcp_always_keepalive || bbr->rc_inp->inp_socket->so_options & SO_KEEPALIVE) && (tp->t_state <= TCPS_CLOSING)))) { /* * We could not send (probably in the hpts but Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_stacks/rack.c Wed Jan 8 23:30:26 2020 (r356527) @@ -2450,7 +2450,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 @@ -3022,7 +3022,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; @@ -7576,7 +7576,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) && @@ -7867,7 +7867,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr ((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: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_subr.c Wed Jan 8 23:30:26 2020 (r356527) @@ -3283,7 +3283,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: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_timer.c Wed Jan 8 23:30:26 2020 (r356527) @@ -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: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_timer.h Wed Jan 8 23:30:26 2020 (r356527) @@ -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: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/tcp_var.h Wed Jan 8 23:30:26 2020 (r356527) @@ -767,7 +767,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: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/udp_usrreq.c Wed Jan 8 23:30:26 2020 (r356527) @@ -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, @@ -686,7 +686,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: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet/udp_var.h Wed Jan 8 23:30:26 2020 (r356527) @@ -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: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Jan 8 23:06:13 2020 (r356526) +++ head/sys/netinet6/udp6_usrreq.c Wed Jan 8 23:30:26 2020 (r356527) @@ -481,7 +481,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-head@freebsd.org Wed Jan 8 23:34:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAFE61FEC67; Wed, 8 Jan 2020 23:34:50 +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 47tQZf4Q6Yz4K24; Wed, 8 Jan 2020 23:34:50 +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 8E65C1FCD4; Wed, 8 Jan 2020 23:34:50 +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 008NYoug097308; Wed, 8 Jan 2020 23:34:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008NYo86097307; Wed, 8 Jan 2020 23:34:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001082334.008NYo86097307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 8 Jan 2020 23:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356528 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 356528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 23:34:50 -0000 Author: bz Date: Wed Jan 8 23:34:50 2020 New Revision: 356528 URL: https://svnweb.freebsd.org/changeset/base/356528 Log: 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 MFC after: 2 weeks Modified: head/libexec/rc/rc.d/netoptions Modified: head/libexec/rc/rc.d/netoptions ============================================================================== --- head/libexec/rc/rc.d/netoptions Wed Jan 8 23:30:26 2020 (r356527) +++ head/libexec/rc/rc.d/netoptions Wed Jan 8 23:34:50 2020 (r356528) @@ -6,7 +6,7 @@ # PROVIDE: netoptions # REQUIRE: FILESYSTEMS # BEFORE: netif -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr From owner-svn-src-head@freebsd.org Thu Jan 9 00:34:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA075221851; Thu, 9 Jan 2020 00:34:33 +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 47tRvY443rz4Mgh; Thu, 9 Jan 2020 00:34:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id k14so5520153otn.4; Wed, 08 Jan 2020 16:34:33 -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=9PITG2Jep69Iye7nNTiTdmWORfQZo1Uyet5TeLUjZzQ=; b=S8VMsp1eZT3MdCkO5SSs0niXIW4GwHndeoWUshmLaInhDhRThIK07EvUzhm/u6V8hS LJdeSJ61igdnesdiZIew11H0n4y+GkDy6rqD+sbCq+WBYRnuQp0zXQVq+uH4aaHykwET az7NuN6BRy3lXVThq37SaWqXtG5Afk/WO6mm2R9GC//Cs4of0ULCkFEtnesF1O38dP/k nJU0nHfYpNiq9fXK8UPYMvezhhHHwrI0O9GmhD2zhg4NyiBE+04n+Nv6OLyXzZ6xbAwf bTHwfowzAb594ygxDg6bZCH9BB8sNbHqc1DrASJ+1HO4k9AP1TYAQI3SgDKxUTHMKQUr 7z2A== X-Gm-Message-State: APjAAAWaW1nWuYTIn/3cmP69HN4S1ukcNMdIng/rhCbZim7wBDEi4+Gz F8nKernSw21cB8nc+NT4QBh555Tx X-Google-Smtp-Source: APXvYqw/xvgVEw824vXI4xNPnlDRd6N8Tyw6kTfIK7swnr6hfdU/p4/CkYMNVYBLVzG2sfVvq+PQZw== X-Received: by 2002:a05:6830:151a:: with SMTP id k26mr6727233otp.74.1578530072226; Wed, 08 Jan 2020 16:34:32 -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 p83sm1623031oia.51.2020.01.08.16.34.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2020 16:34:32 -0800 (PST) Received: by mail-oi1-f179.google.com with SMTP id 13so2520386oij.13; Wed, 08 Jan 2020 16:34:32 -0800 (PST) X-Received: by 2002:aca:f484:: with SMTP id s126mr1070526oih.48.1578530071480; Wed, 08 Jan 2020 16:34:31 -0800 (PST) MIME-Version: 1.0 References: <202001082037.008Kb4kH089848@repo.freebsd.org> In-Reply-To: <202001082037.008Kb4kH089848@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 8 Jan 2020 16:34:20 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r356513 - in head/contrib/llvm-project/libunwind: include src To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47tRvY443rz4Mgh 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 00:34:33 -0000 I definitely don't condone this. I would prefer it be reverted. It has never been tested. It's got my name in the commit message, suggesting some level of my approval; I absolutely do not approve of it in any way. Cheers, Conrad On Wed, Jan 8, 2020 at 12:37 PM Ed Maste wrote: > > Author: emaste > Date: Wed Jan 8 20:37:03 2020 > New Revision: 356513 > URL: https://svnweb.freebsd.org/changeset/base/356513 > > Log: > libunwind: untested attempt to fix sparc64 build > > sparc64 is the only architecture currently using the DWARF unwinder from > GCC 4.2.1. Old GCC and related libraries are being removed soon; absent > other changes sparc64 would be left with no unwinder when that happens. > > Instead, commit these changes which should at least allow the LLVM > unwinder to build. Someone with access to the obolete sparc64 hardware > supported by FreeBSD will need to test the result. > > PR: 233405 > Submitted by: cem From owner-svn-src-head@freebsd.org Thu Jan 9 00:45:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 442EA221D05; Thu, 9 Jan 2020 00:45:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 47tS8k138pz4NMP; Thu, 9 Jan 2020 00:45:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id k4so4452858oik.2; Wed, 08 Jan 2020 16:45:57 -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=IHYckTUFiLGcxjX+Vv3zyvYChD3mRKw8fzOdcklyo+g=; b=khRAalop/eb9+oIqA2o4MCEIdRH3pp0Ns5r9rstj2DG0MKIHi1feJgWIg1I9kQyIec Ouc5Ualoo7sa8phCydOR2hcaMf8Vnj0TLUWagZQUMMJvK8a85OivW3amf1Xh0Rx7xCjp gVQjWIsr/5XMM82BDTikGyUPYrIt/Uw0DuJJmagUOgzxgIuVyR3fJWpTXVK+9D2Ox2mI MO7Dy/aQ1i9awog0c07A/hwIWZKWFoINe8XMaP41INMJoGfWj5kw7BLhxfeaEe0YpqRU gfy4NJB1LmABQn+0QpK8RuIuooa2CVi5Il2u2ExcTudCHQjhElnDImTzbp+p7jPgcn8w mpJw== X-Gm-Message-State: APjAAAXLtFmtGpFmVSIUPPlRN7ueqavPGMjY6YiGdC4nAZC+TUaKetqX 8xs3yLvahV7209pLnNjNm6if5C5M X-Google-Smtp-Source: APXvYqxG74+eTHAHjiu+d5Bx0JYSs0qA1LupT+nkqEipPQ5RXYJ/iCIrlvXmMT3ZF2FJkvO2pMnwnQ== X-Received: by 2002:aca:d787:: with SMTP id o129mr1140196oig.75.1578530756613; Wed, 08 Jan 2020 16:45:56 -0800 (PST) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com. [209.85.210.48]) by smtp.gmail.com with ESMTPSA id y6sm1719923oti.44.2020.01.08.16.45.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2020 16:45:56 -0800 (PST) Received: by mail-ot1-f48.google.com with SMTP id 66so5522685otd.9; Wed, 08 Jan 2020 16:45:56 -0800 (PST) X-Received: by 2002:a9d:7593:: with SMTP id s19mr5972348otk.219.1578530756274; Wed, 08 Jan 2020 16:45:56 -0800 (PST) MIME-Version: 1.0 References: <202001082216.008MGQpX049661@repo.freebsd.org> In-Reply-To: <202001082216.008MGQpX049661@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 8 Jan 2020 16:45:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r356520 - head/sys/opencrypto To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47tS8k138pz4NMP 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)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 00:45:58 -0000 On Wed, Jan 8, 2020 at 2:16 PM John Baldwin wrote: > > Author: jhb > Date: Wed Jan 8 22:16:26 2020 > New Revision: 356520 > URL: https://svnweb.freebsd.org/changeset/base/356520 > > Log: > Remove no-longer-used function prototype. > > Reported by: amd64-gcc Also me ;-). https://reviews.freebsd.org/D23077?id=66470#inline-143562 From owner-svn-src-head@freebsd.org Thu Jan 9 02:03:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DAFA223983; Thu, 9 Jan 2020 02:03:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tTsh3Kzrz4S07; Thu, 9 Jan 2020 02:03:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D88C21837; Thu, 9 Jan 2020 02:03:04 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009234iX086694; Thu, 9 Jan 2020 02:03:04 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009233PJ086690; Thu, 9 Jan 2020 02:03:03 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202001090203.009233PJ086690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 9 Jan 2020 02:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356534 - in head: share/man/man9 sys/arm/arm sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: share/man/man9 sys/arm/arm sys/vm X-SVN-Commit-Revision: 356534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 02:03:04 -0000 Author: rlibby Date: Thu Jan 9 02:03:03 2020 New Revision: 356534 URL: https://svnweb.freebsd.org/changeset/base/356534 Log: uma: reorganize flags - Garbage collect UMA_ZONE_PAGEABLE & UMA_ZONE_STATIC. - Move flag VTOSLAB from public to private. - Introduce public NOTPAGE flag and make HASH private. - Introduce public NOTOUCH flag and make OFFPAGE private. - Update man page. The net effect of this should be to make the contract with clients more clear. Clients should choose constraints, UMA will figure out how to implement them. This also breaks the confusing double meaning of OFFPAGE. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23016 Modified: head/share/man/man9/zone.9 head/sys/arm/arm/busdma_machdep-v6.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Thu Jan 9 01:17:01 2020 (r356533) +++ head/share/man/man9/zone.9 Thu Jan 9 02:03:03 2020 (r356534) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2019 +.Dd January 8, 2020 .Dt UMA 9 .Os .Sh NAME @@ -292,18 +292,12 @@ To obtain zeroed memory from a PCPU zone, use the .Fn uma_zalloc_pcpu function and its variants instead, and pass .Dv M_ZERO . -.It Dv UMA_ZONE_OFFPAGE -By default book-keeping of items within a slab is done in the slab page itself. -This flag explicitly tells subsystem that book-keeping structure should be -allocated separately from special internal zone. -This flag requires either -.Dv UMA_ZONE_VTOSLAB -or -.Dv UMA_ZONE_HASH , -since subsystem requires a mechanism to find a book-keeping structure -to an item being freed. -The subsystem may choose to prefer offpage book-keeping for certain zones -implicitly. +.It Dv UMA_ZONE_NOTOUCH +The UMA subsystem may not directly touch (i.e. read or write) the slab memory. +Otherwise, by default, book-keeping of items within a slab may be done in the +slab page itself, and +.Dv INVARIANTS +kernels may also do use-after-free checking by accessing the slab memory. .It Dv UMA_ZONE_ZINIT The zone will have its .Ft uma_init @@ -317,13 +311,11 @@ A zone with .Dv UMA_ZONE_ZINIT flag would not return zeroed memory on every .Fn uma_zalloc . -.It Dv UMA_ZONE_HASH -The zone should use an internal hash table to find slab book-keeping -structure where an allocation being freed belongs to. -.It Dv UMA_ZONE_VTOSLAB -The zone should use special field of -.Vt vm_page_t -to find slab book-keeping structure where an allocation being freed belongs to. +.It Dv UMA_ZONE_NOTPAGE +An allocator function will be supplied with +.Fn uma_zone_set_allocf +and the memory that it returns may not be kernel virtual memory backed by VM +pages in the page array. .It Dv UMA_ZONE_MALLOC The zone is for the .Xr malloc 9 Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Thu Jan 9 01:17:01 2020 (r356533) +++ head/sys/arm/arm/busdma_machdep-v6.c Thu Jan 9 02:03:03 2020 (r356534) @@ -244,7 +244,7 @@ busdma_init(void *dummy) * atomic ops on uma_slab_t fields and safety of this * operation is not guaranteed for write-back caches */ - uma_flags = UMA_ZONE_OFFPAGE; + uma_flags = UMA_ZONE_NOTOUCH; #endif /* * Create a cache of buffers in uncacheable memory, to implement the Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Thu Jan 9 01:17:01 2020 (r356533) +++ head/sys/vm/uma.h Thu Jan 9 02:03:03 2020 (r356534) @@ -232,14 +232,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * Definitions for uma_zcreate flags * * These flags share space with UMA_ZFLAGs in uma_int.h. Be careful not to - * overlap when adding new features. 0xff000000 is in use by uma_int.h. + * overlap when adding new features. */ -#define UMA_ZONE_PAGEABLE 0x0001 /* Return items not fully backed by - physical memory XXX Not yet */ #define UMA_ZONE_ZINIT 0x0002 /* Initialize with zeros */ -#define UMA_ZONE_STATIC 0x0004 /* Statically sized zone */ -#define UMA_ZONE_OFFPAGE 0x0008 /* Force the slab structure allocation - off of the real memory */ +#define UMA_ZONE_NOTOUCH 0x0008 /* UMA may not access the memory */ #define UMA_ZONE_MALLOC 0x0010 /* For use by malloc(9) only! */ #define UMA_ZONE_NOFREE 0x0020 /* Do not free slabs of this type! */ #define UMA_ZONE_MTXCLASS 0x0040 /* Create a new lock class */ @@ -247,20 +243,17 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * Used for internal vm datastructures * only. */ -#define UMA_ZONE_HASH 0x0100 /* - * Use a hash table instead of caching - * information in the vm_page. - */ +#define UMA_ZONE_NOTPAGE 0x0100 /* allocf memory not vm pages */ #define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ #define UMA_ZONE_NOBUCKET 0x0400 /* Do not use buckets. */ #define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets. */ -#define UMA_ZONE_CACHESPREAD 0x1000 /* +#define UMA_ZONE_MINBUCKET 0x1000 /* Use smallest buckets. */ +#define UMA_ZONE_CACHESPREAD 0x2000 /* * Spread memory start locations across * all possible cache lines. May * require many virtually contiguous * backend pages and can fail early. */ -#define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ #define UMA_ZONE_NODUMP 0x4000 /* * Zone's pages will not be included in * mini-dumps. @@ -268,9 +261,9 @@ uma_zone_t uma_zcache_create(char *name, int size, uma #define UMA_ZONE_PCPU 0x8000 /* * Allocates mp_maxid + 1 slabs of PAGE_SIZE */ -#define UMA_ZONE_MINBUCKET 0x10000 /* Use smallest buckets. */ -#define UMA_ZONE_FIRSTTOUCH 0x20000 /* First touch NUMA policy */ -#define UMA_ZONE_ROUNDROBIN 0x40000 /* Round-robin NUMA policy. */ +#define UMA_ZONE_FIRSTTOUCH 0x10000 /* First touch NUMA policy */ +#define UMA_ZONE_ROUNDROBIN 0x20000 /* Round-robin NUMA policy. */ +/* In use by UMA_ZFLAGs: 0xffe00000 */ /* * These flags are shared between the keg and zone. In zones wishing to add @@ -278,9 +271,9 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * physical parameters of the request and may not be provided by the consumer. */ #define UMA_ZONE_INHERIT \ - (UMA_ZONE_OFFPAGE | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ - UMA_ZONE_HASH | UMA_ZONE_VTOSLAB | UMA_ZONE_PCPU | \ - UMA_ZONE_FIRSTTOUCH | UMA_ZONE_ROUNDROBIN) + (UMA_ZONE_NOTOUCH | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ + UMA_ZONE_NOTPAGE | UMA_ZONE_PCPU | UMA_ZONE_FIRSTTOUCH | \ + UMA_ZONE_ROUNDROBIN) /* Definitions for align */ #define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 9 01:17:01 2020 (r356533) +++ head/sys/vm/uma_core.c Thu Jan 9 02:03:03 2020 (r356534) @@ -744,7 +744,7 @@ zone_timeout(uma_zone_t zone, void *unused) uma_keg_t keg; u_int slabs, pages; - if ((zone->uz_flags & UMA_ZONE_HASH) == 0) + if ((zone->uz_flags & UMA_ZFLAG_HASH) == 0) goto update_wss; keg = zone->uz_keg; @@ -1163,7 +1163,7 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star #endif keg->uk_fini(slab_item(slab, keg, i), keg->uk_size); } - if (keg->uk_flags & UMA_ZONE_OFFPAGE) + if (keg->uk_flags & UMA_ZFLAG_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); keg->uk_freef(mem, PAGE_SIZE * keg->uk_ppera, flags); uma_total_dec(PAGE_SIZE * keg->uk_ppera); @@ -1200,7 +1200,7 @@ keg_drain(uma_keg_t keg) /* We have nowhere to free these to. */ if (slab->us_flags & UMA_SLAB_BOOT) continue; - if (keg->uk_flags & UMA_ZONE_HASH) + if (keg->uk_flags & UMA_ZFLAG_HASH) UMA_HASH_REMOVE(&keg->uk_hash, slab); n++; LIST_REMOVE(slab, us_link); @@ -1296,7 +1296,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom allocf = keg->uk_allocf; slab = NULL; mem = NULL; - if (keg->uk_flags & UMA_ZONE_OFFPAGE) { + if (keg->uk_flags & UMA_ZFLAG_OFFPAGE) { slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, aflags); if (slab == NULL) goto fail; @@ -1321,23 +1321,23 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom size = keg->uk_ppera * PAGE_SIZE; mem = allocf(zone, size, domain, &sflags, aflags); if (mem == NULL) { - if (keg->uk_flags & UMA_ZONE_OFFPAGE) + if (keg->uk_flags & UMA_ZFLAG_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); goto fail; } uma_total_inc(size); /* For HASH zones all pages go to the same uma_domain. */ - if ((keg->uk_flags & UMA_ZONE_HASH) != 0) + if ((keg->uk_flags & UMA_ZFLAG_HASH) != 0) domain = 0; /* Point the slab into the allocated memory */ - if (!(keg->uk_flags & UMA_ZONE_OFFPAGE)) + if (!(keg->uk_flags & UMA_ZFLAG_OFFPAGE)) slab = (uma_slab_t )(mem + keg->uk_pgoff); else ((uma_hash_slab_t)slab)->uhs_data = mem; - if (keg->uk_flags & UMA_ZONE_VTOSLAB) + if (keg->uk_flags & UMA_ZFLAG_VTOSLAB) for (i = 0; i < keg->uk_ppera; i++) vsetzoneslab((vm_offset_t)mem + (i * PAGE_SIZE), zone, slab); @@ -1366,7 +1366,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)", slab, keg->uk_name, keg); - if (keg->uk_flags & UMA_ZONE_HASH) + if (keg->uk_flags & UMA_ZFLAG_HASH) UMA_HASH_INSERT(&keg->uk_hash, slab, mem); /* @@ -1737,9 +1737,10 @@ keg_small_init(uma_keg_t keg) * squeeze one more item in for very particular sizes if we were * to loop and reduce the bitsize if there is waste. */ - if (keg->uk_flags & UMA_ZONE_OFFPAGE) + if (keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) { + keg->uk_flags |= UMA_ZFLAG_OFFPAGE; shsize = 0; - else + } else shsize = slab_sizeof(slabsize / rsize); if (rsize <= slabsize - shsize) @@ -1765,8 +1766,12 @@ keg_small_init(uma_keg_t keg) * of UMA_ZONE_VM, which clearly forbids it. */ if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) || - (keg->uk_flags & UMA_ZFLAG_CACHEONLY)) + (keg->uk_flags & UMA_ZFLAG_CACHEONLY)) { + KASSERT((keg->uk_flags & UMA_ZFLAG_OFFPAGE) == 0, + ("%s: incompatible flags 0x%b", __func__, keg->uk_flags, + PRINT_UMA_ZFLAGS)); return; + } /* * See if using an OFFPAGE slab will limit our waste. Only do @@ -1794,13 +1799,15 @@ keg_small_init(uma_keg_t keg) * hash to find slabs. If the zone was explicitly created * OFFPAGE we can't necessarily touch the memory. */ - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) - keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; + keg->uk_flags |= UMA_ZFLAG_OFFPAGE; } - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) && - (keg->uk_flags & UMA_ZONE_VTOSLAB) == 0) - keg->uk_flags |= UMA_ZONE_HASH; + if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0) { + if ((keg->uk_flags & UMA_ZONE_NOTPAGE) != 0) + keg->uk_flags |= UMA_ZFLAG_HASH; + else + keg->uk_flags |= UMA_ZFLAG_VTOSLAB; + } } /* @@ -1827,7 +1834,7 @@ keg_large_init(uma_keg_t keg) keg->uk_rsize = keg->uk_size; /* Check whether we have enough space to not do OFFPAGE. */ - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0 && + if ((keg->uk_flags & UMA_ZONE_NOTOUCH) == 0 && PAGE_SIZE * keg->uk_ppera - keg->uk_rsize < slab_sizeof(SLAB_MIN_SETSIZE)) { /* @@ -1836,14 +1843,17 @@ keg_large_init(uma_keg_t keg) * slab header. */ if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0) - keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; + keg->uk_flags |= UMA_ZFLAG_OFFPAGE; else keg->uk_ppera++; } - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) && - (keg->uk_flags & UMA_ZONE_VTOSLAB) == 0) - keg->uk_flags |= UMA_ZONE_HASH; + if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0) { + if ((keg->uk_flags & UMA_ZONE_NOTPAGE) != 0) + keg->uk_flags |= UMA_ZFLAG_HASH; + else + keg->uk_flags |= UMA_ZFLAG_VTOSLAB; + } } static void @@ -1875,7 +1885,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_rsize = rsize; keg->uk_ppera = pages; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; - keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; + keg->uk_flags |= UMA_ZFLAG_OFFPAGE | UMA_ZFLAG_VTOSLAB; KASSERT(keg->uk_ipers <= SLAB_MAX_SETSIZE, ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); @@ -1926,13 +1936,10 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_init = zero_init; if (arg->flags & UMA_ZONE_MALLOC) - keg->uk_flags |= UMA_ZONE_VTOSLAB; + keg->uk_flags |= UMA_ZFLAG_VTOSLAB; - if (arg->flags & UMA_ZONE_PCPU) -#ifdef SMP - keg->uk_flags |= UMA_ZONE_OFFPAGE; -#else - keg->uk_flags &= ~UMA_ZONE_PCPU; +#ifndef SMP + keg->uk_flags &= ~UMA_ZONE_PCPU; #endif if (keg->uk_flags & UMA_ZONE_CACHESPREAD) { @@ -1953,13 +1960,13 @@ keg_ctor(void *mem, int size, void *udata, int flags) */ #ifdef NUMA if ((keg->uk_flags & - (UMA_ZONE_HASH | UMA_ZONE_VM | UMA_ZONE_ROUNDROBIN)) == 0) + (UMA_ZFLAG_HASH | UMA_ZONE_VM | UMA_ZONE_ROUNDROBIN)) == 0) keg->uk_flags |= UMA_ZONE_FIRSTTOUCH; else if ((keg->uk_flags & UMA_ZONE_FIRSTTOUCH) == 0) keg->uk_flags |= UMA_ZONE_ROUNDROBIN; #endif - if (keg->uk_flags & UMA_ZONE_OFFPAGE) + if (keg->uk_flags & UMA_ZFLAG_OFFPAGE) keg->uk_slabzone = slabzone; /* @@ -1997,7 +2004,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) * figure out where in each page it goes. See slab_sizeof * definition. */ - if (!(keg->uk_flags & UMA_ZONE_OFFPAGE)) { + if (!(keg->uk_flags & UMA_ZFLAG_OFFPAGE)) { size_t shsize; shsize = slab_sizeof(keg->uk_ipers); @@ -2014,7 +2021,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) zone->uz_name, keg->uk_ipers, keg->uk_rsize, keg->uk_size)); } - if (keg->uk_flags & UMA_ZONE_HASH) + if (keg->uk_flags & UMA_ZFLAG_HASH) hash_alloc(&keg->uk_hash, 0); CTR3(KTR_UMA, "keg_ctor %p zone %s(%p)\n", keg, zone->uz_name, zone); @@ -2088,7 +2095,7 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) /* * keg if present. */ - if ((zone->uz_flags & UMA_ZONE_HASH) == 0) + if ((zone->uz_flags & UMA_ZFLAG_HASH) == 0) domains = vm_ndomains; else domains = 1; @@ -2733,11 +2740,9 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct * or fini procedures, no dependency on the initial value of the * memory, and no (legitimate) use of the memory after free. Note, * the ctor and dtor do not need to be empty. - * - * XXX UMA_ZONE_OFFPAGE. */ - if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOFREE))) && - uminit == NULL && fini == NULL) { + if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOTOUCH | + UMA_ZONE_NOFREE))) && uminit == NULL && fini == NULL) { args.uminit = trash_init; args.fini = trash_fini; } @@ -3220,7 +3225,7 @@ keg_fetch_free_slab(uma_keg_t keg, int domain, bool rr uint32_t reserve; /* HASH has a single free list. */ - if ((keg->uk_flags & UMA_ZONE_HASH) != 0) + if ((keg->uk_flags & UMA_ZFLAG_HASH) != 0) domain = 0; KEG_LOCK(keg, domain); @@ -4022,15 +4027,15 @@ zone_release(void *arg, void **bucket, int cnt) zone = arg; keg = zone->uz_keg; lock = NULL; - if (__predict_false((zone->uz_flags & UMA_ZONE_HASH) != 0)) + if (__predict_false((zone->uz_flags & UMA_ZFLAG_HASH) != 0)) lock = KEG_LOCK(keg, 0); for (i = 0; i < cnt; i++) { item = bucket[i]; - if (__predict_true((zone->uz_flags & UMA_ZONE_VTOSLAB) != 0)) { + if (__predict_true((zone->uz_flags & UMA_ZFLAG_VTOSLAB) != 0)) { slab = vtoslab((vm_offset_t)item); } else { mem = (uint8_t *)((uintptr_t)item & (~UMA_SLAB_MASK)); - if ((zone->uz_flags & UMA_ZONE_HASH) != 0) + if ((zone->uz_flags & UMA_ZFLAG_HASH) != 0) slab = hash_sfind(&keg->uk_hash, mem); else slab = (uma_slab_t)(mem + keg->uk_pgoff); @@ -4771,7 +4776,7 @@ sysctl_handle_uma_slab_efficiency(SYSCTL_HANDLER_ARGS) int avail, effpct, total; total = keg->uk_ppera * PAGE_SIZE; - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) != 0) + if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0) total += slab_sizeof(SLAB_MAX_SETSIZE); /* * We consider the client's requested size and alignment here, not the @@ -4811,10 +4816,10 @@ uma_dbg_getslab(uma_zone_t zone, void *item) mem = (uint8_t *)((uintptr_t)item & (~UMA_SLAB_MASK)); if ((zone->uz_flags & UMA_ZFLAG_CACHE) != 0) return (NULL); - if (zone->uz_flags & UMA_ZONE_VTOSLAB) + if (zone->uz_flags & UMA_ZFLAG_VTOSLAB) return (vtoslab((vm_offset_t)mem)); keg = zone->uz_keg; - if ((keg->uk_flags & UMA_ZONE_HASH) == 0) + if ((keg->uk_flags & UMA_ZFLAG_HASH) == 0) return ((uma_slab_t)(mem + keg->uk_pgoff)); KEG_LOCK(keg, 0); slab = hash_sfind(&keg->uk_hash, mem); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Thu Jan 9 01:17:01 2020 (r356533) +++ head/sys/vm/uma_int.h Thu Jan 9 02:03:03 2020 (r356534) @@ -139,7 +139,65 @@ /* Max waste percentage before going to off page slab management */ #define UMA_MAX_WASTE 10 +/* + * These flags must not overlap with the UMA_ZONE flags specified in uma.h. + */ +#define UMA_ZFLAG_OFFPAGE 0x00200000 /* + * Force the slab structure + * allocation off of the real + * memory. + */ +#define UMA_ZFLAG_HASH 0x00400000 /* + * Use a hash table instead of + * caching information in the + * vm_page. + */ +#define UMA_ZFLAG_VTOSLAB 0x00800000 /* + * Zone uses vtoslab for + * lookup. + */ +#define UMA_ZFLAG_CTORDTOR 0x01000000 /* Zone has ctor/dtor set. */ +#define UMA_ZFLAG_LIMIT 0x02000000 /* Zone has limit set. */ +#define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ +#define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ +#define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ +#define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ +#define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ +#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ +#define UMA_ZFLAG_INHERIT \ + (UMA_ZFLAG_OFFPAGE | UMA_ZFLAG_HASH | UMA_ZFLAG_VTOSLAB | \ + UMA_ZFLAG_BUCKET | UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY) + +#define PRINT_UMA_ZFLAGS "\20" \ + "\40CACHEONLY" \ + "\37TRASH" \ + "\36INTERNAL" \ + "\35BUCKET" \ + "\34RECLAIMING" \ + "\33CACHE" \ + "\32LIMIT" \ + "\31CTORDTOR" \ + "\30VTOSLAB" \ + "\27HASH" \ + "\26OFFPAGE" \ + "\22ROUNDROBIN" \ + "\21FIRSTTOUCH" \ + "\20PCPU" \ + "\17NODUMP" \ + "\16CACHESPREAD" \ + "\15MINBUCKET" \ + "\14MAXBUCKET" \ + "\13NOBUCKET" \ + "\12SECONDARY" \ + "\11NOTPAGE" \ + "\10VM" \ + "\7MTXCLASS" \ + "\6NOFREE" \ + "\5MALLOC" \ + "\4NOTOUCH" \ + "\2ZINIT" + /* * Hash table for freed address -> slab translation. * @@ -373,7 +431,7 @@ static inline void * slab_data(uma_slab_t slab, uma_keg_t keg) { - if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) + if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) == 0) return ((void *)((uintptr_t)slab - keg->uk_pgoff)); else return (((uma_hash_slab_t)slab)->uhs_data); @@ -475,50 +533,6 @@ struct uma_zone { /* uz_domain follows here. */ }; - -/* - * These flags must not overlap with the UMA_ZONE flags specified in uma.h. - */ -#define UMA_ZFLAG_CTORDTOR 0x01000000 /* Zone has ctor/dtor set. */ -#define UMA_ZFLAG_LIMIT 0x02000000 /* Zone has limit set. */ -#define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ -#define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ -#define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ -#define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ -#define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ -#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ - -#define UMA_ZFLAG_INHERIT \ - (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | UMA_ZFLAG_BUCKET) - -#define PRINT_UMA_ZFLAGS "\20" \ - "\40CACHEONLY" \ - "\37TRASH" \ - "\36INTERNAL" \ - "\35BUCKET" \ - "\34RECLAIMING" \ - "\33CACHE" \ - "\32LIMIT" \ - "\31CTORDTOR" \ - "\23ROUNDROBIN" \ - "\22FIRSTTOUCH" \ - "\21MINBUCKET" \ - "\20PCPU" \ - "\17NODUMP" \ - "\16VTOSLAB" \ - "\15CACHESPREAD" \ - "\14MAXBUCKET" \ - "\13NOBUCKET" \ - "\12SECONDARY" \ - "\11HASH" \ - "\10VM" \ - "\7MTXCLASS" \ - "\6NOFREE" \ - "\5MALLOC" \ - "\4OFFPAGE" \ - "\3STATIC" \ - "\2ZINIT" \ - "\1PAGEABLE" /* * Macros for interpreting the uz_items field. 20 bits of sleeper count From owner-svn-src-head@freebsd.org Thu Jan 9 02:03:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43D972239F1; Thu, 9 Jan 2020 02:03:18 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tTsy1l2qz4S7H; Thu, 9 Jan 2020 02:03:18 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36CFC2184B; Thu, 9 Jan 2020 02:03:18 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00923I8G086753; Thu, 9 Jan 2020 02:03:18 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00923HTn086752; Thu, 9 Jan 2020 02:03:17 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202001090203.00923HTn086752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 9 Jan 2020 02:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356535 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 02:03:18 -0000 Author: rlibby Date: Thu Jan 9 02:03:17 2020 New Revision: 356535 URL: https://svnweb.freebsd.org/changeset/base/356535 Log: uma: unify layout paths and improve efficiency Unify the keg layout selection paths (keg_small_init, keg_large_init, keg_cachespread_init), and slightly improve memory efficiecy by: - using the padding of the final item to store the slab header, - not going OFFPAGE if we have a choice unless it improves efficiency. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23048 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 9 02:03:03 2020 (r356534) +++ head/sys/vm/uma_core.c Thu Jan 9 02:03:17 2020 (r356535) @@ -258,8 +258,6 @@ static void keg_dtor(void *, int, void *); static int zone_ctor(void *, int, void *, int); static void zone_dtor(void *, int, void *); static int zero_init(void *, int, int); -static void keg_small_init(uma_keg_t keg); -static void keg_large_init(uma_keg_t keg); static void zone_foreach(void (*zfunc)(uma_zone_t, void *), void *); static void zone_timeout(uma_zone_t zone, void *); static int hash_alloc(struct uma_hash *, u_int); @@ -1669,27 +1667,61 @@ slab_space(int nitems) return (UMA_SLAB_SIZE - slab_sizeof(nitems)); } +#define UMA_FIXPT_SHIFT 31 +#define UMA_FRAC_FIXPT(n, d) \ + ((uint32_t)(((uint64_t)(n) << UMA_FIXPT_SHIFT) / (d))) +#define UMA_FIXPT_PCT(f) \ + ((u_int)(((uint64_t)100 * (f)) >> UMA_FIXPT_SHIFT)) +#define UMA_PCT_FIXPT(pct) UMA_FRAC_FIXPT((pct), 100) +#define UMA_MIN_EFF UMA_PCT_FIXPT(100 - UMA_MAX_WASTE) + /* - * Compute the number of items that will fit in an embedded (!OFFPAGE) slab - * with a given size and alignment. + * Compute the number of items that will fit in a slab. If hdr is true, the + * item count may be limited to provide space in the slab for an inline slab + * header. Otherwise, all slab space will be provided for item storage. */ +static u_int +slab_ipers_hdr(u_int size, u_int rsize, u_int slabsize, bool hdr) +{ + u_int ipers; + u_int padpi; + + /* The padding between items is not needed after the last item. */ + padpi = rsize - size; + + if (hdr) { + /* + * Start with the maximum item count and remove items until + * the slab header first alongside the allocatable memory. + */ + for (ipers = MIN(SLAB_MAX_SETSIZE, + (slabsize + padpi - slab_sizeof(1)) / rsize); + ipers > 0 && + ipers * rsize - padpi + slab_sizeof(ipers) > slabsize; + ipers--) + continue; + } else { + ipers = MIN((slabsize + padpi) / rsize, SLAB_MAX_SETSIZE); + } + + return (ipers); +} + +/* + * Compute the number of items that will fit in a slab for a startup zone. + */ int slab_ipers(size_t size, int align) { int rsize; - int nitems; - /* - * Compute the ideal number of items that will fit in a page and - * then compute the actual number based on a bitset nitems wide. - */ - rsize = roundup(size, align + 1); - nitems = UMA_SLAB_SIZE / rsize; - return (slab_space(nitems) / rsize); + rsize = roundup(size, align + 1); /* Assume no CACHESPREAD */ + return (slab_ipers_hdr(size, rsize, UMA_SLAB_SIZE, true)); } /* - * Finish creating a small uma keg. This calculates ipers, and the keg size. + * Determine the format of a uma keg. This determines where the slab header + * will be placed (inline or offpage) and calculates ipers, rsize, and ppera. * * Arguments * keg The zone we should initialize @@ -1698,66 +1730,77 @@ slab_ipers(size_t size, int align) * Nothing */ static void -keg_small_init(uma_keg_t keg) +keg_layout(uma_keg_t keg) { + u_int alignsize; + u_int eff; + u_int eff_offpage; + u_int format; + u_int ipers; + u_int ipers_offpage; + u_int pages; u_int rsize; - u_int memused; - u_int wastedspace; - u_int shsize; u_int slabsize; - if (keg->uk_flags & UMA_ZONE_PCPU) { - u_int ncpus = (mp_maxid + 1) ? (mp_maxid + 1) : MAXCPU; + KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0 || + (keg->uk_size <= UMA_PCPU_ALLOC_SIZE && + (keg->uk_flags & UMA_ZONE_CACHESPREAD) == 0), + ("%s: cannot configure for PCPU: keg=%s, size=%u, flags=0x%b", + __func__, keg->uk_name, keg->uk_size, keg->uk_flags, + PRINT_UMA_ZFLAGS)); + KASSERT((keg->uk_flags & + (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) == 0 || + (keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) == 0, + ("%s: incompatible flags 0x%b", __func__, keg->uk_flags, + PRINT_UMA_ZFLAGS)); - slabsize = UMA_PCPU_ALLOC_SIZE; - keg->uk_ppera = ncpus; - } else { - slabsize = UMA_SLAB_SIZE; - keg->uk_ppera = 1; - } + alignsize = keg->uk_align + 1; + format = 0; + ipers = 0; /* * Calculate the size of each allocation (rsize) according to * alignment. If the requested size is smaller than we have * allocation bits for we round it up. */ - rsize = keg->uk_size; - if (rsize < slabsize / SLAB_MAX_SETSIZE) - rsize = slabsize / SLAB_MAX_SETSIZE; - if (rsize & keg->uk_align) - rsize = roundup(rsize, keg->uk_align + 1); - keg->uk_rsize = rsize; + rsize = MAX(keg->uk_size, UMA_SLAB_SIZE / SLAB_MAX_SETSIZE); + rsize = roundup2(rsize, alignsize); - KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0 || - keg->uk_rsize < UMA_PCPU_ALLOC_SIZE, - ("%s: size %u too large", __func__, keg->uk_rsize)); - - /* - * Use a pessimistic bit count for shsize. It may be possible to - * squeeze one more item in for very particular sizes if we were - * to loop and reduce the bitsize if there is waste. - */ - if (keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) { - keg->uk_flags |= UMA_ZFLAG_OFFPAGE; - shsize = 0; - } else - shsize = slab_sizeof(slabsize / rsize); - - if (rsize <= slabsize - shsize) - keg->uk_ipers = (slabsize - shsize) / rsize; - else { - /* Handle special case when we have 1 item per slab, so - * alignment requirement can be relaxed. */ - KASSERT(keg->uk_size <= slabsize - shsize, - ("%s: size %u greater than slab", __func__, keg->uk_size)); - keg->uk_ipers = 1; + if ((keg->uk_flags & UMA_ZONE_PCPU) != 0) { + slabsize = UMA_PCPU_ALLOC_SIZE; + pages = mp_maxid + 1; + } else if ((keg->uk_flags & UMA_ZONE_CACHESPREAD) != 0) { + /* + * We want one item to start on every align boundary in a page. + * To do this we will span pages. We will also extend the item + * by the size of align if it is an even multiple of align. + * Otherwise, it would fall on the same boundary every time. + */ + if ((rsize & alignsize) == 0) + rsize += alignsize; + slabsize = rsize * (PAGE_SIZE / alignsize); + slabsize = MIN(slabsize, rsize * SLAB_MAX_SETSIZE); + slabsize = MIN(slabsize, UMA_CACHESPREAD_MAX_SIZE); + pages = howmany(slabsize, PAGE_SIZE); + slabsize = ptoa(pages); + } else { + /* + * Choose a slab size of as many pages as it takes to represent + * a single item. We will then try to fit as many additional + * items into the slab as possible. At some point, we may want + * to increase the slab size for awkward item sizes in order to + * increase efficiency. + */ + pages = howmany(keg->uk_size, PAGE_SIZE); + slabsize = ptoa(pages); } - KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_MAX_SETSIZE, - ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); - memused = keg->uk_ipers * rsize + shsize; - wastedspace = slabsize - memused; + /* Evaluate an inline slab layout. */ + if ((keg->uk_flags & (UMA_ZONE_NOTOUCH | UMA_ZONE_PCPU)) == 0) + ipers = slab_ipers_hdr(keg->uk_size, rsize, slabsize, true); + /* TODO: vm_page-embedded slab. */ + /* * We can't do OFFPAGE if we're internal or if we've been * asked to not go to the VM for buckets. If we do this we @@ -1765,130 +1808,63 @@ keg_small_init(uma_keg_t keg) * want to do if we're UMA_ZFLAG_CACHEONLY as a result * of UMA_ZONE_VM, which clearly forbids it. */ - if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) || - (keg->uk_flags & UMA_ZFLAG_CACHEONLY)) { - KASSERT((keg->uk_flags & UMA_ZFLAG_OFFPAGE) == 0, - ("%s: incompatible flags 0x%b", __func__, keg->uk_flags, - PRINT_UMA_ZFLAGS)); - return; + if ((keg->uk_flags & + (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY)) != 0) { + if (ipers == 0) { + /* We need an extra page for the slab header. */ + pages++; + slabsize = ptoa(pages); + ipers = slab_ipers_hdr(keg->uk_size, rsize, slabsize, + true); + } + goto out; } /* - * See if using an OFFPAGE slab will limit our waste. Only do - * this if it permits more items per-slab. + * See if using an OFFPAGE slab will improve our efficiency. + * Only do this if we are below our efficiency threshold. * * XXX We could try growing slabsize to limit max waste as well. * Historically this was not done because the VM could not * efficiently handle contiguous allocations. */ - if ((wastedspace >= slabsize / UMA_MAX_WASTE) && - (keg->uk_ipers < (slabsize / keg->uk_rsize))) { - keg->uk_ipers = slabsize / keg->uk_rsize; - KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_MAX_SETSIZE, - ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); - CTR6(KTR_UMA, "UMA decided we need offpage slab headers for " - "keg: %s(%p), calculated wastedspace = %d, " - "maximum wasted space allowed = %d, " - "calculated ipers = %d, " - "new wasted space = %d\n", keg->uk_name, keg, wastedspace, - slabsize / UMA_MAX_WASTE, keg->uk_ipers, - slabsize - keg->uk_ipers * keg->uk_rsize); - /* - * If we had access to memory to embed a slab header we - * also have a page structure to use vtoslab() instead of - * hash to find slabs. If the zone was explicitly created - * OFFPAGE we can't necessarily touch the memory. - */ - keg->uk_flags |= UMA_ZFLAG_OFFPAGE; + eff = UMA_FRAC_FIXPT(ipers * rsize, slabsize); + ipers_offpage = slab_ipers_hdr(keg->uk_size, rsize, slabsize, false); + eff_offpage = UMA_FRAC_FIXPT(ipers_offpage * rsize, + slabsize + slab_sizeof(SLAB_MAX_SETSIZE)); + if (ipers == 0 || (eff < UMA_MIN_EFF && eff < eff_offpage)) { + CTR5(KTR_UMA, "UMA decided we need offpage slab headers for " + "keg: %s(%p), minimum efficiency allowed = %u%%, " + "old efficiency = %u%%, offpage efficiency = %u%%\n", + keg->uk_name, keg, UMA_FIXPT_PCT(UMA_MIN_EFF), + UMA_FIXPT_PCT(eff), UMA_FIXPT_PCT(eff_offpage)); + format = UMA_ZFLAG_OFFPAGE; + ipers = ipers_offpage; } - if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0) { +out: + /* + * How do we find the slab header if it is offpage or if not all item + * start addresses are in the same page? We could solve the latter + * case with vaddr alignment, but we don't. + */ + if ((format & UMA_ZFLAG_OFFPAGE) != 0 || + (ipers - 1) * rsize >= PAGE_SIZE) { if ((keg->uk_flags & UMA_ZONE_NOTPAGE) != 0) - keg->uk_flags |= UMA_ZFLAG_HASH; + format |= UMA_ZFLAG_HASH; else - keg->uk_flags |= UMA_ZFLAG_VTOSLAB; + format |= UMA_ZFLAG_VTOSLAB; } -} - -/* - * Finish creating a large (> UMA_SLAB_SIZE) uma kegs. Just give in and do - * OFFPAGE for now. When I can allow for more dynamic slab sizes this will be - * more complicated. - * - * Arguments - * keg The keg we should initialize - * - * Returns - * Nothing - */ -static void -keg_large_init(uma_keg_t keg) -{ - - KASSERT(keg != NULL, ("Keg is null in keg_large_init")); - KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0, - ("%s: Cannot large-init a UMA_ZONE_PCPU keg", __func__)); - - keg->uk_ppera = howmany(keg->uk_size, PAGE_SIZE); - keg->uk_ipers = 1; - keg->uk_rsize = keg->uk_size; - - /* Check whether we have enough space to not do OFFPAGE. */ - if ((keg->uk_flags & UMA_ZONE_NOTOUCH) == 0 && - PAGE_SIZE * keg->uk_ppera - keg->uk_rsize < - slab_sizeof(SLAB_MIN_SETSIZE)) { - /* - * We can't do OFFPAGE if we're internal, in which case - * we need an extra page per allocation to contain the - * slab header. - */ - if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0) - keg->uk_flags |= UMA_ZFLAG_OFFPAGE; - else - keg->uk_ppera++; - } - - if ((keg->uk_flags & UMA_ZFLAG_OFFPAGE) != 0) { - if ((keg->uk_flags & UMA_ZONE_NOTPAGE) != 0) - keg->uk_flags |= UMA_ZFLAG_HASH; - else - keg->uk_flags |= UMA_ZFLAG_VTOSLAB; - } -} - -static void -keg_cachespread_init(uma_keg_t keg) -{ - int alignsize; - int trailer; - int pages; - int rsize; - - KASSERT((keg->uk_flags & UMA_ZONE_PCPU) == 0, - ("%s: Cannot cachespread-init a UMA_ZONE_PCPU keg", __func__)); - - alignsize = keg->uk_align + 1; - rsize = keg->uk_size; - /* - * We want one item to start on every align boundary in a page. To - * do this we will span pages. We will also extend the item by the - * size of align if it is an even multiple of align. Otherwise, it - * would fall on the same boundary every time. - */ - if (rsize & keg->uk_align) - rsize = (rsize & ~keg->uk_align) + alignsize; - if ((rsize & alignsize) == 0) - rsize += alignsize; - trailer = rsize - keg->uk_size; - pages = (rsize * (PAGE_SIZE / alignsize)) / PAGE_SIZE; - pages = MIN(pages, (128 * 1024) / PAGE_SIZE); + keg->uk_ipers = ipers; keg->uk_rsize = rsize; + keg->uk_flags |= format; keg->uk_ppera = pages; - keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; - keg->uk_flags |= UMA_ZFLAG_OFFPAGE | UMA_ZFLAG_VTOSLAB; - KASSERT(keg->uk_ipers <= SLAB_MAX_SETSIZE, - ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, - keg->uk_ipers)); + CTR6(KTR_UMA, "%s: keg=%s, flags=%#x, rsize=%u, ipers=%u, ppera=%u\n", + __func__, keg->uk_name, keg->uk_flags, rsize, ipers, pages); + KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_MAX_SETSIZE, + ("%s: keg=%s, flags=0x%b, rsize=%u, ipers=%u, ppera=%u", __func__, + keg->uk_name, keg->uk_flags, PRINT_UMA_ZFLAGS, rsize, ipers, + pages)); } /* @@ -1942,14 +1918,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_flags &= ~UMA_ZONE_PCPU; #endif - if (keg->uk_flags & UMA_ZONE_CACHESPREAD) { - keg_cachespread_init(keg); - } else { - if (keg->uk_size > slab_space(SLAB_MIN_SETSIZE)) - keg_large_init(keg); - else - keg_small_init(keg); - } + keg_layout(keg); /* * Use a first-touch NUMA policy for all kegs that pmap_extract() Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Thu Jan 9 02:03:03 2020 (r356534) +++ head/sys/vm/uma_int.h Thu Jan 9 02:03:17 2020 (r356535) @@ -139,6 +139,9 @@ /* Max waste percentage before going to off page slab management */ #define UMA_MAX_WASTE 10 +/* Max size of a CACHESPREAD slab. */ +#define UMA_CACHESPREAD_MAX_SIZE (128 * 1024) + /* * These flags must not overlap with the UMA_ZONE flags specified in uma.h. */ From owner-svn-src-head@freebsd.org Thu Jan 9 03:52:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6654F226360; Thu, 9 Jan 2020 03:52:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tXJM27MJz4Y5r; Thu, 9 Jan 2020 03:52:51 +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 445B122CED; Thu, 9 Jan 2020 03:52:51 +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 0093qpSY052790; Thu, 9 Jan 2020 03:52:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0093qpd4052789; Thu, 9 Jan 2020 03:52:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001090352.0093qpd4052789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 03:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356536 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 356536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 03:52:51 -0000 Author: kevans Date: Thu Jan 9 03:52:50 2020 New Revision: 356536 URL: https://svnweb.freebsd.org/changeset/base/356536 Log: if_vmove: return proper error status if_vmove can fail if it lost a race and the vnet's already been moved. The callers (and their callers) can generally cope with this, but right now success is assumed. Plumb out the ENOENT from if_detach_internal if it happens so that the error's properly reported to userland. Reviewed by: bz, kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22780 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jan 9 02:03:17 2020 (r356535) +++ head/sys/net/if.c Thu Jan 9 03:52:50 2020 (r356536) @@ -274,7 +274,7 @@ static void if_attach_internal(struct ifnet *, int, st static int if_detach_internal(struct ifnet *, int, struct if_clone **); static void if_siocaddmulti(void *, int); #ifdef VIMAGE -static void if_vmove(struct ifnet *, struct vnet *); +static int if_vmove(struct ifnet *, struct vnet *); #endif #ifdef INET6 @@ -1257,7 +1257,7 @@ finish_vnet_shutdown: * unused if_index in target vnet and calls if_grow() if necessary, * and finally find an unused if_xname for the target vnet. */ -static void +static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; @@ -1283,7 +1283,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) */ rc = if_detach_internal(ifp, 1, &ifc); if (rc != 0) - return; + return (rc); /* * Unlink the ifnet from ifindex_table[] in current vnet, and shrink @@ -1327,6 +1327,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) #endif CURVNET_RESTORE(); + return (0); } /* @@ -1337,6 +1338,7 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch { struct prison *pr; struct ifnet *difp; + int error; /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); @@ -1372,13 +1374,14 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch CURVNET_RESTORE(); /* Move the interface into the child jail/vnet. */ - if_vmove(ifp, pr->pr_vnet); + error = if_vmove(ifp, pr->pr_vnet); - /* Report the new if_xname back to the userland. */ - sprintf(ifname, "%s", ifp->if_xname); + /* Report the new if_xname back to the userland on success. */ + if (error == 0) + sprintf(ifname, "%s", ifp->if_xname); prison_free(pr); - return (0); + return (error); } static int @@ -1387,6 +1390,7 @@ if_vmove_reclaim(struct thread *td, char *ifname, int struct prison *pr; struct vnet *vnet_dst; struct ifnet *ifp; + int error; /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); @@ -1422,14 +1426,15 @@ if_vmove_reclaim(struct thread *td, char *ifname, int } /* Get interface back from child jail/vnet. */ - if_vmove(ifp, vnet_dst); + error = if_vmove(ifp, vnet_dst); CURVNET_RESTORE(); - /* Report the new if_xname back to the userland. */ - sprintf(ifname, "%s", ifp->if_xname); + /* Report the new if_xname back to the userland on success. */ + if (error == 0) + sprintf(ifname, "%s", ifp->if_xname); prison_free(pr); - return (0); + return (error); } #endif /* VIMAGE */ From owner-svn-src-head@freebsd.org Thu Jan 9 04:03:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E78E6226A9A; Thu, 9 Jan 2020 04:03: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 47tXXP5q80z4YmR; Thu, 9 Jan 2020 04:03:17 +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 C2FD522ECF; Thu, 9 Jan 2020 04:03:17 +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 00943HVJ058729; Thu, 9 Jan 2020 04:03:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00943HFL058728; Thu, 9 Jan 2020 04:03:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001090403.00943HFL058728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 04:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356537 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 04:03:18 -0000 Author: kevans Date: Thu Jan 9 04:03:17 2020 New Revision: 356537 URL: https://svnweb.freebsd.org/changeset/base/356537 Log: shmfd: posix_fallocate(2): only take rangelock for section we need Other mechanisms that resize the shmfd grab a write lock from 0 to OFF_MAX for safety, so we still get proper synchronization of shmfd->shm_size in effect. There's no need to block readers/writers of earlier segments when we're just reserving more space, so narrow the scope -- it would likely be safe to narrow it completely to just the section of the range that extends beyond our current size, but this likely isn't worth it since the size isn't stable until the writelock is granted the first time. Suggested by: cem (passing comment) Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Jan 9 03:52:50 2020 (r356536) +++ head/sys/kern/uipc_shm.c Thu Jan 9 04:03:17 2020 (r356537) @@ -1451,7 +1451,17 @@ shm_fallocate(struct file *fp, off_t offset, off_t len error = 0; shmfd = fp->f_data; size = offset + len; - rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + + /* + * Just grab the rangelock for the range that we may be attempting to + * grow, rather than blocking read/write for regions we won't be + * touching while this (potential) resize is in progress. Other + * attempts to resize the shmfd will have to take a write lock from 0 to + * OFF_MAX, so this being potentially beyond the current usable range of + * the shmfd is not necessarily a concern. If other mechanisms are + * added to grow a shmfd, this may need to be re-evaluated. + */ + rl_cookie = rangelock_wlock(&shmfd->shm_rl, offset, size, &shmfd->shm_mtx); if (size > shmfd->shm_size) { VM_OBJECT_WLOCK(shmfd->shm_object); From owner-svn-src-head@freebsd.org Thu Jan 9 04:34:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C01182288A1; Thu, 9 Jan 2020 04:34: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 47tYDg4VSpz4bTY; Thu, 9 Jan 2020 04:34: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 959462348A; Thu, 9 Jan 2020 04:34: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 0094YhCC076660; Thu, 9 Jan 2020 04:34:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0094Yhsa076658; Thu, 9 Jan 2020 04:34:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001090434.0094Yhsa076658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 04:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356538 - in head/stand: fdt uboot/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: fdt uboot/fdt X-SVN-Commit-Revision: 356538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 04:34:43 -0000 Author: kevans Date: Thu Jan 9 04:34:42 2020 New Revision: 356538 URL: https://svnweb.freebsd.org/changeset/base/356538 Log: stand/fdt: Scale blob size better as overlays apply Currently, our overlay blob will grow to include the size of the complete overlay blob we're applying. This doesn't scale very well with a lot of overlays- they tend to include a lot of overhead, and they will generally only add a fraction of their total size to the blob they're being applied to. To combat this, pack the blob as we apply new overlays and keep track of how many overlays we've applied. Only ubldr has any fixups to be applied after overlays, so we only need to re-pad the blob in ubldr. Presumably the allocation won't fail since we just did a lot worse in trying to apply overlays and succeeded. I have no intention of removing the padding in make_dtb.sh. There might be an argument to be had over whether it should be configurable, since ubldr *is* the only loader that actually has fixups to be applied and we can do this at runtime, but I'm not too concerned about this. This diff has been sitting in Phabricator for a year and a half, but I've decided to flush it as it does make sure that we're scaling the blob appropriately and leave room at the end for fixups in case of some freak circumstance where applying overlays leaves us with a blob of insufficient size. Reviewed by: gonzo (a long time ago) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14133 Modified: head/stand/fdt/fdt_loader_cmd.c head/stand/fdt/fdt_platform.h head/stand/uboot/fdt/uboot_fdt.c Modified: head/stand/fdt/fdt_loader_cmd.c ============================================================================== --- head/stand/fdt/fdt_loader_cmd.c Thu Jan 9 04:03:17 2020 (r356537) +++ head/stand/fdt/fdt_loader_cmd.c Thu Jan 9 04:34:42 2020 (r356538) @@ -427,7 +427,10 @@ fdt_check_overlay_compatible(void *base_fdt, void *ove return (1); } -void +/* + * Returns the number of overlays successfully applied + */ +int fdt_apply_overlays() { struct preloaded_file *fp; @@ -436,13 +439,13 @@ fdt_apply_overlays() void *current_fdtp; void *next_fdtp; void *overlay; - int rv; + int overlays_applied, rv; if ((fdtp == NULL) || (fdtp_size == 0)) - return; + return (0); if (fdt_overlays_applied) - return; + return (0); max_overlay_size = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { @@ -452,15 +455,16 @@ fdt_apply_overlays() /* Nothing to apply */ if (max_overlay_size == 0) - return; + return (0); overlay = malloc(max_overlay_size); if (overlay == NULL) { printf("failed to allocate memory for DTB blob with overlays\n"); - return; + return (0); } current_fdtp = fdtp; current_fdtp_size = fdtp_size; + overlays_applied = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { COPYOUT(fp->f_addr, overlay, fp->f_size); /* Check compatible first to avoid unnecessary allocation */ @@ -493,7 +497,9 @@ fdt_apply_overlays() if (current_fdtp != fdtp) free(current_fdtp); current_fdtp = next_fdtp; - current_fdtp_size = next_fdtp_size; + fdt_pack(current_fdtp); + current_fdtp_size = fdt_totalsize(current_fdtp); + overlays_applied++; } else { /* * Assume here that the base we tried to apply on is @@ -513,6 +519,26 @@ fdt_apply_overlays() } free(overlay); fdt_overlays_applied = 1; + return (overlays_applied); +} + +int +fdt_pad_dtb(size_t padding) +{ + void *padded_fdtp; + size_t padded_fdtp_size; + + padded_fdtp_size = fdtp_size + padding; + padded_fdtp = malloc(padded_fdtp_size); + if (padded_fdtp == NULL) + return (1); + if (fdt_open_into(fdtp, padded_fdtp, padded_fdtp_size) != 0) { + free(padded_fdtp); + return (1); + } + fdtp = padded_fdtp; + fdtp_size = padded_fdtp_size; + return (0); } int Modified: head/stand/fdt/fdt_platform.h ============================================================================== --- head/stand/fdt/fdt_platform.h Thu Jan 9 04:03:17 2020 (r356537) +++ head/stand/fdt/fdt_platform.h Thu Jan 9 04:34:42 2020 (r356538) @@ -43,7 +43,8 @@ void fdt_fixup_cpubusfreqs(unsigned long, unsigned lon void fdt_fixup_ethernet(const char *, char *, int); void fdt_fixup_memory(struct fdt_mem_region *, size_t); void fdt_fixup_stdout(const char *); -void fdt_apply_overlays(void); +int fdt_apply_overlays(void); +int fdt_pad_dtb(size_t); int fdt_load_dtb_addr(struct fdt_header *); int fdt_load_dtb_file(const char *); void fdt_load_dtb_overlays(const char *); Modified: head/stand/uboot/fdt/uboot_fdt.c ============================================================================== --- head/stand/uboot/fdt/uboot_fdt.c Thu Jan 9 04:03:17 2020 (r356537) +++ head/stand/uboot/fdt/uboot_fdt.c Thu Jan 9 04:34:42 2020 (r356538) @@ -63,6 +63,8 @@ fdt_platform_load_from_ubenv(const char *var) return (1); } +#define FDT_DTB_PADSZ 1024 + int fdt_platform_load_dtb(void) { @@ -127,7 +129,8 @@ fdt_platform_fixups(void) ethstr = NULL; /* Apply overlays before anything else */ - fdt_apply_overlays(); + if (fdt_apply_overlays() > 0) + fdt_pad_dtb(FDT_DTB_PADSZ); /* Acquire sys_info */ si = ub_get_sys_info(); From owner-svn-src-head@freebsd.org Thu Jan 9 04:39:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C60D228AB1; Thu, 9 Jan 2020 04:39:38 +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 47tYLL3jqKz4bfH; Thu, 9 Jan 2020 04:39:38 +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 766372348F; Thu, 9 Jan 2020 04:39:38 +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 0094dcEs076918; Thu, 9 Jan 2020 04:39:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0094dcIj076917; Thu, 9 Jan 2020 04:39:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001090439.0094dcIj076917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 04:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356539 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 356539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 04:39:38 -0000 Author: kevans Date: Thu Jan 9 04:39:37 2020 New Revision: 356539 URL: https://svnweb.freebsd.org/changeset/base/356539 Log: md(4): improve documentation of preloading It's not immediately clear by what mechanism loader(8) will be loading the preloaded file. Specifically name-drop loader.conf(5) with a pointer to the module loading section and a description of what the 'name' should look like, because that certainly isn't clear from the loader.conf(5) standpoint. The default loader.conf already has a pointer to md(4) where it appears and the reference to loader.conf in the new version of this manpage should make it more clear that this is where one should look for information. Reported by: swills Reviewed by: swills, manpages (bcr) With revision by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D22844 Modified: head/share/man/man4/md.4 Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Thu Jan 9 04:34:42 2020 (r356538) +++ head/share/man/man4/md.4 Thu Jan 9 04:39:37 2020 (r356539) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2017 +.Dd January 8, 2020 .Dt MD 4 .Os .Sh NAME @@ -46,7 +46,7 @@ system. The exact value can be determined with .Xr vmstat 8 . .It Cm preload -A file loaded by +A module loaded by .Xr loader 8 with type .Sq md_image @@ -54,6 +54,12 @@ is used for backing store. For backwards compatibility the type .Sq mfs_root is also recognized. +See the description of module loading directives in +.Xr loader.conf 5 +and note that the module name will either be an absolute path to the image file +or the name of a file in the +.Va module_path . +.Pp If the kernel is created with option .Dv MD_ROOT the first preloaded image found will become the root file system. From owner-svn-src-head@freebsd.org Thu Jan 9 05:45:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8041E22A246; Thu, 9 Jan 2020 05:45:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tZp72rQ0z4f5r; Thu, 9 Jan 2020 05:45:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 2DACC6355; Thu, 9 Jan 2020 05:45:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D9377A2C3; Thu, 9 Jan 2020 05:45:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 2jinmGkRgz7E; Thu, 9 Jan 2020 05:45:10 +0000 (UTC) To: Jason Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 1847CA2B7 References: <201911110506.xAB56nFV057050@repo.freebsd.org> From: Bryan Drewery Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAG0JEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hLu BQkNPvODAAoJEDXXcbtuRpfP9rMH/3f7cfX5rzyEV5QNfV/wS4jFukLoPZ4+nCM/TKxH3pEX 2bLbeQbkk6La8cueQ5Lpoht5XFZ18Y5TbMittngltrlNzoDD0h9are24OkDFGim3afJU7tkj IGQa1if+re+vI5BhzYwRhj0oKXzBi39M5oePd3L1dXfx83rg2FPyZBdIejsz6fR74T3JVkbd 6k2l5/3Zk2uiNMy+eBfDRgYE1E6CP28kV0nCeGKZgSVso0kGUUHud7voKqGVpMvbd0mE4pp4 PE5YJaFPjrll9miaDAvdU8LGIq5n6+aXPLKoQ/QNl6mg6ifgI6FfKILOkTizLW8E5PBSNnCm NapQ55yjm125AQ0EUmmGawEIAKJUU9+Q19oW1RK5jTf3m56j+szIc8Y9DaLC8REUKl4UZJBK BqCl6c0cukVApOD92XoU6hJPm2rLEyp/IcYcPPNTnVu8D8h9oag2L8EiFN7+2hk0xG+lwjc8 uOIZycme7AIJsBU4AZ1v63lxm2k104hwpiatgbe71GIGl7p1MX6ousP/wGzXCOF25Dx9w02C eRe7zEMfhnFjSUhzdCC9han2+KaVB7qIqNR3b8NfbwRNlwPmHqlhXffUow9OsQjSnTK8WKNR lx7xzVccXIvWP2wECFrmqmzMmXpSrmIuiWEpFwZ9x2a0Pva8dCNRiCVTK51IlRXKjaAxiN1u IUrMm6UAEQEAAYkBPAQYAQoAJgIbDBYhBPkXPLLDqup6XIofCTXXcbtuRpfPBQJb5hL4BQkN PvONAAoJEDXXcbtuRpfPCjcH/ivBsOpdpebpgLizSNU5/X4yWN5Aixsc9VBnQhGKAKnMINJQ VMpA55sD2JSPwloXYM/B3qyPJRS/9cwIuX5LDNKKOZU3Qp+TzleynM15/xea14orWYRGRict YHBM3Cnqp7OD8K6Q1uhs0fTxyJP7PZ/G0+7Corlf1DlHhDt6C2HldRPFvAvAgl6sR9Wzgcb7 rzub2HVtbJgl6YHbgyAG7x9NpXFqzx1JLAMdpt2DIYwoi+oMdRQlBIwNuKjQjCGzuXHandd3 kGvBAsyJpQ+coEep9UzwANaV28cXrFr2R4FSOcR50rBA2Nh/vqUYfpsvBvJlwuKAoV1djVHa ihNeL5E= Organization: FreeBSD Subject: Re: svn commit: r354606 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc Message-ID: <1cc79883-382f-dcad-ce0d-f8e26232e394@FreeBSD.org> Date: Wed, 8 Jan 2020 21:45:02 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <201911110506.xAB56nFV057050@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7YRoSZsvX4mwlDnWW1MpadYDkaDVR2xtB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 05:45:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7YRoSZsvX4mwlDnWW1MpadYDkaDVR2xtB Content-Type: multipart/mixed; boundary="kfiX0fwcrTddB1GAYRnY4WFtKBcKzoH0i"; protected-headers="v1" From: Bryan Drewery To: Jason Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1cc79883-382f-dcad-ce0d-f8e26232e394@FreeBSD.org> Subject: Re: svn commit: r354606 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc References: <201911110506.xAB56nFV057050@repo.freebsd.org> In-Reply-To: <201911110506.xAB56nFV057050@repo.freebsd.org> --kfiX0fwcrTddB1GAYRnY4WFtKBcKzoH0i Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Do you plan to get this back in soon? I hope to see it before 12.2 if possible. Is there some way I can help? I'm interested in these changes in 5.2.1 (I think) - Properly trigger decay on tcache destroy. (@interwq, @amosbird) - Fix tcache.flush. (@interwq) - Fix a side effect caused by extent_max_active_fit combined with decay-based purging, where freed extents can accumulate and not be reused for an extended period of time. (@interwq, @mpghf) I have a test case where virtual memory was peaking at 275M on 4.x, 1GB on 5.0.0, around 750M on 5.1.0, and finally 275M again on 5.2.0. The 5.0/5.1 versions appeared to be a widespread leak to us. On 11/10/2019 9:06 PM, Jason Evans wrote: > Author: jasone > Date: Mon Nov 11 05:06:49 2019 > New Revision: 354606 > URL: https://svnweb.freebsd.org/changeset/base/354606 >=20 > Log: > Revert r354605: Update jemalloc to version 5.2.1. > =20 > Compilation fails for non-llvm-based platforms. --=20 Regards, Bryan Drewery --kfiX0fwcrTddB1GAYRnY4WFtKBcKzoH0i-- --7YRoSZsvX4mwlDnWW1MpadYDkaDVR2xtB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE+Rc8ssOq6npcih8JNddxu25Gl88FAl4Wvd5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY5 MTczQ0IyQzNBQUVBN0E1QzhBMUYwOTM1RDc3MUJCNkU0Njk3Q0YACgkQNddxu25G l8/SIQf/U1YA7Y9Q7SeW1X8hIeg/o5urK7F0IZZdY0SlFmz2LqC1WjzGWuv7n1B0 VatfmJVJ0S0UI/lucJeCvg/UGfYWA/L4OcIyjLqU9NLk/3IdNX9tw3T49exdPNgi 3W8mbarbxPzAiS56sA3jyT1cS+8tMAQ5YBBBEw85HLgSiKyz1ZmB162MzTdsi162 U8Zrp6PIcAWIZ8yuwV6KzYmYaH85mKVbzpQabpOUok7Yf/8bbpxvF2LEBE9oJX5E JO69wHpGpIo5UmPjDeY2FmW7Wi+J/qXKm2pW/PLs03ggdrwuLjcMclofG4YPcbNX xHecNvYtMdC8d+IwcWJnv/Tr0Sv8fw== =/Jag -----END PGP SIGNATURE----- --7YRoSZsvX4mwlDnWW1MpadYDkaDVR2xtB-- From owner-svn-src-head@freebsd.org Thu Jan 9 06:10:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FF2D22A7A5; Thu, 9 Jan 2020 06:10:26 +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 47tbM60jXVz4fqq; Thu, 9 Jan 2020 06:10:26 +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 0EC4024507; Thu, 9 Jan 2020 06:10:26 +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 0096AP6u030253; Thu, 9 Jan 2020 06:10:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0096APxx030252; Thu, 9 Jan 2020 06:10:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001090610.0096APxx030252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 06:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356540 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 06:10:26 -0000 Author: kevans Date: Thu Jan 9 06:10:25 2020 New Revision: 356540 URL: https://svnweb.freebsd.org/changeset/base/356540 Log: kern/Makefile: systrace_args.c is also generated Modified: head/sys/kern/Makefile Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Thu Jan 9 04:39:37 2020 (r356539) +++ head/sys/kern/Makefile Thu Jan 9 06:10:25 2020 (r356540) @@ -13,6 +13,7 @@ SRCS= capabilities.conf \ syscalls.master GENERATED= init_sysent.c \ syscalls.c \ + systrace_args.c \ ../sys/syscall.h \ ../sys/syscall.mk \ ../sys/sysproto.h From owner-svn-src-head@freebsd.org Thu Jan 9 09:29:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C295622EF32; Thu, 9 Jan 2020 09:29:25 +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 47tgmj4r1Gz3M8v; Thu, 9 Jan 2020 09:29:25 +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 A130126A11; Thu, 9 Jan 2020 09:29:25 +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 0099TPnR050190; Thu, 9 Jan 2020 09:29:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0099TPYd050188; Thu, 9 Jan 2020 09:29:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001090929.0099TPYd050188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Jan 2020 09:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356545 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 356545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 09:29:25 -0000 Author: hselasky Date: Thu Jan 9 09:29:24 2020 New Revision: 356545 URL: https://svnweb.freebsd.org/changeset/base/356545 Log: Fix a XHCI driver issue with Intel's Gemini Lake SOC. Do not configure any endpoint twice, but instead keep track of which endpoints are configured on a per device basis, and use an evaluate endpoint context command instead. When changing the configuration make sure all endpoints get deconfigured and the configured endpoint mask is reset. This fixes an issue where an endpoint might stop working if there is an error and the endpoint needs to be reconfigured as a part of the error recovery mechanism in the FreeBSD USB stack. Tested by: Shichun.Ma@dell.com MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Jan 9 09:14:54 2020 (r356544) +++ head/sys/dev/usb/controller/xhci.c Thu Jan 9 09:29:24 2020 (r356545) @@ -3838,6 +3838,7 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) struct usb_page_cache *pcinp; usb_error_t err; usb_stream_t stream_id; + uint32_t mask; uint8_t index; uint8_t epno; @@ -3903,16 +3904,20 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) * endpoint context state diagram in the XHCI specification: */ - xhci_configure_mask(udev, (1U << epno) | 1U, 0); + mask = (1U << epno); + xhci_configure_mask(udev, mask | 1U, 0); - if (epno > 1) + if (!(sc->sc_hw.devs[index].ep_configured & mask)) { + sc->sc_hw.devs[index].ep_configured |= mask; err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); - else + } else { err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); + } - if (err != 0) - DPRINTF("Could not configure endpoint %u\n", epno); - + if (err != 0) { + DPRINTF("Could not configure " + "endpoint %u at slot %u.\n", epno, index); + } XHCI_CMD_UNLOCK(sc); return (0); @@ -4273,6 +4278,7 @@ xhci_device_state_change(struct usb_device *udev) /* set default state */ sc->sc_hw.devs[index].state = XHCI_ST_DEFAULT; + sc->sc_hw.devs[index].ep_configured = 3U; /* reset number of contexts */ sc->sc_hw.devs[index].context_num = 0; @@ -4290,6 +4296,7 @@ xhci_device_state_change(struct usb_device *udev) break; sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED; + sc->sc_hw.devs[index].ep_configured = 3U; /* set configure mask to slot only */ xhci_configure_mask(udev, 1, 0); @@ -4304,11 +4311,19 @@ xhci_device_state_change(struct usb_device *udev) break; case USB_STATE_CONFIGURED: - if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) - break; + if (sc->sc_hw.devs[index].state == XHCI_ST_CONFIGURED) { + /* deconfigure all endpoints, except EP0 */ + err = xhci_cmd_configure_ep(sc, 0, 1, index); + if (err) { + DPRINTF("Failed to deconfigure " + "slot %u.\n", index); + } + } + /* set configured state */ sc->sc_hw.devs[index].state = XHCI_ST_CONFIGURED; + sc->sc_hw.devs[index].ep_configured = 3U; /* reset number of contexts */ sc->sc_hw.devs[index].context_num = 0; Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Thu Jan 9 09:14:54 2020 (r356544) +++ head/sys/dev/usb/controller/xhci.h Thu Jan 9 09:29:24 2020 (r356545) @@ -408,6 +408,8 @@ struct xhci_hw_dev { struct xhci_endpoint_ext endp[XHCI_MAX_ENDPOINTS]; + uint32_t ep_configured; + uint8_t state; uint8_t nports; uint8_t tt; From owner-svn-src-head@freebsd.org Thu Jan 9 10:00:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C1022FC63; Thu, 9 Jan 2020 10:00:24 +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 47thSS4SZSz3P7X; Thu, 9 Jan 2020 10:00:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9413726FAF; Thu, 9 Jan 2020 10:00:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009A0OWR068420; Thu, 9 Jan 2020 10:00:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009A0Ofo068419; Thu, 9 Jan 2020 10:00:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001091000.009A0Ofo068419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 9 Jan 2020 10:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356548 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 356548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 10:00:24 -0000 Author: kib Date: Thu Jan 9 10:00:24 2020 New Revision: 356548 URL: https://svnweb.freebsd.org/changeset/base/356548 Log: Resolve relative argv0 for direct exec mode to absolute path for AT_EXECPATH. We know the binary relative name and can reliably calculate cwd path. Because realpath(3) was already linked into ld-elf.so.1, reuse it there to resolve dots and dotdots making the path more canonical. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23014 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jan 9 09:47:23 2020 (r356547) +++ head/libexec/rtld-elf/rtld.c Thu Jan 9 10:00:24 2020 (r356548) @@ -5513,9 +5513,12 @@ static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res) { - char *pathenv, *pe, *binpath; + char *abspath, *absres, *binpath, *pathenv, *pe, *res1; + const char *res; int fd; + binpath = NULL; + res = NULL; if (search_in_path && strchr(argv0, '/') == NULL) { binpath = xmalloc(PATH_MAX); pathenv = getenv("PATH"); @@ -5540,20 +5543,45 @@ open_binary_fd(const char *argv0, bool search_in_path, continue; fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY); if (fd != -1 || errno != ENOENT) { - *binpath_res = binpath; + res = binpath; break; } } free(pathenv); } else { fd = open(argv0, O_RDONLY | O_CLOEXEC | O_VERIFY); - *binpath_res = argv0; + res = argv0; } - /* XXXKIB Use getcwd() to resolve relative binpath to absolute. */ if (fd == -1) { _rtld_error("Cannot open %s: %s", argv0, rtld_strerror(errno)); rtld_die(); + } + if (res != NULL && res[0] != '/') { + abspath = getcwd(NULL, 0); + if (abspath != NULL) { + res1 = xmalloc(PATH_MAX); + if (realpath(res, res1) != NULL) { + if (res != argv0) + free(__DECONST(char *, res)); + res = res1; + } else { + free(res1); + } + absres = xmalloc(strlen(abspath) + + strlen(res) + 2); + strcpy(absres, abspath); + strcat(absres, "/"); + strcat(absres, res); + free(abspath); + if (res != argv0) + free(__DECONST(char *, res)); + *binpath_res = absres; + } else { + *binpath_res = res; + } + } else { + *binpath_res = res; } return (fd); } From owner-svn-src-head@freebsd.org Thu Jan 9 10:05:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B23601E8239; Thu, 9 Jan 2020 10:05:45 +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 47thZd4H9Nz3PnZ; Thu, 9 Jan 2020 10:05:45 +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 756D127193; Thu, 9 Jan 2020 10:05:45 +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 009A5jFr073925; Thu, 9 Jan 2020 10:05:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009A5jfk073924; Thu, 9 Jan 2020 10:05:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001091005.009A5jfk073924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 9 Jan 2020 10:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356549 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 356549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 10:05:45 -0000 Author: kib Date: Thu Jan 9 10:05:45 2020 New Revision: 356549 URL: https://svnweb.freebsd.org/changeset/base/356549 Log: rtld: Return error if $ORIGIN for a dlopen-ed library cannot be resolved ... instead of killing the process. The same behaviour of terminating image activation if the $ORIGIN cannot be resolved for the main object, is kept. Reported by: Greg V Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23053 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Jan 9 10:00:24 2020 (r356548) +++ head/libexec/rtld-elf/rtld.c Thu Jan 9 10:05:45 2020 (r356549) @@ -88,9 +88,9 @@ extern void (*__cleanup)(void); static const char *basename(const char *); static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, const Elf_Dyn **, const Elf_Dyn **); -static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, +static bool digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, const Elf_Dyn *); -static void digest_dynamic(Obj_Entry *, int); +static bool digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static void distribute_static_tls(Objlist *, RtldLockState *); static Obj_Entry *dlcheck(void *); @@ -671,7 +671,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr } #endif - digest_dynamic(obj_main, 0); + if (!digest_dynamic(obj_main, 0)) + rtld_die(); dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj_main->path, obj_main->valid_hash_sysv, obj_main->valid_hash_gnu, obj_main->dynsymcount); @@ -1408,13 +1409,13 @@ obj_resolve_origin(Obj_Entry *obj) return (rtld_dirname_abs(obj->path, obj->origin_path) != -1); } -static void +static bool digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpath, const Elf_Dyn *dyn_soname, const Elf_Dyn *dyn_runpath) { if (obj->z_origin && !obj_resolve_origin(obj)) - rtld_die(); + return (false); if (dyn_runpath != NULL) { obj->runpath = (const char *)obj->strtab + dyn_runpath->d_un.d_val; @@ -1425,9 +1426,10 @@ digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpa } if (dyn_soname != NULL) object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); + return (true); } -static void +static bool digest_dynamic(Obj_Entry *obj, int early) { const Elf_Dyn *dyn_rpath; @@ -1435,7 +1437,7 @@ digest_dynamic(Obj_Entry *obj, int early) const Elf_Dyn *dyn_runpath; digest_dynamic1(obj, early, &dyn_rpath, &dyn_soname, &dyn_runpath); - digest_dynamic2(obj, dyn_rpath, dyn_soname, dyn_runpath); + return (digest_dynamic2(obj, dyn_rpath, dyn_soname, dyn_runpath)); } /* @@ -2563,16 +2565,15 @@ do_load_object(int fd, const char *name, char *path, s if (name != NULL) object_add_name(obj, name); obj->path = path; - digest_dynamic(obj, 0); + if (!digest_dynamic(obj, 0)) + goto errp; dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path, obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount); if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); _rtld_error("Cannot dlopen non-loadable %s", obj->path); - munmap(obj->mapbase, obj->mapsize); - obj_free(obj); - return (NULL); + goto errp; } obj->dlopened = (flags & RTLD_LO_DLOPEN) != 0; @@ -2589,7 +2590,12 @@ do_load_object(int fd, const char *name, char *path, s LD_UTRACE(UTRACE_LOAD_OBJECT, obj, obj->mapbase, obj->mapsize, 0, obj->path); - return obj; + return (obj); + +errp: + munmap(obj->mapbase, obj->mapsize); + obj_free(obj); + return (NULL); } static Obj_Entry * @@ -3990,12 +3996,17 @@ rtld_dirname_abs(const char *path, char *base) { char *last; - if (realpath(path, base) == NULL) + if (realpath(path, base) == NULL) { + _rtld_error("realpath \"%s\" failed (%s)", path, + rtld_strerror(errno)); return (-1); + } dbg("%s -> %s", path, base); last = strrchr(base, '/'); - if (last == NULL) + if (last == NULL) { + _rtld_error("non-abs result from realpath \"%s\"", path); return (-1); + } if (last != base) *last = '\0'; return (0); From owner-svn-src-head@freebsd.org Thu Jan 9 10:26:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99A351E8D90; Thu, 9 Jan 2020 10:26:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tj2j3cXJz3R8t; Thu, 9 Jan 2020 10:26:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7768427533; Thu, 9 Jan 2020 10:26:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009AQb5S086276; Thu, 9 Jan 2020 10:26:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009AQblu086275; Thu, 9 Jan 2020 10:26:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202001091026.009AQblu086275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 9 Jan 2020 10:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356550 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 356550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 10:26:37 -0000 Author: andrew Date: Thu Jan 9 10:26:36 2020 New Revision: 356550 URL: https://svnweb.freebsd.org/changeset/base/356550 Log: Add atomic_testandset/clear on arm64. These will reportedly be used in future uma changes. MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D23019 Modified: head/sys/arm64/include/atomic.h Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Thu Jan 9 10:05:45 2020 (r356549) +++ head/sys/arm64/include/atomic.h Thu Jan 9 10:26:36 2020 (r356550) @@ -548,7 +548,87 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val : "memory"); } +static __inline int +atomic_testandclear_32(volatile uint32_t *p, u_int val) +{ + uint32_t mask, old, tmp; + int res; + mask = 1u << (val & 0x1f); + __asm __volatile( + "1: ldxr %w2, [%3] \n" + " bic %w0, %w2, %w4 \n" + " stxr %w1, %w0, [%3] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "=&r"(old) + : "r" (p), "r" (mask) + : "memory" + ); + + return ((old & mask) != 0); +} + +static __inline int +atomic_testandclear_64(volatile uint64_t *p, u_int val) +{ + uint64_t mask, old, tmp; + int res; + + mask = 1ul << (val & 0x1f); + __asm __volatile( + "1: ldxr %2, [%3] \n" + " bic %0, %2, %4 \n" + " stxr %w1, %0, [%3] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "=&r"(old) + : "r" (p), "r" (mask) + : "memory" + ); + + return ((old & mask) != 0); +} + +static __inline int +atomic_testandset_32(volatile uint32_t *p, u_int val) +{ + uint32_t mask, old, tmp; + int res; + + mask = 1u << (val & 0x1f); + __asm __volatile( + "1: ldxr %w2, [%3] \n" + " orr %w0, %w2, %w4 \n" + " stxr %w1, %w0, [%3] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "=&r"(old) + : "r" (p), "r" (mask) + : "memory" + ); + + return ((old & mask) != 0); +} + +static __inline int +atomic_testandset_64(volatile uint64_t *p, u_int val) +{ + uint64_t mask, old, tmp; + int res; + + mask = 1ul << (val & 0x1f); + __asm __volatile( + "1: ldxr %2, [%3] \n" + " orr %0, %2, %4 \n" + " stxr %w1, %0, [%3] \n" + " cbnz %w1, 1b \n" + : "=&r"(tmp), "=&r"(res), "=&r"(old) + : "r" (p), "r" (mask) + : "memory" + ); + + return ((old & mask) != 0); +} + + #define atomic_add_int atomic_add_32 #define atomic_fcmpset_int atomic_fcmpset_32 #define atomic_clear_int atomic_clear_32 @@ -558,6 +638,8 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val #define atomic_set_int atomic_set_32 #define atomic_swap_int atomic_swap_32 #define atomic_subtract_int atomic_subtract_32 +#define atomic_testandclear_int atomic_testandclear_32 +#define atomic_testandset_int atomic_testandset_32 #define atomic_add_acq_int atomic_add_acq_32 #define atomic_fcmpset_acq_int atomic_fcmpset_acq_32 @@ -584,6 +666,8 @@ atomic_store_rel_64(volatile uint64_t *p, uint64_t val #define atomic_set_long atomic_set_64 #define atomic_swap_long atomic_swap_64 #define atomic_subtract_long atomic_subtract_64 +#define atomic_testandclear_long atomic_testandclear_64 +#define atomic_testandset_long atomic_testandset_64 #define atomic_add_ptr atomic_add_64 #define atomic_fcmpset_ptr atomic_fcmpset_64 From owner-svn-src-head@freebsd.org Thu Jan 9 11:58:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D97F1EB104; Thu, 9 Jan 2020 11:58:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tl4g0SNgz41fH; Thu, 9 Jan 2020 11:58:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AF176B1; Thu, 9 Jan 2020 11:58:27 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009BwQZd042071; Thu, 9 Jan 2020 11:58:26 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009BwQgS042070; Thu, 9 Jan 2020 11:58:26 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001091158.009BwQgS042070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 9 Jan 2020 11:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356551 - head/usr.sbin/arp X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/arp X-SVN-Commit-Revision: 356551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 11:58:27 -0000 Author: eugen Date: Thu Jan 9 11:58:26 2020 New Revision: 356551 URL: https://svnweb.freebsd.org/changeset/base/356551 Log: arp(8): avoid segfaulting due to out-of-bounds memory access Fix obvious mistake that sometimes results in reading memory past end of an array. PR: 240825 MFC after: 1 week Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Thu Jan 9 10:26:36 2020 (r356550) +++ head/usr.sbin/arp/arp.c Thu Jan 9 11:58:26 2020 (r356551) @@ -627,8 +627,7 @@ print_entry(struct sockaddr_dl *sdl, } else xo_emit("{d:/(incomplete)}{en:incomplete/true}"); - for (p = ifnameindex; p && ifnameindex->if_index && - ifnameindex->if_name; p++) { + for (p = ifnameindex; p && p->if_index && p->if_name; p++) { if (p->if_index == sdl->sdl_index) { xo_emit(" on {:interface/%s}", p->if_name); break; From owner-svn-src-head@freebsd.org Thu Jan 9 14:10:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 761B21EF3C2; Thu, 9 Jan 2020 14:10:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tp0h2b2Sz49lP; Thu, 9 Jan 2020 14:10:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53F611F8E; Thu, 9 Jan 2020 14:10:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009EACwf020680; Thu, 9 Jan 2020 14:10:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009EACsn020679; Thu, 9 Jan 2020 14:10:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001091410.009EACsn020679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 9 Jan 2020 14:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356552 - in head/contrib/llvm-project/libunwind: include src X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/contrib/llvm-project/libunwind: include src X-SVN-Commit-Revision: 356552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 14:10:12 -0000 Author: emaste Date: Thu Jan 9 14:10:11 2020 New Revision: 356552 URL: https://svnweb.freebsd.org/changeset/base/356552 Log: revert r356513: libunwind: untested attempt to fix sparc64 build The patch is untested and is almost certainly insufficient. Per the author's request, revert until someone with access to sparc64 hardware can test and report. Modified: head/contrib/llvm-project/libunwind/include/__libunwind_config.h head/contrib/llvm-project/libunwind/src/config.h Modified: head/contrib/llvm-project/libunwind/include/__libunwind_config.h ============================================================================== --- head/contrib/llvm-project/libunwind/include/__libunwind_config.h Thu Jan 9 11:58:26 2020 (r356551) +++ head/contrib/llvm-project/libunwind/include/__libunwind_config.h Thu Jan 9 14:10:11 2020 (r356552) @@ -124,7 +124,7 @@ #define _LIBUNWIND_TARGET_SPARC 1 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC #define _LIBUNWIND_CONTEXT_SIZE 16 - #define _LIBUNWIND_CURSOR_SIZE 28 + #define _LIBUNWIND_CURSOR_SIZE 23 # else # error "Unsupported architecture." # endif Modified: head/contrib/llvm-project/libunwind/src/config.h ============================================================================== --- head/contrib/llvm-project/libunwind/src/config.h Thu Jan 9 11:58:26 2020 (r356551) +++ head/contrib/llvm-project/libunwind/src/config.h Thu Jan 9 14:10:11 2020 (r356552) @@ -104,8 +104,7 @@ (!defined(__APPLE__) && defined(__arm__)) || \ (defined(__arm64__) || defined(__aarch64__)) || \ defined(__mips__) || \ - defined(__riscv) || \ - defined(__sparc__) + defined(__riscv) #if !defined(_LIBUNWIND_BUILD_SJLJ_APIS) #define _LIBUNWIND_BUILD_ZERO_COST_APIS #endif From owner-svn-src-head@freebsd.org Thu Jan 9 14:12:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A03581EF63E; Thu, 9 Jan 2020 14:12:57 +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 47tp3s3h3vz4BBC; Thu, 9 Jan 2020 14:12:57 +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 79755214C; Thu, 9 Jan 2020 14:12:57 +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 009ECvWW026330; Thu, 9 Jan 2020 14:12:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009ECveL026329; Thu, 9 Jan 2020 14:12:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001091412.009ECveL026329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 9 Jan 2020 14:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356553 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 14:12:57 -0000 Author: emaste Date: Thu Jan 9 14:12:57 2020 New Revision: 356553 URL: https://svnweb.freebsd.org/changeset/base/356553 Log: Revert r356515 - add LLVM_LIBUNWIND back to sparc64 BROKEN_OPTIONS r356552 reverted the untested build fix for LLVM libunwind on sparc64, so mark it broken again. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jan 9 14:10:11 2020 (r356552) +++ head/share/mk/src.opts.mk Thu Jan 9 14:12:57 2020 (r356553) @@ -392,6 +392,8 @@ BROKEN_OPTIONS+=NVME .if ${__T:Msparc64} # Sparc64 need extra crt*.o files - PR 239851 BROKEN_OPTIONS+=BSD_CRTBEGIN +# PR 233405 +BROKEN_OPTIONS+=LLVM_LIBUNWIND .endif .if ${COMPILER_FEATURES:Mc++11} && \ From owner-svn-src-head@freebsd.org Thu Jan 9 14:58:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92C4C1F06EB; Thu, 9 Jan 2020 14:58:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tq4f3QZxz4Fdb; Thu, 9 Jan 2020 14:58:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70D3C28A4; Thu, 9 Jan 2020 14:58:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009EwgAF050504; Thu, 9 Jan 2020 14:58:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009EwfUg050501; Thu, 9 Jan 2020 14:58:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001091458.009EwfUg050501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jan 2020 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356554 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 356554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 14:58:42 -0000 Author: markj Date: Thu Jan 9 14:58:41 2020 New Revision: 356554 URL: https://svnweb.freebsd.org/changeset/base/356554 Log: lagg: Further cleanup of the rr_limit option. Add an option flag so that arbitrary updates to a lagg's configuration do not clear sc_stride. Preseve compatibility for old ifconfig binaries. Update ifconfig to use the new flag and improve the casting used when parsing the option parameter. Modify the RR transmit function to avoid locklessly reading sc_stride twice. Ensure that sc_stride is always 1 or greater. Reviewed by: hselasky MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23092 Modified: head/sbin/ifconfig/iflagg.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Jan 9 14:12:57 2020 (r356553) +++ head/sbin/ifconfig/iflagg.c Thu Jan 9 14:58:41 2020 (r356554) @@ -114,10 +114,13 @@ setlaggrr_limit(const char *val, int d, int s, const s bzero(&ro, sizeof(ro)); strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); - ro.ro_bkt = (int)strtol(val, NULL, 10); + ro.ro_opts = LAGG_OPT_RR_LIMIT; + ro.ro_bkt = (uint32_t)strtoul(val, NULL, 10); + if (ro.ro_bkt == 0) + errx(1, "Invalid round-robin stride: %s", val); if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) - err(1, "SIOCSLAGG"); + err(1, "SIOCSLAGGOPTS"); } static void Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Jan 9 14:12:57 2020 (r356553) +++ head/sys/net/if_lagg.c Thu Jan 9 14:58:41 2020 (r356554) @@ -1257,21 +1257,18 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* * The stride option was added without defining a corresponding - * LAGG_OPT flag, so we must handle it before processing any - * remaining options. + * LAGG_OPT flag, so handle a non-zero value before checking + * anything else to preserve compatibility. */ LAGG_XLOCK(sc); - if (ro->ro_bkt != 0) { + if (ro->ro_opts == 0 && ro->ro_bkt != 0) { if (sc->sc_proto != LAGG_PROTO_ROUNDROBIN) { LAGG_XUNLOCK(sc); error = EINVAL; break; } sc->sc_stride = ro->ro_bkt; - } else { - sc->sc_stride = 0; } - if (ro->ro_opts == 0) { LAGG_XUNLOCK(sc); break; @@ -1289,6 +1286,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case LAGG_OPT_USE_NUMA: case -LAGG_OPT_USE_NUMA: case LAGG_OPT_FLOWIDSHIFT: + case LAGG_OPT_RR_LIMIT: valid = 1; lacp = 0; break; @@ -1314,14 +1312,23 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data LAGG_XUNLOCK(sc); break; /* Return from SIOCSLAGGOPTS. */ } + /* * Store new options into sc->sc_opts except for - * FLOWIDSHIFT and LACP options. + * FLOWIDSHIFT, RR and LACP options. */ if (lacp == 0) { if (ro->ro_opts == LAGG_OPT_FLOWIDSHIFT) sc->flowid_shift = ro->ro_flowid_shift; - else if (ro->ro_opts > 0) + else if (ro->ro_opts == LAGG_OPT_RR_LIMIT) { + if (sc->sc_proto != LAGG_PROTO_ROUNDROBIN || + ro->ro_bkt == 0) { + error = EINVAL; + LAGG_XUNLOCK(sc); + break; + } + sc->sc_stride = ro->ro_bkt; + } else if (ro->ro_opts > 0) sc->sc_opts |= ro->ro_opts; else sc->sc_opts &= ~ro->ro_opts; @@ -2046,6 +2053,7 @@ static void lagg_rr_attach(struct lagg_softc *sc) { sc->sc_seq = 0; + sc->sc_stride = 1; } static int @@ -2055,9 +2063,7 @@ lagg_rr_start(struct lagg_softc *sc, struct mbuf *m) uint32_t p; p = atomic_fetchadd_32(&sc->sc_seq, 1); - if (sc->sc_stride > 0) - p /= sc->sc_stride; - + p /= sc->sc_stride; p %= sc->sc_count; lp = CK_SLIST_FIRST(&sc->sc_ports); Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Thu Jan 9 14:12:57 2020 (r356553) +++ head/sys/net/if_lagg.h Thu Jan 9 14:58:41 2020 (r356554) @@ -63,11 +63,11 @@ struct lagg_protos { #define LAGG_PROTO_DEFAULT LAGG_PROTO_FAILOVER #define LAGG_PROTOS { \ - { "failover", LAGG_PROTO_FAILOVER }, \ + { "failover", LAGG_PROTO_FAILOVER }, \ { "lacp", LAGG_PROTO_LACP }, \ { "loadbalance", LAGG_PROTO_LOADBALANCE }, \ - { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ - { "broadcast", LAGG_PROTO_BROADCAST }, \ + { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ + { "broadcast", LAGG_PROTO_BROADCAST }, \ { "none", LAGG_PROTO_NONE }, \ { "default", LAGG_PROTO_DEFAULT } \ } @@ -149,6 +149,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ #define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ +#define LAGG_OPT_RR_LIMIT 0x100 /* RR stride */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ u_int ro_flapping; /* number of flapping */ From owner-svn-src-head@freebsd.org Thu Jan 9 15:02:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8134D1F093B; Thu, 9 Jan 2020 15:02:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tq9P2sX8z4G4X; Thu, 9 Jan 2020 15:02:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D9222AA4; Thu, 9 Jan 2020 15:02:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009F2nwb056284; Thu, 9 Jan 2020 15:02:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009F2nLC056283; Thu, 9 Jan 2020 15:02:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001091502.009F2nLC056283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jan 2020 15:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356555 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 15:02:49 -0000 Author: markj Date: Thu Jan 9 15:02:48 2020 New Revision: 356555 URL: https://svnweb.freebsd.org/changeset/base/356555 Log: Change malloc_domain() to return the allocation size to the caller. Otherwise the malloc type accounting in malloc_domainset(9) is wrong after r355203. Reviewed by: rlibby Reported by: kaktus Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23095 Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Jan 9 14:58:41 2020 (r356554) +++ head/sys/kern/kern_malloc.c Thu Jan 9 15:02:48 2020 (r356555) @@ -652,13 +652,15 @@ void * } static void * -malloc_domain(size_t size, int *indxp, struct malloc_type *mtp, int domain, +malloc_domain(size_t *sizep, int *indxp, struct malloc_type *mtp, int domain, int flags) { - int indx; - caddr_t va; uma_zone_t zone; + caddr_t va; + size_t size; + int indx; + size = *sizep; KASSERT(size <= kmem_zmax && (flags & M_EXEC) == 0, ("malloc_domain: Called with bad flag / size combination.")); if (size & KMEM_ZMASK) @@ -670,10 +672,9 @@ malloc_domain(size_t size, int *indxp, struct malloc_t #endif va = uma_zalloc_domain(zone, NULL, domain, flags); if (va != NULL) - size = zone->uz_size; + *sizep = zone->uz_size; *indxp = indx; - - return ((void *) va); + return ((void *)va); } void * @@ -696,7 +697,7 @@ malloc_domainset(size_t size, struct malloc_type *mtp, if (size <= kmem_zmax && (flags & M_EXEC) == 0) { vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { - ret = malloc_domain(size, &indx, mtp, domain, flags); + ret = malloc_domain(&size, &indx, mtp, domain, flags); } while (ret == NULL && vm_domainset_iter_policy(&di, &domain) == 0); malloc_type_zone_allocated(mtp, ret == NULL ? 0 : size, indx); From owner-svn-src-head@freebsd.org Thu Jan 9 15:21:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31DA71F1004; Thu, 9 Jan 2020 15:21:43 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tqbC0dLJz4H3q; Thu, 9 Jan 2020 15:21:43 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 110E72DEF; Thu, 9 Jan 2020 15:21:43 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009FLg9n067119; Thu, 9 Jan 2020 15:21:42 GMT (envelope-from arrowd@FreeBSD.org) Received: (from arrowd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009FLg8R067118; Thu, 9 Jan 2020 15:21:42 GMT (envelope-from arrowd@FreeBSD.org) Message-Id: <202001091521.009FLg8R067118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arrowd set sender to arrowd@FreeBSD.org using -f From: Gleb Popov Date: Thu, 9 Jan 2020 15:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356556 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: arrowd X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 356556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 15:21:43 -0000 Author: arrowd (ports committer) Date: Thu Jan 9 15:21:42 2020 New Revision: 356556 URL: https://svnweb.freebsd.org/changeset/base/356556 Log: Fix typo: MANGAEMENT_PROTOCOL_OUT -> MANAGEMENT_PROTOCOL_OUT. Approved by: allanjude Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Jan 9 15:02:48 2020 (r356555) +++ head/sys/cam/scsi/scsi_all.h Thu Jan 9 15:21:42 2020 (r356556) @@ -2142,7 +2142,7 @@ struct ata_pass_32 { #define CHANGE_ALIASES 0x0B #define SET_PRIORITY 0x0E #define SET_TIMESTAMP 0x0F -#define MANGAEMENT_PROTOCOL_OUT 0x10 +#define MANAGEMENT_PROTOCOL_OUT 0x10 /* * Device Types From owner-svn-src-head@freebsd.org Thu Jan 9 16:34:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0C181F2E5B; Thu, 9 Jan 2020 16:34: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 47tsCf4R2Pz4MR8; Thu, 9 Jan 2020 16:34: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 8F14D3DF1; Thu, 9 Jan 2020 16:34: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 009GYscX009733; Thu, 9 Jan 2020 16:34:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009GYsG2009732; Thu, 9 Jan 2020 16:34:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001091634.009GYsG2009732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jan 2020 16:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356557 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 356557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 16:34:54 -0000 Author: imp Date: Thu Jan 9 16:34:54 2020 New Revision: 356557 URL: https://svnweb.freebsd.org/changeset/base/356557 Log: Const-poison the cam_sim_* convenience accessor functions. These don't modify the cam_sim, so make that parameter const. Modified: head/sys/cam/cam_sim.h Modified: head/sys/cam/cam_sim.h ============================================================================== --- head/sys/cam/cam_sim.h Thu Jan 9 15:21:42 2020 (r356556) +++ head/sys/cam/cam_sim.h Thu Jan 9 16:34:54 2020 (r356557) @@ -81,11 +81,11 @@ void cam_sim_set_path(struct cam_sim *sim, u_int32_t p /* Convenience routines for accessing sim attributes. */ -static __inline u_int32_t cam_sim_path(struct cam_sim *sim); -static __inline const char * cam_sim_name(struct cam_sim *sim); -static __inline void * cam_sim_softc(struct cam_sim *sim); -static __inline u_int32_t cam_sim_unit(struct cam_sim *sim); -static __inline u_int32_t cam_sim_bus(struct cam_sim *sim); +static __inline u_int32_t cam_sim_path(const struct cam_sim *sim); +static __inline const char * cam_sim_name(const struct cam_sim *sim); +static __inline void * cam_sim_softc(const struct cam_sim *sim); +static __inline u_int32_t cam_sim_unit(const struct cam_sim *sim); +static __inline u_int32_t cam_sim_bus(const struct cam_sim *sim); @@ -125,31 +125,31 @@ struct cam_sim { #define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx) static __inline u_int32_t -cam_sim_path(struct cam_sim *sim) +cam_sim_path(const struct cam_sim *sim) { return (sim->path_id); } static __inline const char * -cam_sim_name(struct cam_sim *sim) +cam_sim_name(const struct cam_sim *sim) { return (sim->sim_name); } static __inline void * -cam_sim_softc(struct cam_sim *sim) +cam_sim_softc(const struct cam_sim *sim) { return (sim->softc); } static __inline u_int32_t -cam_sim_unit(struct cam_sim *sim) +cam_sim_unit(const struct cam_sim *sim) { return (sim->unit_number); } static __inline u_int32_t -cam_sim_bus(struct cam_sim *sim) +cam_sim_bus(const struct cam_sim *sim) { return (sim->bus_id); } From owner-svn-src-head@freebsd.org Thu Jan 9 17:21:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAC4F1F4178; Thu, 9 Jan 2020 17:21:02 +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 47ttDt5Tz3z4QJb; Thu, 9 Jan 2020 17:21:02 +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 B7A094704; Thu, 9 Jan 2020 17:21:02 +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 009HL22v036984; Thu, 9 Jan 2020 17:21:02 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009HL0eY036974; Thu, 9 Jan 2020 17:21:00 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001091721.009HL0eY036974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 9 Jan 2020 17:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356559 - in head/sys: net netinet netinet6 sys X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net netinet netinet6 sys X-SVN-Commit-Revision: 356559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 17:21:02 -0000 Author: melifaro Date: Thu Jan 9 17:21:00 2020 New Revision: 356559 URL: https://svnweb.freebsd.org/changeset/base/356559 Log: Add fibnum, family and vnet pointer to each rib head. Having metadata such as fibnum or vnet in the struct rib_head is handy as it eases building functionality in the routing space. This change is required to properly bring back route redirect support. Reviewed by: bz MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D23047 Modified: head/sys/net/radix_mpath.c head/sys/net/radix_mpath.h head/sys/net/route.c head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/sys/domain.h Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/net/radix_mpath.c Thu Jan 9 17:21:00 2020 (r356559) @@ -290,17 +290,17 @@ rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_i RT_UNLOCK(ro->ro_rt); } -extern int in6_inithead(void **head, int off); -extern int in_inithead(void **head, int off); +extern int in6_inithead(void **head, int off, u_int fibnum); +extern int in_inithead(void **head, int off, u_int fibnum); #ifdef INET int -rn4_mpath_inithead(void **head, int off) +rn4_mpath_inithead(void **head, int off, u_int fibnum) { struct rib_head *rnh; hashjitter = arc4random(); - if (in_inithead(head, off) == 1) { + if (in_inithead(head, off, fibnum) == 1) { rnh = (struct rib_head *)*head; rnh->rnh_multipath = 1; return 1; @@ -311,12 +311,12 @@ rn4_mpath_inithead(void **head, int off) #ifdef INET6 int -rn6_mpath_inithead(void **head, int off) +rn6_mpath_inithead(void **head, int off, u_int fibnum) { struct rib_head *rnh; hashjitter = arc4random(); - if (in6_inithead(head, off) == 1) { + if (in6_inithead(head, off, fibnum) == 1) { rnh = (struct rib_head *)*head; rnh->rnh_multipath = 1; return 1; Modified: head/sys/net/radix_mpath.h ============================================================================== --- head/sys/net/radix_mpath.h Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/net/radix_mpath.h Thu Jan 9 17:21:00 2020 (r356559) @@ -57,8 +57,8 @@ int rt_mpath_conflict(struct rib_head *, struct rtentr void rtalloc_mpath_fib(struct route *, u_int32_t, u_int); struct rtentry *rt_mpath_select(struct rtentry *, uint32_t); int rt_mpath_deldup(struct rtentry *, struct rtentry *); -int rn4_mpath_inithead(void **, int); -int rn6_mpath_inithead(void **, int); +int rn4_mpath_inithead(void **, int, u_int); +int rn6_mpath_inithead(void **, int, u_int); #endif Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/net/route.c Thu Jan 9 17:21:00 2020 (r356559) @@ -304,7 +304,7 @@ vnet_route_init(const void *unused __unused) rnh = rt_tables_get_rnh_ptr(table, fam); if (rnh == NULL) panic("%s: rnh NULL", __func__); - dom->dom_rtattach((void **)rnh, 0); + dom->dom_rtattach((void **)rnh, 0, table); } } } @@ -345,7 +345,7 @@ VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, #endif struct rib_head * -rt_table_init(int offset) +rt_table_init(int offset, int family, u_int fibnum) { struct rib_head *rh; @@ -356,6 +356,13 @@ rt_table_init(int offset) rn_inithead_internal(&rh->head, rh->rnh_nodes, offset); rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0); rh->head.rnh_masks = &rh->rmhead; + + /* Save metadata associated with this routing table. */ + rh->rib_family = family; + rh->rib_fibnum = fibnum; +#ifdef VIMAGE + rh->rib_vnet = curvnet; +#endif /* Init locks */ RIB_LOCK_INIT(rh); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/net/route.h Thu Jan 9 17:21:00 2020 (r356559) @@ -455,7 +455,7 @@ int rt_routemsg_info(int, struct rt_addrinfo *, int); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); -struct rib_head *rt_table_init(int); +struct rib_head *rt_table_init(int, int, u_int); void rt_table_destroy(struct rib_head *); u_int rt_tables_get_gen(int table, int fam); Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/net/route_var.h Thu Jan 9 17:21:00 2020 (r356559) @@ -46,6 +46,9 @@ struct rib_head { struct radix_node rnh_nodes[3]; /* empty tree for common case */ struct rmlock rib_lock; /* config/data path lock */ struct radix_mask_head rmhead; /* masks radix head */ + struct vnet *rib_vnet; /* vnet pointer */ + int rib_family; /* AF of the rtable */ + u_int rib_fibnum; /* fib number */ }; #define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/netinet/in_proto.c Thu Jan 9 17:21:00 2020 (r356559) @@ -297,7 +297,7 @@ IPPROTOSPACER, }, }; -extern int in_inithead(void **, int); +extern int in_inithead(void **, int, u_int); extern int in_detachhead(void **, int); struct domain inetdomain = { Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/netinet/in_rmx.c Thu Jan 9 17:21:00 2020 (r356559) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -extern int in_inithead(void **head, int off); +extern int in_inithead(void **head, int off, u_int fibnum); #ifdef VIMAGE extern int in_detachhead(void **head, int off); #endif @@ -116,11 +116,11 @@ static int _in_rt_was_here; * Initialize our routing tree. */ int -in_inithead(void **head, int off) +in_inithead(void **head, int off, u_int fibnum) { struct rib_head *rh; - rh = rt_table_init(32); + rh = rt_table_init(32, AF_INET, fibnum); if (rh == NULL) return (0); Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/netinet6/in6_proto.c Thu Jan 9 17:21:00 2020 (r356559) @@ -336,7 +336,7 @@ IP6PROTOSPACER, }, }; -extern int in6_inithead(void **, int); +extern int in6_inithead(void **, int, u_int); #ifdef VIMAGE extern int in6_detachhead(void **, int); #endif Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/netinet6/in6_rmx.c Thu Jan 9 17:21:00 2020 (r356559) @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include -extern int in6_inithead(void **head, int off); +extern int in6_inithead(void **head, int off, u_int fibnum); #ifdef VIMAGE extern int in6_detachhead(void **head, int off); #endif @@ -157,11 +157,12 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_he */ int -in6_inithead(void **head, int off) +in6_inithead(void **head, int off, u_int fibnum) { struct rib_head *rh; - rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3); + rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3, + AF_INET6, fibnum); if (rh == NULL) return (0); Modified: head/sys/sys/domain.h ============================================================================== --- head/sys/sys/domain.h Thu Jan 9 16:47:59 2020 (r356558) +++ head/sys/sys/domain.h Thu Jan 9 17:21:00 2020 (r356559) @@ -60,7 +60,7 @@ struct domain { struct protosw *dom_protosw, *dom_protoswNPROTOSW; struct domain *dom_next; int (*dom_rtattach) /* initialize routing table */ - (void **, int); + (void **, int, u_int); int (*dom_rtdetach) /* clean up routing table */ (void **, int); void *(*dom_ifattach)(struct ifnet *); From owner-svn-src-head@freebsd.org Thu Jan 9 18:14:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A00891F579C; Thu, 9 Jan 2020 18:14:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tvQw3kSkz4WP5; Thu, 9 Jan 2020 18:14:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AB835138; Thu, 9 Jan 2020 18:14:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009IEm50073513; Thu, 9 Jan 2020 18:14:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009IEmgS073512; Thu, 9 Jan 2020 18:14:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001091814.009IEmgS073512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jan 2020 18:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356560 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 18:14:48 -0000 Author: imp Date: Thu Jan 9 18:14:48 2020 New Revision: 356560 URL: https://svnweb.freebsd.org/changeset/base/356560 Log: Add note to remind me there are three choices for arm32 floating point. hard use floating point hardware, pass registers to functions in floating point registers. softfp use floating point hardware, but pass registers to functions in integer registers. soft do floating point calcuations without using floating point hardware. Pass arguments in integer registers. FreeBSD 11 and newer assumes hard. 10 and earlier assumed softfp. We have no real support, at the moment, for soft. It's untested, though, if softfp still works. Add a note here since this is a whack-a-doodle combination relative to all other platforms. softfp is likely to go away in the future because it was retained for people using FreeBSD 10 + armv6 needing to transition more slowly from softfp -> hard than the project. It likely is no longer needed, and may be getting in the way of people needing 'soft' support. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Jan 9 17:21:00 2020 (r356559) +++ head/share/mk/bsd.cpu.mk Thu Jan 9 18:14:48 2020 (r356560) @@ -355,7 +355,11 @@ MACHINE_CPU += softfp # to force that. .if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI -# not a nice optimization. +# not a nice optimization. Please note: softfp ABI uses hardware floating +# instructions, but passes arguments to function calls in integer regsiters. +# -mfloat-abi=soft is full software floating point, but is not currently +# supported. softfp support in FreeBSD may disappear in FreeBSD 13.0 since +# it was a transition tool from FreeBSD 10 to 11 and is a bit of an odd duck. CFLAGS += -mfloat-abi=softfp .endif .endif From owner-svn-src-head@freebsd.org Thu Jan 9 18:29:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3A641F5BDB; Thu, 9 Jan 2020 18:29:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tvmR5kHKz4X2K; Thu, 9 Jan 2020 18:29:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFB585316; Thu, 9 Jan 2020 18:29:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009ITx7O079751; Thu, 9 Jan 2020 18:29:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009ITx8l079750; Thu, 9 Jan 2020 18:29:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001091829.009ITx8l079750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 Jan 2020 18:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356561 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 356561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 18:30:00 -0000 Author: jhb Date: Thu Jan 9 18:29:59 2020 New Revision: 356561 URL: https://svnweb.freebsd.org/changeset/base/356561 Log: Add stricter checking on mac key lengths. Negative lengths are always invalid. The key length should also be zero for hash algorithms that do not accept a key. admbugs: 949 Reported by: Yuval Kanarenstein Reviewed by: cem MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D23094 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Jan 9 18:14:48 2020 (r356560) +++ head/sys/opencrypto/cryptodev.c Thu Jan 9 18:29:59 2020 (r356561) @@ -585,8 +585,8 @@ cryptof_ioctl( if (thash) { cria.cri_alg = thash->type; cria.cri_klen = sop->mackeylen * 8; - if (thash->keysize != 0 && - sop->mackeylen > thash->keysize) { + if (sop->mackeylen > thash->keysize || + sop->mackeylen < 0) { CRYPTDEB("invalid mac key length"); error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, From owner-svn-src-head@freebsd.org Thu Jan 9 19:13:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F3711F6885; Thu, 9 Jan 2020 19:13: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 47twkG04M9z4Z4J; Thu, 9 Jan 2020 19:13: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 F1DBF5D0E; Thu, 9 Jan 2020 19:13: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 009JD9ac010519; Thu, 9 Jan 2020 19:13:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009JD9Wf010518; Thu, 9 Jan 2020 19:13:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001091913.009JD9Wf010518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 19:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356562 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 356562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 19:13:10 -0000 Author: kevans Date: Thu Jan 9 19:13:09 2020 New Revision: 356562 URL: https://svnweb.freebsd.org/changeset/base/356562 Log: bcm2835_vcbus: hide 'checking root' messages under bootverbose Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Thu Jan 9 18:29:59 2020 (r356561) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Thu Jan 9 19:13:09 2020 (r356562) @@ -219,8 +219,9 @@ bcm283x_get_current_memcfg(void) root = OF_finddevice("/"); for (i = 0; i < nitems(bcm283x_memory_configs); ++i) { booted_soc_memcfg = &bcm283x_memory_configs[i]; - printf("Checking root against %s\n", - booted_soc_memcfg->soc_compat); + if (bootverbose) + printf("Checking root against %s\n", + booted_soc_memcfg->soc_compat); if (ofw_bus_node_is_compatible(root, booted_soc_memcfg->soc_compat)) return (booted_soc_memcfg); From owner-svn-src-head@freebsd.org Thu Jan 9 19:17:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 948381F6954; Thu, 9 Jan 2020 19:17:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47twqW3K83z4ZDb; Thu, 9 Jan 2020 19:17:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684AB5D17; Thu, 9 Jan 2020 19:17:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009JHh2v011388; Thu, 9 Jan 2020 19:17:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009JHhtl011387; Thu, 9 Jan 2020 19:17:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001091917.009JHhtl011387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jan 2020 19:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356563 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 19:17:43 -0000 Author: markj Date: Thu Jan 9 19:17:42 2020 New Revision: 356563 URL: https://svnweb.freebsd.org/changeset/base/356563 Log: UMA: Don't destroy zones after the system shutdown process starts. Some kernel subsystems, notably ZFS, will destroy UMA zones from a shutdown eventhandler. This causes the zone to be drained. For slabs that are mapped into KVA this can be very expensive and so it needlessly delays the shutdown process. Add a new state to the "booted" variable, BOOT_SHUTDOWN. Once kern_reboot() starts invoking shutdown handlers, turn uma_zdestroy() into a no-op, provided that the zone does not have a custom finalization routine. PR: 242427 Reviewed by: jeff, kib, rlibby MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23066 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 9 19:13:09 2020 (r356562) +++ head/sys/vm/uma_core.c Thu Jan 9 19:17:42 2020 (r356563) @@ -158,8 +158,14 @@ SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD "UMA kernel memory usage"); /* Is the VM done starting up? */ -static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, - BOOT_RUNNING } booted = BOOT_COLD; +static enum { + BOOT_COLD, + BOOT_STRAPPED, + BOOT_PAGEALLOC, + BOOT_BUCKETS, + BOOT_RUNNING, + BOOT_SHUTDOWN, +} booted = BOOT_COLD; /* * This is the handle used to schedule events that need to happen @@ -265,6 +271,7 @@ static int hash_expand(struct uma_hash *, struct uma_h static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); static void uma_startup3(void); +static void uma_shutdown(void); static void *zone_alloc_item(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); static int zone_alloc_limit(uma_zone_t zone, int count, int flags); @@ -1408,8 +1415,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do case BOOT_PAGEALLOC: if (keg->uk_ppera > 1) break; - case BOOT_BUCKETS: - case BOOT_RUNNING: + default: #ifdef UMA_MD_SMALL_ALLOC keg->uk_allocf = (keg->uk_ppera > 1) ? page_alloc : uma_small_alloc; @@ -2337,7 +2343,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) (UMA_ZONE_INHERIT | UMA_ZFLAG_INHERIT)); out: - if (__predict_true(booted == BOOT_RUNNING)) { + if (__predict_true(booted >= BOOT_RUNNING)) { zone_alloc_counters(zone, NULL); zone_alloc_sysctl(zone, NULL); } else { @@ -2465,7 +2471,7 @@ zone_foreach(void (*zfunc)(uma_zone_t, void *arg), voi * threaded, so locking isn't needed. Startup functions * are allowed to use M_WAITOK. */ - if (__predict_true(booted == BOOT_RUNNING)) + if (__predict_true(booted >= BOOT_RUNNING)) rw_rlock(&uma_rwlock); LIST_FOREACH(keg, &uma_kegs, uk_link) { LIST_FOREACH(zone, &keg->uk_zones, uz_link) @@ -2473,7 +2479,7 @@ zone_foreach(void (*zfunc)(uma_zone_t, void *arg), voi } LIST_FOREACH(zone, &uma_cachezones, uz_link) zfunc(zone, arg); - if (__predict_true(booted == BOOT_RUNNING)) + if (__predict_true(booted >= BOOT_RUNNING)) rw_runlock(&uma_rwlock); } @@ -2635,10 +2641,6 @@ uma_startup2(void) bucket_enable(); } -/* - * Initialize our callout handle - * - */ static void uma_startup3(void) { @@ -2653,8 +2655,18 @@ uma_startup3(void) callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); booted = BOOT_RUNNING; + + EVENTHANDLER_REGISTER(shutdown_post_sync, uma_shutdown, NULL, + EVENTHANDLER_PRI_FIRST); } +static void +uma_shutdown(void) +{ + + booted = BOOT_SHUTDOWN; +} + static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags) @@ -2796,6 +2808,13 @@ void uma_zdestroy(uma_zone_t zone) { + /* + * Large slabs are expensive to reclaim, so don't bother doing + * unnecessary work if we're shutting down. + */ + if (booted == BOOT_SHUTDOWN && + zone->uz_fini == NULL && zone->uz_release == zone_release) + return; sx_slock(&uma_reclaim_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); sx_sunlock(&uma_reclaim_lock); From owner-svn-src-head@freebsd.org Thu Jan 9 19:22:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75B981F6D3C; Thu, 9 Jan 2020 19:22:12 +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 47twwh2TRKz4ZnR; Thu, 9 Jan 2020 19:22:12 +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 36B345EE9; Thu, 9 Jan 2020 19:22:12 +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 009JMCZs017316; Thu, 9 Jan 2020 19:22:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009JMCNq017315; Thu, 9 Jan 2020 19:22:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001091922.009JMCNq017315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Jan 2020 19:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356564 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 356564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 19:22:12 -0000 Author: kevans Date: Thu Jan 9 19:22:11 2020 New Revision: 356564 URL: https://svnweb.freebsd.org/changeset/base/356564 Log: dwc_otg: fix fdt attachment for newer bcm2708-usb nodes The newer versions of RPi FDT flipped the order of the interrupts specification and added an 'interrupt-names' property for driver aide in finding the correct interrupt, rather than assuming the positions. Use it if it's available, or fallback to the old method if there is no interrupt-names property with a usb value. This has been tested with both old RPi3B FDT and new RPi3B FDT, USB again works on the latter. Reported by: Tom Yan MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Thu Jan 9 19:17:42 2020 (r356563) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Thu Jan 9 19:22:11 2020 (r356564) @@ -80,6 +80,20 @@ dwc_otg_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +dwc_otg_irq_index(device_t dev, int *rid) +{ + int idx, rv; + phandle_t node; + + node = ofw_bus_get_node(dev); + rv = ofw_bus_find_string_index(node, "interrupt-names", "usb", &idx); + if (rv != 0) + return (rv); + *rid = idx; + return (0); +} + int dwc_otg_attach(device_t dev) { @@ -130,10 +144,16 @@ dwc_otg_attach(device_t dev) /* - * brcm,bcm2708-usb FDT provides two interrupts, - * we need only second one (VC_USB) + * brcm,bcm2708-usb FDT provides two interrupts, we need only the USB + * interrupt (VC_USB). The latest FDT for it provides an + * interrupt-names property and swapped them around, while older ones + * did not have interrupt-names and put the usb interrupt in the second + * position. We'll attempt to use interrupt-names first with a fallback + * to the old method of assuming the index based on the compatible + * string. */ - rid = ofw_bus_is_compatible(dev, "brcm,bcm2708-usb") ? 1 : 0; + if (dwc_otg_irq_index(dev, &rid) != 0) + rid = ofw_bus_is_compatible(dev, "brcm,bcm2708-usb") ? 1 : 0; sc->sc_otg.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_otg.sc_irq_res == NULL) From owner-svn-src-head@freebsd.org Thu Jan 9 20:07:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 779371F7C4A; Thu, 9 Jan 2020 20:07:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47txx72g9bz4dDK; Thu, 9 Jan 2020 20:07:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E40566E0; Thu, 9 Jan 2020 20:07:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009K7dPU044698; Thu, 9 Jan 2020 20:07:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009K7cGX044695; Thu, 9 Jan 2020 20:07:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202001092007.009K7cGX044695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 9 Jan 2020 20:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356567 - in head/share: examples/etc mk X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/share: examples/etc mk X-SVN-Commit-Revision: 356567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 20:07:39 -0000 Author: jkim Date: Thu Jan 9 20:07:38 2020 New Revision: 356567 URL: https://svnweb.freebsd.org/changeset/base/356567 Log: Catch up with Clang 9.0. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Thu Jan 9 19:58:05 2020 (r356566) +++ head/share/examples/etc/make.conf Thu Jan 9 20:07:38 2020 (r356567) @@ -44,11 +44,13 @@ # if omitted), ultrasparc3 # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): -# (AMD CPUs) znver1, bdver4, bdver3, bdver2, bdver1, btver2, btver1 -# (Intel CPUs) cascadelake, tremont, goldmont-plus, icelake-server, -# icelake-client, cannonlake, knm, skylake-avx512, knl, -# goldmont, skylake, broadwell, haswell, ivybridge, -# sandybridge, westmere, nehalem, silvermont, bonnell +# (AMD CPUs) znver2, znver1, bdver4, bdver3, bdver2, bdver1, +# btver2, btver1 +# (Intel CPUs) cooperlake, cascadelake, tremont, goldmont-plus, +# icelake-server, icelake-client, cannonlake, knm, +# skylake-avx512, knl, goldmont, skylake, broadwell, +# haswell, ivybridge, sandybridge, westmere, nehalem, +# silvermont, bonnell # ARM architecture: armv5, armv5te, armv6, armv6t2, arm1176jzf-s, armv7, # armv7-a, armv7ve, generic-armv7-a, cortex-a5, # cortex-a7, cortex-a8, cortex-a9, cortex-a12, Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Jan 9 19:58:05 2020 (r356566) +++ head/share/mk/bsd.cpu.mk Thu Jan 9 20:07:38 2020 (r356567) @@ -170,7 +170,7 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} ########## i386 . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "znver1" +. if ${CPUTYPE} == "znver2" || ${CPUTYPE} == "znver1" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -199,10 +199,10 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "cascadelake" || ${CPUTYPE} == "icelake-server" || \ - ${CPUTYPE} == "icelake-client" || ${CPUTYPE} == "cannonlake" || \ - ${CPUTYPE} == "knm" || ${CPUTYPE} == "skylake-avx512" || \ - ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cooperlake" || ${CPUTYPE} == "cascadelake" || \ + ${CPUTYPE} == "icelake-server" || ${CPUTYPE} == "icelake-client" || \ + ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ ${CPUTYPE} == "haswell" @@ -246,7 +246,7 @@ MACHINE_CPU = mmx MACHINE_CPU += i486 ########## amd64 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "znver1" +. if ${CPUTYPE} == "znver2" || ${CPUTYPE} == "znver1" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 @@ -265,10 +265,10 @@ MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "cascadelake" || ${CPUTYPE} == "icelake-server" || \ - ${CPUTYPE} == "icelake-client" || ${CPUTYPE} == "cannonlake" || \ - ${CPUTYPE} == "knm" || ${CPUTYPE} == "skylake-avx512" || \ - ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cooperlake" || ${CPUTYPE} == "cascadelake" || \ + ${CPUTYPE} == "icelake-server" || ${CPUTYPE} == "icelake-client" || \ + ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ ${CPUTYPE} == "haswell" From owner-svn-src-head@freebsd.org Thu Jan 9 20:49:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E5821F8986; Thu, 9 Jan 2020 20:49:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tysM000yz4gFF; Thu, 9 Jan 2020 20:49:26 +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 EEE3F6E61; Thu, 9 Jan 2020 20:49:26 +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 009KnQNJ069030; Thu, 9 Jan 2020 20:49:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009KnQPE069028; Thu, 9 Jan 2020 20:49:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001092049.009KnQPE069028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jan 2020 20:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356569 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 356569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 20:49:27 -0000 Author: markj Date: Thu Jan 9 20:49:26 2020 New Revision: 356569 URL: https://svnweb.freebsd.org/changeset/base/356569 Log: libc: Fix a few bugs in the xlocale collation code. - Fix checks for mmap() failures. [1] - Set the "map" and "maplen" fields of struct xlocale_collate so that the table destructor actually does something. - Free an already-mapped collation file before loading a new one into the global table. - Harmonize the prototype and definition of __collate_load_tables_l() by adding the "static" qualifier to the latter. PR: 243195 Reported by: cem [1] Reviewed by: cem, yuripv MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23109 Modified: head/lib/libc/locale/collate.c head/lib/libc/locale/rune.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Thu Jan 9 20:45:01 2020 (r356568) +++ head/lib/libc/locale/collate.c Thu Jan 9 20:49:26 2020 (r356569) @@ -109,7 +109,7 @@ __collate_load_tables(const char *encoding) return (__collate_load_tables_l(encoding, &__xlocale_global_collate)); } -int +static int __collate_load_tables_l(const char *encoding, struct xlocale_collate *table) { int i, chains, z; @@ -147,7 +147,7 @@ __collate_load_tables_l(const char *encoding, struct x } map = mmap(NULL, sbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); (void) _close(fd); - if ((TMP = map) == NULL) { + if ((TMP = map) == MAP_FAILED) { return (_LDP_ERROR); } @@ -181,6 +181,11 @@ __collate_load_tables_l(const char *encoding, struct x return (_LDP_ERROR); } + if (table->map && (table->maplen > 0)) { + (void) munmap(table->map, table->maplen); + } + table->map = map; + table->maplen = sbuf.st_size; table->info = info; table->char_pri_table = (void *)TMP; TMP += sizeof (collate_char_t) * (UCHAR_MAX + 1); Modified: head/lib/libc/locale/rune.c ============================================================================== --- head/lib/libc/locale/rune.c Thu Jan 9 20:45:01 2020 (r356568) +++ head/lib/libc/locale/rune.c Thu Jan 9 20:49:26 2020 (r356569) @@ -94,7 +94,7 @@ _Read_RuneMagi(const char *fname) fdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); (void) _close(fd); - if (fdata == NULL) { + if (fdata == MAP_FAILED) { errno = EINVAL; return (NULL); } From owner-svn-src-head@freebsd.org Thu Jan 9 20:59:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C33B61F8DE2; Thu, 9 Jan 2020 20:59:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 47tz5K4qNsz3CV1; Thu, 9 Jan 2020 20:59:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id n16so7127839oie.12; Thu, 09 Jan 2020 12:59:49 -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=WrZSmRrHSOD+Bl1ECm1SPgiK+hWWSZtzhUvLFsjv5rI=; b=DwvSimgHk91mopcph74w9eyULsoQ8yH4ZlkznC4meYOhH0uSkqzOlDcqhPS+cwB9qj A0nM96VA7YicKDuN/dfAB9j488amVg2k3zC6HvvD3pWXpE30IEZ0QeZ8RYv1sRl6FmmW teQRcLlL0+JzwW37jn6XM4AHeEsDxYT275ivhdg9j+dl1DtQrwbEOWAtLH8KDKGb4ZWZ DbwV2tcm8idzYlUuHz11XJWz2w4XSA+P6EY5CutilqQW0JDjHbf3PIaxCYgf1UGXC+56 Y7uXwjzaV64G1BWwueHMIxXH7zDPHmKMbPDHaiqsWgVyD9WIxp+9wHTHmVsr7jCvIYwN EFhg== X-Gm-Message-State: APjAAAWouveWL8M/e9JKYyWoIcbhUtjm3vGnqI13/MxWz3a5o8rsX3++ mPw7iKlxWES/qKZ3rn3VeQbHUbp0 X-Google-Smtp-Source: APXvYqyrL7VYB7YVM5KzkBue94+0BVt+RU23bnGXidIIQkGUChwd1udB9Mxx3N1ghfzGetOQKGjcXw== X-Received: by 2002:aca:4c15:: with SMTP id z21mr4562455oia.8.1578603588268; Thu, 09 Jan 2020 12:59:48 -0800 (PST) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com. [209.85.210.50]) by smtp.gmail.com with ESMTPSA id i3sm2829246otr.31.2020.01.09.12.59.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2020 12:59:47 -0800 (PST) Received: by mail-ot1-f50.google.com with SMTP id i15so8700505oto.2; Thu, 09 Jan 2020 12:59:47 -0800 (PST) X-Received: by 2002:a05:6830:13d3:: with SMTP id e19mr10163855otq.135.1578603587783; Thu, 09 Jan 2020 12:59:47 -0800 (PST) MIME-Version: 1.0 References: <202001092049.009KnQPE069028@repo.freebsd.org> In-Reply-To: <202001092049.009KnQPE069028@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 9 Jan 2020 12:59:37 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r356569 - head/lib/libc/locale To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47tz5K4qNsz3CV1 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)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 20:59:49 -0000 On Thu, Jan 9, 2020 at 12:49 Mark Johnston wrote: > Author: markj > Date: Thu Jan 9 20:49:26 2020 > New Revision: 356569 > URL: https://svnweb.freebsd.org/changeset/base/356569 > > Log: > libc: Fix a few bugs in the xlocale collation code. > > - Fix checks for mmap() failures. [1] > - Set the "map" and "maplen" fields of struct xlocale_collate so that > the table destructor actually does something. > - Free an already-mapped collation file before loading a new one into > the global table. > - Harmonize the prototype and definition of __collate_load_tables_l() by > adding the "static" qualifier to the latter. > > PR: 243195 > Reported by: cem [1] I appreciate the mention for my small role in this but the majority of the credit (PR report and solid initial diagnosis) should go to Koichi Murase . Best, Conrad From owner-svn-src-head@freebsd.org Thu Jan 9 21:21:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D08441F9641; Thu, 9 Jan 2020 21:21:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tzYw5GSmz3DvR; Thu, 9 Jan 2020 21:21:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B01757471; Thu, 9 Jan 2020 21:21:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009LL80a090265; Thu, 9 Jan 2020 21:21:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009LL8WQ090264; Thu, 9 Jan 2020 21:21:08 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202001092121.009LL8WQ090264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 9 Jan 2020 21:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356570 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 356570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 21:21:08 -0000 Author: tsoome Date: Thu Jan 9 21:21:08 2020 New Revision: 356570 URL: https://svnweb.freebsd.org/changeset/base/356570 Log: loader: bioscd probe can get sector size 0 With buggy BIOS, it may happen we get sector size reported 0 for cd, and then the default 512 is used, which is quite wrong. PR: 238749 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Thu Jan 9 20:49:26 2020 (r356569) +++ head/stand/i386/libi386/biosdisk.c Thu Jan 9 21:21:08 2020 (r356570) @@ -396,7 +396,8 @@ bc_add(int biosdev) return (-1); bd->bd_flags = BD_CDROM; - bd->bd_unit = biosdev; + bd->bd_unit = biosdev; + bd->bd_sectorsize = 2048; /* * Ignore result from bd_int13probe(), we will use local @@ -564,7 +565,8 @@ bd_int13probe(bdinfo_t *bd) bd->bd_flags |= BD_MODEEDD3; /* Default sector size */ - bd->bd_sectorsize = BIOSDISK_SECSIZE; + if (bd->bd_sectorsize == 0) + bd->bd_sectorsize = BIOSDISK_SECSIZE; /* * Test if the floppy device is present, so we can avoid receiving From owner-svn-src-head@freebsd.org Thu Jan 9 22:51:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EDCC1FBFF5; Thu, 9 Jan 2020 22:51:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47v1ZK3Klvz3M4X; Thu, 9 Jan 2020 22:51:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D25C86A2; Thu, 9 Jan 2020 22:51:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 009MpbQ2046362; Thu, 9 Jan 2020 22:51:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 009MpbIM046361; Thu, 9 Jan 2020 22:51:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202001092251.009MpbIM046361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 9 Jan 2020 22:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356574 - head/sys/cddl/dev/dtrace/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/arm X-SVN-Commit-Revision: 356574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 22:51:37 -0000 Author: ian Date: Thu Jan 9 22:51:37 2020 New Revision: 356574 URL: https://svnweb.freebsd.org/changeset/base/356574 Log: Remove scary-looking printf output that happens when you kldload dtrace on arm. Replace it with a comment block explaining why the function is empty on 32-bit arm. Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Jan 9 21:50:15 2020 (r356573) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Jan 9 22:51:37 2020 (r356574) @@ -123,7 +123,18 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap void dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) { - printf("IMPLEMENT ME: dtrace_toxic_ranges\n"); + + /* + * There are no ranges to exclude that are common to all 32-bit arm + * platforms. This function only needs to exclude ranges "... in + * which it is impossible to recover from such a load after it has been + * attempted." -- i.e., accessing within the range causes some sort + * fault in the system which is not handled by the normal arm + * exception-handling mechanisms. If systems exist where that is the + * case, a method to handle this functionality would have to be added to + * the platform_if interface so that those systems could provide their + * specific toxic range(s). + */ } void From owner-svn-src-head@freebsd.org Fri Jan 10 01:24:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D68141FEF64; Fri, 10 Jan 2020 01:24:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47v4z55GnBz40f6; Fri, 10 Jan 2020 01:24:49 +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 ABF47A40D; Fri, 10 Jan 2020 01:24:49 +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 00A1Ona4040988; Fri, 10 Jan 2020 01:24:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A1OnkW040987; Fri, 10 Jan 2020 01:24:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001100124.00A1OnkW040987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Jan 2020 01:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356590 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 356590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 01:24:49 -0000 Author: jhibbits Date: Fri Jan 10 01:24:49 2020 New Revision: 356590 URL: https://svnweb.freebsd.org/changeset/base/356590 Log: powerpc/powernv: Un-Giant-ify opal_nvram driver It may be possible to make this completely lock free, but for now it's using a statically allocated bounce buffer in the softc, so it needs to be guarded. Modified: head/sys/powerpc/powernv/opal_nvram.c Modified: head/sys/powerpc/powernv/opal_nvram.c ============================================================================== --- head/sys/powerpc/powernv/opal_nvram.c Fri Jan 10 00:55:37 2020 (r356589) +++ head/sys/powerpc/powernv/opal_nvram.c Fri Jan 10 01:24:49 2020 (r356590) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -56,6 +57,7 @@ struct opal_nvram_softc { device_t sc_dev; + struct mtx sc_mtx; uint32_t sc_size; uint8_t *sc_buf; vm_paddr_t sc_buf_phys; @@ -64,6 +66,9 @@ struct opal_nvram_softc { int sc_isopen; }; +#define NVRAM_LOCK(sc) mtx_lock(&sc->sc_mtx) +#define NVRAM_UNLOCK(sc) mtx_unlock(&sc->sc_mtx) + /* * Device interface. */ @@ -105,7 +110,6 @@ static d_ioctl_t opal_nvram_ioctl; static struct cdevsw opal_nvram_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = opal_nvram_open, .d_close = opal_nvram_close, .d_read = opal_nvram_read, @@ -153,6 +157,8 @@ opal_nvram_attach(device_t dev) sc->sc_cdev = make_dev(&opal_nvram_cdevsw, 0, 0, 0, 0600, "nvram"); sc->sc_cdev->si_drv1 = sc; + + mtx_init(&sc->sc_mtx, "opal_nvram", 0, MTX_DEF); return (0); } @@ -168,6 +174,8 @@ opal_nvram_detach(device_t dev) destroy_dev(sc->sc_cdev); if (sc->sc_buf != NULL) contigfree(sc->sc_buf, NVRAM_BUFSIZE, M_DEVBUF); + + mtx_destroy(&sc->sc_mtx); return (0); } @@ -176,11 +184,18 @@ static int opal_nvram_open(struct cdev *dev, int flags, int fmt, struct thread *td) { struct opal_nvram_softc *sc = dev->si_drv1; + int err; + err = 0; + + NVRAM_LOCK(sc); if (sc->sc_isopen) - return EBUSY; - sc->sc_isopen = 1; - return (0); + err = EBUSY; + else + sc->sc_isopen = 1; + NVRAM_UNLOCK(sc); + + return (err); } static int @@ -188,7 +203,10 @@ opal_nvram_close(struct cdev *dev, int fflag, int devt { struct opal_nvram_softc *sc = dev->si_drv1; + NVRAM_LOCK(sc); sc->sc_isopen = 0; + NVRAM_UNLOCK(sc); + return (0); } @@ -199,6 +217,8 @@ opal_nvram_read(struct cdev *dev, struct uio *uio, int int rv, amnt; rv = 0; + + NVRAM_LOCK(sc); while (uio->uio_resid > 0) { amnt = MIN(uio->uio_resid, sc->sc_size - uio->uio_offset); amnt = MIN(amnt, NVRAM_BUFSIZE); @@ -222,6 +242,8 @@ opal_nvram_read(struct cdev *dev, struct uio *uio, int if (rv != 0) break; } + NVRAM_UNLOCK(sc); + return (rv); } @@ -233,6 +255,8 @@ opal_nvram_write(struct cdev *dev, struct uio *uio, in struct opal_nvram_softc *sc = dev->si_drv1; rv = 0; + + NVRAM_LOCK(sc); while (uio->uio_resid > 0) { amnt = MIN(uio->uio_resid, sc->sc_size - uio->uio_offset); amnt = MIN(amnt, NVRAM_BUFSIZE); @@ -258,6 +282,9 @@ opal_nvram_write(struct cdev *dev, struct uio *uio, in break; } } + + NVRAM_UNLOCK(sc); + return (rv); } From owner-svn-src-head@freebsd.org Fri Jan 10 03:16:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74A7B221F6E; Fri, 10 Jan 2020 03:16:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47v7S92TnQz45K3; Fri, 10 Jan 2020 03:16:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 507F7B83A; Fri, 10 Jan 2020 03:16:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00A3Gfgn008215; Fri, 10 Jan 2020 03:16:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A3GfIV008214; Fri, 10 Jan 2020 03:16:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001100316.00A3GfIV008214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Jan 2020 03:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356591 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 356591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 03:16:41 -0000 Author: jhibbits Date: Fri Jan 10 03:16:40 2020 New Revision: 356591 URL: https://svnweb.freebsd.org/changeset/base/356591 Log: powerpc: Mark cpu_feature-based sysctls as MP_SAFE hw.floatingpoint and hw.altivec are effectively runtime constants (bits from the cpu_feature bitfield), so don't need Giant, or any locking for that matter. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Fri Jan 10 01:24:49 2020 (r356590) +++ head/sys/powerpc/powerpc/cpu.c Fri Jan 10 03:16:40 2020 (r356591) @@ -259,10 +259,10 @@ register_t lpcr = LPCR_LPES; #endif /* Provide some user-friendly aliases for bits in cpu_features */ -SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, CTLTYPE_INT | CTLFLAG_RD, - 0, PPC_FEATURE_HAS_FPU, cpu_feature_bit, "I", - "Floating point instructions executed in hardware"); -SYSCTL_PROC(_hw, OID_AUTO, altivec, CTLTYPE_INT | CTLFLAG_RD, +SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, PPC_FEATURE_HAS_FPU, + cpu_feature_bit, "I", "Floating point instructions executed in hardware"); +SYSCTL_PROC(_hw, OID_AUTO, altivec, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, PPC_FEATURE_HAS_ALTIVEC, cpu_feature_bit, "I", "CPU supports Altivec"); /* From owner-svn-src-head@freebsd.org Fri Jan 10 03:17:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0A47221FE4; Fri, 10 Jan 2020 03:17:28 +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 47v7T457nGz45Rq; Fri, 10 Jan 2020 03:17:28 +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 AB0A2B83C; Fri, 10 Jan 2020 03:17:28 +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 00A3HSxu008303; Fri, 10 Jan 2020 03:17:28 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A3HSNC008302; Fri, 10 Jan 2020 03:17:28 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202001100317.00A3HSNC008302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 10 Jan 2020 03:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356592 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 356592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 03:17:28 -0000 Author: mhorne Date: Fri Jan 10 03:17:28 2020 New Revision: 356592 URL: https://svnweb.freebsd.org/changeset/base/356592 Log: Replace inline assembly with rdtime macro This macro is used elsewhere and is slightly cleaner. NFC. Modified: head/sys/riscv/riscv/timer.c Modified: head/sys/riscv/riscv/timer.c ============================================================================== --- head/sys/riscv/riscv/timer.c Fri Jan 10 03:16:40 2020 (r356591) +++ head/sys/riscv/riscv/timer.c Fri Jan 10 03:17:28 2020 (r356592) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,11 +92,8 @@ static struct timecounter riscv_timer_timecount = { static inline uint64_t get_cycles(void) { - uint64_t cycles; - __asm __volatile("rdtime %0" : "=r" (cycles)); - - return (cycles); + return (rdtime()); } static long From owner-svn-src-head@freebsd.org Fri Jan 10 04:13:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A1C2232D6; Fri, 10 Jan 2020 04:13:17 +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 47v8jT24lbz48Xy; Fri, 10 Jan 2020 04:13:17 +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 4216DC549; Fri, 10 Jan 2020 04:13:17 +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 00A4DHRA044055; Fri, 10 Jan 2020 04:13:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A4DH8Q044054; Fri, 10 Jan 2020 04:13:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001100413.00A4DH8Q044054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Jan 2020 04:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356595 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 356595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 04:13:17 -0000 Author: jhibbits Date: Fri Jan 10 04:13:16 2020 New Revision: 356595 URL: https://svnweb.freebsd.org/changeset/base/356595 Log: powerpc: Prevent infinite loop in moea_sync_icache() This applies r344049 to the 32-bit pmap. Reported by: Mark Millard Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Jan 10 03:46:58 2020 (r356594) +++ head/sys/powerpc/aim/mmu_oea.c Fri Jan 10 04:13:16 2020 (r356595) @@ -2684,7 +2684,7 @@ moea_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, PMAP_LOCK(pm); while (sz > 0) { - lim = round_page(va); + lim = round_page(va + 1); len = MIN(lim - va, sz); pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); if (pvo != NULL) { From owner-svn-src-head@freebsd.org Fri Jan 10 08:54:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EE2D1E086B; Fri, 10 Jan 2020 08:54:47 +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 47vGyH14rsz4MPN; Fri, 10 Jan 2020 08:54:47 +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 094BEF8A6; Fri, 10 Jan 2020 08:54:47 +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 00A8skfA009960; Fri, 10 Jan 2020 08:54:46 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A8skK6009959; Fri, 10 Jan 2020 08:54:46 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001100854.00A8skK6009959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 10 Jan 2020 08:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356596 - head/tests/sys/net/routing X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/tests/sys/net/routing X-SVN-Commit-Revision: 356596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 08:54:47 -0000 Author: melifaro Date: Fri Jan 10 08:54:46 2020 New Revision: 356596 URL: https://svnweb.freebsd.org/changeset/base/356596 Log: Include human-readable list of rtm flags along with bitmask in error messages for rtsock tests. MFC after: 2 weeks Modified: head/tests/sys/net/routing/rtsock_print.h head/tests/sys/net/routing/test_rtsock_l3.c Modified: head/tests/sys/net/routing/rtsock_print.h ============================================================================== --- head/tests/sys/net/routing/rtsock_print.h Fri Jan 10 04:13:16 2020 (r356595) +++ head/tests/sys/net/routing/rtsock_print.h Fri Jan 10 08:54:46 2020 (r356596) @@ -132,7 +132,15 @@ rtsock_print_cmdtype(int cmd) return (msgtypes[cmd]); } +char * +rtsock_print_rtm_flags(char *buf, int buflen, int rtm_flags) +{ + _printb(buf, buflen, rtm_flags, routeflags); + return (buf); +} + + #define _PRINTX(fmt, ...) do { \ one_len = snprintf(ptr, rem_len, fmt, __VA_ARGS__); \ ptr += one_len; \ @@ -262,7 +270,7 @@ rtsock_print_rtm(struct rt_msghdr *rtm) printf("Got message of size %hu on %s\n", rtm->rtm_msglen, buf); char flags_buf[256]; - _printb(flags_buf, sizeof(flags_buf), rtm->rtm_flags, routeflags); + rtsock_print_rtm_flags(flags_buf, sizeof(flags_buf), rtm->rtm_flags); printf("%s: len %hu, pid: %d, seq %d, errno %d, flags: %s\n", msgtypes[rtm->rtm_type], rtm->rtm_msglen, rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno, flags_buf); Modified: head/tests/sys/net/routing/test_rtsock_l3.c ============================================================================== --- head/tests/sys/net/routing/test_rtsock_l3.c Fri Jan 10 04:13:16 2020 (r356595) +++ head/tests/sys/net/routing/test_rtsock_l3.c Fri Jan 10 08:54:46 2020 (r356596) @@ -196,8 +196,18 @@ verify_route_message_extra(struct rt_msghdr *rtm, int RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_index == ifindex, "expected ifindex %d, got %d", ifindex, rtm->rtm_index); - RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_flags == rtm_flags, - "expected flags: 0x%X, got 0x%X", rtm_flags, rtm->rtm_flags); + if (rtm->rtm_flags != rtm_flags) { + char got_flags[64], expected_flags[64]; + rtsock_print_rtm_flags(got_flags, sizeof(got_flags), + rtm->rtm_flags); + rtsock_print_rtm_flags(expected_flags, sizeof(expected_flags), + rtm_flags); + + RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_flags == rtm_flags, + "expected flags: 0x%X %s, got 0x%X %s", + rtm_flags, expected_flags, + rtm->rtm_flags, got_flags); + } } static void From owner-svn-src-head@freebsd.org Fri Jan 10 09:07:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C69841E11E6; Fri, 10 Jan 2020 09:07:43 +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 47vHFC4v7tz4N7l; Fri, 10 Jan 2020 09:07:43 +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 9E79BFA96; Fri, 10 Jan 2020 09:07:43 +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 00A97hxC016473; Fri, 10 Jan 2020 09:07:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A97h5N016472; Fri, 10 Jan 2020 09:07:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001100907.00A97h5N016472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Jan 2020 09:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356597 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 356597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 09:07:43 -0000 Author: hselasky Date: Fri Jan 10 09:07:43 2020 New Revision: 356597 URL: https://svnweb.freebsd.org/changeset/base/356597 Log: Define the XHCI endpoint states. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Fri Jan 10 08:54:46 2020 (r356596) +++ head/sys/dev/usb/controller/xhci.h Fri Jan 10 09:07:43 2020 (r356597) @@ -115,6 +115,14 @@ struct xhci_endp_ctx { volatile uint32_t dwEpCtx0; #define XHCI_EPCTX_0_EPSTATE_SET(x) ((x) & 0x7) #define XHCI_EPCTX_0_EPSTATE_GET(x) ((x) & 0x7) +#define XHCI_EPCTX_0_EPSTATE_DISABLED 0 +#define XHCI_EPCTX_0_EPSTATE_RUNNING 1 +#define XHCI_EPCTX_0_EPSTATE_HALTED 2 +#define XHCI_EPCTX_0_EPSTATE_STOPPED 3 +#define XHCI_EPCTX_0_EPSTATE_ERROR 4 +#define XHCI_EPCTX_0_EPSTATE_RESERVED_5 5 +#define XHCI_EPCTX_0_EPSTATE_RESERVED_6 6 +#define XHCI_EPCTX_0_EPSTATE_RESERVED_7 7 #define XHCI_EPCTX_0_MULT_SET(x) (((x) & 0x3) << 8) #define XHCI_EPCTX_0_MULT_GET(x) (((x) >> 8) & 0x3) #define XHCI_EPCTX_0_MAXP_STREAMS_SET(x) (((x) & 0x1F) << 10) From owner-svn-src-head@freebsd.org Fri Jan 10 09:32:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A0481E1C45; Fri, 10 Jan 2020 09:32:45 +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 47vHp50MLLz4PQt; Fri, 10 Jan 2020 09:32:45 +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 07BFC18021; Fri, 10 Jan 2020 09:32:45 +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 00A9Wi91033786; Fri, 10 Jan 2020 09:32:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00A9Wis9033785; Fri, 10 Jan 2020 09:32:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001100932.00A9Wis9033785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Jan 2020 09:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356598 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 356598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 09:32:45 -0000 Author: hselasky Date: Fri Jan 10 09:32:44 2020 New Revision: 356598 URL: https://svnweb.freebsd.org/changeset/base/356598 Log: Check the XHCI endpoint state before stopping any endpoint. This avoids getting the XHCI_TRB_ERROR_CONTEXT_STATE error code from the XHCI controller when the endpoint is disabled or already stopped. Suggested by: Shichun.Ma@dell.com MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Jan 10 09:07:43 2020 (r356597) +++ head/sys/dev/usb/controller/xhci.c Fri Jan 10 09:32:44 2020 (r356598) @@ -1598,10 +1598,26 @@ static usb_error_t xhci_cmd_stop_ep(struct xhci_softc *sc, uint8_t suspend, uint8_t ep_id, uint8_t slot_id) { + struct usb_page_search buf_dev; + struct xhci_dev_ctx *pdev; struct xhci_trb trb; uint32_t temp; DPRINTF("\n"); + + usbd_get_page(&sc->sc_hw.devs[slot_id].device_pc, 0, &buf_dev); + pdev = buf_dev.buffer; + usb_pc_cpu_invalidate(&sc->sc_hw.devs[slot_id].device_pc); + + switch (XHCI_EPCTX_0_EPSTATE_GET(pdev->ctx_ep[ep_id - 1].dwEpCtx0)) { + case XHCI_EPCTX_0_EPSTATE_DISABLED: + case XHCI_EPCTX_0_EPSTATE_STOPPED: + DPRINTF("Endpoint %u on slot %u is already stopped\n", + ep_id, slot_id); + return (USB_ERR_NORMAL_COMPLETION); + default: + break; + } trb.qwTrb0 = 0; trb.dwTrb2 = 0; From owner-svn-src-head@freebsd.org Fri Jan 10 14:10:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C9E81E8BAB; Fri, 10 Jan 2020 14:10:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vPy00wn6z4dfZ; Fri, 10 Jan 2020 14:10:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 199E41B2AC; Fri, 10 Jan 2020 14:10:00 +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 00AE9xOo097092; Fri, 10 Jan 2020 14:09:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AE9x2n097091; Fri, 10 Jan 2020 14:09:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001101409.00AE9x2n097091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 14:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356600 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 356600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 14:10:00 -0000 Author: kevans Date: Fri Jan 10 14:09:59 2020 New Revision: 356600 URL: https://svnweb.freebsd.org/changeset/base/356600 Log: a10_ahci: grab the target-supply regulator and enable it This regulator is marked regulator-boot-on, but it will get shutdown if it's not actually used/enabled by a driver. This should fix sata on the cubieboard{1,2}. Reported by: Ray White @ UWaterloo Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D23112 Modified: head/sys/arm/allwinner/a10_ahci.c Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Fri Jan 10 12:20:25 2020 (r356599) +++ head/sys/arm/allwinner/a10_ahci.c Fri Jan 10 14:09:59 2020 (r356600) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * Allwinner a1x/a2x/a8x SATA attachment. This is just the AHCI register @@ -118,6 +119,11 @@ __FBSDID("$FreeBSD$"); #define PLL_FREQ 100000000 +struct ahci_a10_softc { + struct ahci_controller ahci_ctlr; + regulator_t ahci_reg; +}; + static void inline ahci_set(struct resource *m, bus_size_t off, uint32_t set) { @@ -295,10 +301,12 @@ static int ahci_a10_attach(device_t dev) { int error; + struct ahci_a10_softc *sc; struct ahci_controller *ctlr; clk_t clk_pll, clk_gate; - ctlr = device_get_softc(dev); + sc = device_get_softc(dev); + ctlr = &sc->ahci_ctlr; clk_pll = clk_gate = NULL; ctlr->quirks = AHCI_Q_NOPMP; @@ -311,6 +319,19 @@ ahci_a10_attach(device_t dev) &ctlr->r_rid, RF_ACTIVE))) return (ENXIO); + /* Enable the regulator */ + error = regulator_get_by_ofw_property(dev, 0, "target-supply", + &sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Cannot get regulator\n"); + goto fail; + } + error = regulator_enable(sc->ahci_reg); + if (error != 0) { + device_printf(dev, "Could not enable regulator\n"); + goto fail; + } + /* Enable clocks */ error = clk_get_by_ofw_index(dev, 0, 0, &clk_gate); if (error != 0) { @@ -357,6 +378,8 @@ ahci_a10_attach(device_t dev) return (ahci_attach(dev)); fail: + if (sc->ahci_reg != 0) + regulator_disable(sc->ahci_reg); if (clk_gate != NULL) clk_release(clk_gate); if (clk_pll != NULL) @@ -388,7 +411,7 @@ static device_method_t ahci_ata_methods[] = { static driver_t ahci_ata_driver = { "ahci", ahci_ata_methods, - sizeof(struct ahci_controller) + sizeof(struct ahci_a10_softc) }; DRIVER_MODULE(a10_ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); From owner-svn-src-head@freebsd.org Fri Jan 10 14:40:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A75B1E943E; Fri, 10 Jan 2020 14:40:05 +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 47vQcj2DKkz4fxR; Fri, 10 Jan 2020 14:40:05 +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 47B5D1B829; Fri, 10 Jan 2020 14:40:05 +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 00AEe5sa015560; Fri, 10 Jan 2020 14:40:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AEe5f5015559; Fri, 10 Jan 2020 14:40:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001101440.00AEe5f5015559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 14:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356601 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 356601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 14:40:05 -0000 Author: kevans Date: Fri Jan 10 14:40:04 2020 New Revision: 356601 URL: https://svnweb.freebsd.org/changeset/base/356601 Log: inetd: free WITHOUT_INET6_SUPPORT build of warnings If inetd is compiled without inet6 support, we need to error out on rpc+inet6 services rather than attempting to call into rpc bits with an uninitialized netid. v4bind is only used with INET6 support, so move it under the proper #ifdefs with v6bind. Reported by: Pavel Timofeev MFC after: 3 days Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Fri Jan 10 14:09:59 2020 (r356600) +++ head/usr.sbin/inetd/inetd.c Fri Jan 10 14:40:04 2020 (r356601) @@ -1360,6 +1360,15 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (o sock.sin_port = sep->se_ctrladdr6.sin6_port; } } +#else + else { + syslog(LOG_ERR, + "%s/%s: inetd compiled without inet6 support\n", + sep->se_service, sep->se_proto); + (void) close(sep->se_fd); + sep->se_fd = -1; + return; + } #endif if (debug) print_service("REG ", sep); @@ -1611,8 +1620,8 @@ getconfigent(void) #ifdef IPSEC char *policy; #endif - int v4bind; #ifdef INET6 + int v4bind; int v6bind; #endif int i; @@ -1622,8 +1631,8 @@ getconfigent(void) policy = NULL; #endif more: - v4bind = 0; #ifdef INET6 + v4bind = 0; v6bind = 0; #endif while ((cp = nextline(fconfig)) != NULL) { @@ -1787,7 +1796,9 @@ more: #endif if (sep->se_proto[strlen(sep->se_proto) - 1] == '4') { sep->se_proto[strlen(sep->se_proto) - 1] = '\0'; +#ifdef INET6 v4bind = 1; +#endif continue; } /* illegal version num */ From owner-svn-src-head@freebsd.org Fri Jan 10 14:43:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61E471E96E1; Fri, 10 Jan 2020 14:43:58 +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 47vQjB1yvsz4gKv; Fri, 10 Jan 2020 14:43:58 +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 3EBCC1B9E7; Fri, 10 Jan 2020 14:43:58 +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 00AEhwR5020972; Fri, 10 Jan 2020 14:43:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AEhwCm020971; Fri, 10 Jan 2020 14:43:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001101443.00AEhwCm020971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 14:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356602 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 356602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 14:43:58 -0000 Author: kevans Date: Fri Jan 10 14:43:57 2020 New Revision: 356602 URL: https://svnweb.freebsd.org/changeset/base/356602 Log: inetd: two more nits Use __COPYRIGHT for copyright to simply either embed it via .ident or have it properly marked __unused Move an ipsec reference to IPSEC Modified: head/usr.sbin/inetd/inetd.c Modified: head/usr.sbin/inetd/inetd.c ============================================================================== --- head/usr.sbin/inetd/inetd.c Fri Jan 10 14:40:04 2020 (r356601) +++ head/usr.sbin/inetd/inetd.c Fri Jan 10 14:43:57 2020 (r356602) @@ -29,10 +29,12 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1983, 1991, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; +__COPYRIGHT("@(#) Copyright (c) 1983, 1991, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"); #endif /* not lint */ #ifndef lint @@ -41,9 +43,6 @@ static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkele #endif #endif /* not lint */ -#include -__FBSDID("$FreeBSD$"); - /* * Inetd - Internet super-server * @@ -1661,7 +1660,9 @@ more: break; } if (cp == NULL) { +#ifdef IPSEC free(policy); +#endif return (NULL); } From owner-svn-src-head@freebsd.org Fri Jan 10 18:22:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 788421EE8D7; Fri, 10 Jan 2020 18:22:15 +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 47vWY32flKz3Pcw; Fri, 10 Jan 2020 18:22:15 +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 3CA501E23E; Fri, 10 Jan 2020 18:22:15 +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 00AIMFNM049042; Fri, 10 Jan 2020 18:22:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AIMFlM049041; Fri, 10 Jan 2020 18:22:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001101822.00AIMFlM049041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 18:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356603 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 356603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 18:22:15 -0000 Author: kevans Date: Fri Jan 10 18:22:14 2020 New Revision: 356603 URL: https://svnweb.freebsd.org/changeset/base/356603 Log: makesyscalls.lua: generate all files in /tmp, write into place at the end This makes makesyscalls.lua more parallel-friendly, or at least not as hostile to the idea. We get into situations where we're running parallel if we end up with MAKE_JOBS>1 entering any of the sysent targets, since each output file is recognized a distinct build step that needs to be executed. Another commit will add some .ORDER to further improve the situation. Reported by: jhb Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D23098 Modified: head/sys/tools/makesyscalls.lua Modified: head/sys/tools/makesyscalls.lua ============================================================================== --- head/sys/tools/makesyscalls.lua Fri Jan 10 14:43:57 2020 (r356602) +++ head/sys/tools/makesyscalls.lua Fri Jan 10 18:22:14 2020 (r356603) @@ -66,13 +66,13 @@ local config_modified = {} local cleantmp = true local tmpspace = "/tmp/sysent." .. unistd.getpid() .. "/" --- These ones we'll open in place -local config_files_needed = { +local output_files = { "sysnames", "syshdr", "sysmk", "syssw", "systrace", + "sysproto", } -- These ones we'll create temporary files for; generation purposes. @@ -1158,9 +1158,9 @@ for _, v in ipairs(temp_files) do files[v] = io.open(tmpname, "w+") end - -for _, v in ipairs(config_files_needed) do - files[v] = io.open(config[v], "w+") +for _, v in ipairs(output_files) do + local tmpname = tmpspace .. v + files[v] = io.open(tmpname, "w+") end -- Write out all of the preamble bits @@ -1343,18 +1343,28 @@ write_line("systraceret", [[ write_line("syssw", read_file("sysinc")) write_line("syssw", read_file("sysent")) -local fh = io.open(config["sysproto"], "w+") -fh:write(read_file("sysarg")) -fh:write(read_file("sysdcl")) +write_line("sysproto", read_file("sysarg")) +write_line("sysproto", read_file("sysdcl")) for _, v in pairs(compat_options) do - fh:write(read_file(v["tmp"])) - fh:write(read_file(v["dcltmp"])) + write_line("sysproto", read_file(v["tmp"])) + write_line("sysproto", read_file(v["dcltmp"])) end -fh:write(read_file("sysaue")) -fh:write(read_file("sysprotoend")) -fh:close() +write_line("sysproto", read_file("sysaue")) +write_line("sysproto", read_file("sysprotoend")) write_line("systrace", read_file("systracetmp")) write_line("systrace", read_file("systraceret")) + +for _, v in ipairs(output_files) do + local target = config[v] + if target ~= "/dev/null" then + local fh = io.open(target, "w+") + if fh == nil then + abort(1, "Failed to open '" .. target .. "'") + end + fh:write(read_file(v)) + fh:close() + end +end cleanup() From owner-svn-src-head@freebsd.org Fri Jan 10 18:24:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C11041EE993; Fri, 10 Jan 2020 18:24: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 47vWbR4jqyz3PpJ; Fri, 10 Jan 2020 18:24: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 9D0151E25C; Fri, 10 Jan 2020 18:24: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 00AIOJCN052269; Fri, 10 Jan 2020 18:24:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AIOHBZ052259; Fri, 10 Jan 2020 18:24:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001101824.00AIOHBZ052259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 18:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356604 - in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 i386/linux kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm/linux arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 i386/linux kern X-SVN-Commit-Revision: 356604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 18:24:19 -0000 Author: kevans Date: Fri Jan 10 18:24:17 2020 New Revision: 356604 URL: https://svnweb.freebsd.org/changeset/base/356604 Log: Set .ORDER for makesyscalls generated files When either makesyscalls.lua or syscalls.master changes, all of the ${GENERATED} targets are now out-of-date. With make jobs > 1, this means we will run the makesyscalls script in parallel for the same ABI, generating the same set of output files. Prior to r356603 , there is a large window for interlacing output for some of the generated files that we were generating in-place rather than staging in a temp dir. After that, we still should't need to run the script more than once per-ABI as the first invocation should update all of them. Add .ORDER to do so cleanly. Reviewed by: brooks Discussed with: sjg Differential Revision: https://reviews.freebsd.org/D23099 Modified: head/sys/amd64/linux/Makefile head/sys/amd64/linux32/Makefile head/sys/arm/linux/Makefile head/sys/arm64/linux/Makefile head/sys/compat/cloudabi32/Makefile head/sys/compat/cloudabi64/Makefile head/sys/compat/freebsd32/Makefile head/sys/i386/linux/Makefile head/sys/kern/Makefile Modified: head/sys/amd64/linux/Makefile ============================================================================== --- head/sys/amd64/linux/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/amd64/linux/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -19,6 +19,9 @@ GENERATED= linux_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/amd64/linux32/Makefile ============================================================================== --- head/sys/amd64/linux32/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/amd64/linux32/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -19,6 +19,9 @@ GENERATED= linux32_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/arm/linux/Makefile ============================================================================== --- head/sys/arm/linux/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/arm/linux/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -19,6 +19,9 @@ GENERATED= linux_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/arm64/linux/Makefile ============================================================================== --- head/sys/arm64/linux/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/arm64/linux/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -19,6 +19,9 @@ GENERATED= linux_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/compat/cloudabi32/Makefile ============================================================================== --- head/sys/compat/cloudabi32/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/compat/cloudabi32/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -17,6 +17,9 @@ GENERATED= cloudabi32_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/compat/cloudabi64/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -17,6 +17,9 @@ GENERATED= cloudabi64_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/compat/freebsd32/Makefile ============================================================================== --- head/sys/compat/freebsd32/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/compat/freebsd32/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -20,6 +20,9 @@ GENERATED= freebsd32_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/i386/linux/Makefile ============================================================================== --- head/sys/i386/linux/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/i386/linux/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -19,6 +19,9 @@ GENERATED= linux_proto.h \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Fri Jan 10 18:22:14 2020 (r356603) +++ head/sys/kern/Makefile Fri Jan 10 18:24:17 2020 (r356604) @@ -21,6 +21,9 @@ GENERATED= init_sysent.c \ all: @echo "make sysent only" +# We .ORDER these explicitly so that we only run MAKESYSCALLS once, rather than +# potentially once for each ${GENERATED} file. +.ORDER: ${GENERATED} sysent: ${GENERATED} ${GENERATED}: ${MAKESYSCALLS} ${SRCS} From owner-svn-src-head@freebsd.org Fri Jan 10 18:52:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 111561EFEDE; Fri, 10 Jan 2020 18:52:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vXCf6Ztxz3xSg; Fri, 10 Jan 2020 18:52:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD1DE1E7C7; Fri, 10 Jan 2020 18:52:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00AIqEbZ070537; Fri, 10 Jan 2020 18:52:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AIqEIX070535; Fri, 10 Jan 2020 18:52:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001101852.00AIqEIX070535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 10 Jan 2020 18:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356609 - head/sys/dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 356609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 18:52:15 -0000 Author: manu Date: Fri Jan 10 18:52:14 2020 New Revision: 356609 URL: https://svnweb.freebsd.org/changeset/base/356609 Log: twsi: Rework how we handle the i2c messages We use to handle each message separately in i2c_transfer but that cannot work with message with NOSTOP as it confuses the controller that we disable the interrupts and start a new message. Handle every message in the interrupt handler and fire a new start condition if the previous message have NOSTOP, the controller understand this as a repeated start. This fixes booting on Allwinner A10/A20 platform where before the i2c controller used to write 0 to the PMIC register that control the regulators as it though that this was the continuation of the write message. Tested on: A20 BananaPi, Cubieboard 1 (kevans) Reported by: kevans MFC after: 1 month Modified: head/sys/dev/iicbus/twsi/twsi.c head/sys/dev/iicbus/twsi/twsi.h Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Fri Jan 10 18:48:11 2020 (r356608) +++ head/sys/dev/iicbus/twsi/twsi.c Fri Jan 10 18:52:14 2020 (r356609) @@ -481,7 +481,6 @@ static int twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { struct twsi_softc *sc; - int i; sc = device_get_softc(dev); @@ -495,28 +494,25 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint TWSI_WRITE(sc, sc->reg_control, sc->control_val); debugf(dev, "transmitting %d messages\n", nmsgs); debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); - for (i = 0; i < nmsgs && sc->error == 0; i++) { - sc->transfer = 1; - sc->msg = &msgs[i]; - debugf(dev, "msg[%d] flags: %x\n", i, msgs[i].flags); - debugf(dev, "msg[%d] len: %d\n", i, msgs[i].len); + sc->nmsgs = nmsgs; + sc->msgs = msgs; + sc->msg_idx = 0; + sc->transfer = 1; - /* Send start and re-enable interrupts */ - sc->control_val = TWSI_CONTROL_TWSIEN | - TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; - if (sc->msg->len == 1) - sc->control_val &= ~TWSI_CONTROL_ACK; - TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); - while (sc->error == 0 && sc->transfer != 0) { - pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); - } + /* Send start and re-enable interrupts */ + sc->control_val = TWSI_CONTROL_TWSIEN | + TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; + if (sc->msgs[0].len == 1) + sc->control_val &= ~TWSI_CONTROL_ACK; + TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); + while (sc->error == 0 && sc->transfer != 0) { + pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + } + debugf(sc->dev, "pause finish\n"); - debugf(dev, "Done with msg[%d]\n", i); - if (sc->error) { - debugf(sc->dev, "Error, aborting (%d)\n", sc->error); - TWSI_WRITE(sc, sc->reg_control, 0); - goto out; - } + if (sc->error) { + debugf(sc->dev, "Error, aborting (%d)\n", sc->error); + TWSI_WRITE(sc, sc->reg_control, 0); } /* Disable module and interrupts */ @@ -524,7 +520,6 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint TWSI_WRITE(sc, sc->reg_control, 0); debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); -out: return (sc->error); } @@ -537,122 +532,123 @@ twsi_intr(void *arg) sc = arg; - debugf(sc->dev, "Got interrupt\n"); + debugf(sc->dev, "Got interrupt Current msg=%x\n", sc->msg_idx); - while (TWSI_READ(sc, sc->reg_control) & TWSI_CONTROL_IFLG) { - status = TWSI_READ(sc, sc->reg_status); - debugf(sc->dev, "status=%x\n", status); + status = TWSI_READ(sc, sc->reg_status); + debugf(sc->dev, "initial status=%x\n", status); - switch (status) { - case TWSI_STATUS_START: - case TWSI_STATUS_RPTD_START: - /* Transmit the address */ - debugf(sc->dev, "Send the address\n"); + switch (status) { + case TWSI_STATUS_START: + case TWSI_STATUS_RPTD_START: + /* Transmit the address */ + debugf(sc->dev, "Send the address\n"); - if (sc->msg->flags & IIC_M_RD) - TWSI_WRITE(sc, sc->reg_data, - sc->msg->slave | LSB); - else - TWSI_WRITE(sc, sc->reg_data, - sc->msg->slave & ~LSB); + if (sc->msgs[sc->msg_idx].flags & IIC_M_RD) + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].slave | LSB); + else + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].slave & ~LSB); + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_W_ACK: + debugf(sc->dev, "Ack received after transmitting the address (write)\n"); + /* Directly send the first byte */ + sc->sent_bytes = 0; + debugf(sc->dev, "Sending byte 0 = %x\n", sc->msgs[sc->msg_idx].buf[0]); + TWSI_WRITE(sc, sc->reg_data, sc->msgs[sc->msg_idx].buf[0]); - case TWSI_STATUS_ADDR_W_ACK: - debugf(sc->dev, "Ack received after transmitting the address\n"); - /* Directly send the first byte */ - sc->sent_bytes = 0; - debugf(sc->dev, "Sending byte 0 = %x\n", sc->msg->buf[0]); - TWSI_WRITE(sc, sc->reg_data, sc->msg->buf[0]); + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_R_ACK: + debugf(sc->dev, "Ack received after transmitting the address (read)\n"); + sc->recv_bytes = 0; - case TWSI_STATUS_ADDR_R_ACK: - debugf(sc->dev, "Ack received after transmitting the address\n"); - sc->recv_bytes = 0; + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + case TWSI_STATUS_ADDR_W_NACK: + case TWSI_STATUS_ADDR_R_NACK: + debugf(sc->dev, "No ack received after transmitting the address\n"); + sc->transfer = 0; + sc->error = ETIMEDOUT; + sc->control_val = 0; + wakeup(sc); + break; - case TWSI_STATUS_ADDR_W_NACK: - case TWSI_STATUS_ADDR_R_NACK: - debugf(sc->dev, "No ack received after transmitting the address\n"); - sc->transfer = 0; - sc->error = ETIMEDOUT; - sc->control_val = 0; - wakeup(sc); - break; - - case TWSI_STATUS_DATA_WR_ACK: - debugf(sc->dev, "Ack received after transmitting data\n"); - if (sc->sent_bytes++ == (sc->msg->len - 1)) { - debugf(sc->dev, "Done sending all the bytes\n"); - /* Send stop, no interrupts on stop */ - if (!(sc->msg->flags & IIC_M_NOSTOP)) { - debugf(sc->dev, "Done TX data, send stop\n"); - TWSI_WRITE(sc, sc->reg_control, - sc->control_val | TWSI_CONTROL_STOP); - } else { - sc->control_val &= ~TWSI_CONTROL_INTEN; - TWSI_WRITE(sc, sc->reg_control, - sc->control_val); - } - transfer_done = 1; - } else { - debugf(sc->dev, "Sending byte %d = %x\n", - sc->sent_bytes, - sc->msg->buf[sc->sent_bytes]); - TWSI_WRITE(sc, sc->reg_data, - sc->msg->buf[sc->sent_bytes]); + case TWSI_STATUS_DATA_WR_ACK: + debugf(sc->dev, "Ack received after transmitting data\n"); + if (sc->sent_bytes++ == (sc->msgs[sc->msg_idx].len - 1)) { + debugf(sc->dev, "Done sending all the bytes for msg %d\n", sc->msg_idx); + /* Send stop, no interrupts on stop */ + if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) { + debugf(sc->dev, "Done TX data, send stop\n"); TWSI_WRITE(sc, sc->reg_control, - sc->control_val); + sc->control_val | TWSI_CONTROL_STOP); + } else { + debugf(sc->dev, "Done TX data with NO_STOP\n"); + TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); } + sc->msg_idx++; + if (sc->msg_idx == sc->nmsgs) { + debugf(sc->dev, "transfer_done=1\n"); + transfer_done = 1; + } + } else { + debugf(sc->dev, "Sending byte %d = %x\n", + sc->sent_bytes, + sc->msgs[sc->msg_idx].buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_data, + sc->msgs[sc->msg_idx].buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_control, + sc->control_val); + } + break; - break; - case TWSI_STATUS_DATA_RD_ACK: - debugf(sc->dev, "Ack received after receiving data\n"); - debugf(sc->dev, "msg_len=%d recv_bytes=%d\n", sc->msg->len, sc->recv_bytes); - sc->msg->buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); + case TWSI_STATUS_DATA_RD_ACK: + debugf(sc->dev, "Ack received after receiving data\n"); + debugf(sc->dev, "msg_len=%d recv_bytes=%d\n", sc->msgs[sc->msg_idx].len, sc->recv_bytes); + sc->msgs[sc->msg_idx].buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); - /* If we only have one byte left, disable ACK */ - if (sc->msg->len - sc->recv_bytes == 1) - sc->control_val &= ~TWSI_CONTROL_ACK; - TWSI_WRITE(sc, sc->reg_control, sc->control_val); - break; + /* If we only have one byte left, disable ACK */ + if (sc->msgs[sc->msg_idx].len - sc->recv_bytes == 1) + sc->control_val &= ~TWSI_CONTROL_ACK; + if (sc->msgs[sc->msg_idx].len - sc->recv_bytes) { + sc->msg_idx++; + if (sc->msg_idx == sc->nmsgs - 1) + transfer_done = 1; + } + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; - case TWSI_STATUS_DATA_RD_NOACK: - if (sc->msg->len - sc->recv_bytes == 1) { - sc->msg->buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); - debugf(sc->dev, "Done RX data, send stop (2)\n"); - if (!(sc->msg->flags & IIC_M_NOSTOP)) - TWSI_WRITE(sc, sc->reg_control, - sc->control_val | TWSI_CONTROL_STOP); - } else { - debugf(sc->dev, "No ack when receiving data\n"); - sc->error = ENXIO; - sc->control_val = 0; - } - sc->transfer = 0; - transfer_done = 1; - break; - - default: - debugf(sc->dev, "status=%x hot handled\n", status); - sc->transfer = 0; + case TWSI_STATUS_DATA_RD_NOACK: + if (sc->msgs[sc->msg_idx].len - sc->recv_bytes == 1) { + sc->msgs[sc->msg_idx].buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); + debugf(sc->dev, "Done RX data, send stop (2)\n"); + if (!(sc->msgs[sc->msg_idx].flags & IIC_M_NOSTOP)) + TWSI_WRITE(sc, sc->reg_control, + sc->control_val | TWSI_CONTROL_STOP); + } else { + debugf(sc->dev, "No ack when receiving data\n"); sc->error = ENXIO; sc->control_val = 0; - wakeup(sc); - break; } + sc->transfer = 0; + transfer_done = 1; + break; - if (sc->need_ack) - TWSI_WRITE(sc, sc->reg_control, - sc->control_val | TWSI_CONTROL_IFLG); + default: + debugf(sc->dev, "status=%x hot handled\n", status); + sc->transfer = 0; + sc->error = ENXIO; + sc->control_val = 0; + wakeup(sc); + break; } - debugf(sc->dev, "Done with interrupts\n"); + debugf(sc->dev, "Done with interrupts\n\n"); if (transfer_done == 1) { sc->transfer = 0; wakeup(sc); Modified: head/sys/dev/iicbus/twsi/twsi.h ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.h Fri Jan 10 18:48:11 2020 (r356608) +++ head/sys/dev/iicbus/twsi/twsi.h Fri Jan 10 18:52:14 2020 (r356609) @@ -57,7 +57,9 @@ struct twsi_softc { void * intrhand; bool have_intr; - struct iic_msg *msg; + struct iic_msg *msgs; + uint32_t nmsgs; + uint32_t msg_idx; uint16_t sent_bytes; uint16_t recv_bytes; int transfer; From owner-svn-src-head@freebsd.org Fri Jan 10 18:53:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E87F1F000D; Fri, 10 Jan 2020 18:53:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vXDp3m0dz3xjV; Fri, 10 Jan 2020 18:53:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BF011E7E6; Fri, 10 Jan 2020 18:53:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00AIrE1u070626; Fri, 10 Jan 2020 18:53:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AIrEXX070625; Fri, 10 Jan 2020 18:53:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001101853.00AIrEXX070625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 10 Jan 2020 18:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356610 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 356610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 18:53:14 -0000 Author: manu Date: Fri Jan 10 18:53:14 2020 New Revision: 356610 URL: https://svnweb.freebsd.org/changeset/base/356610 Log: arm: allwinner: axp209: Add regnode_status method This allow consumers to check if the regulator is enable or not. MFC after: 1 week Modified: head/sys/arm/allwinner/axp209.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Fri Jan 10 18:52:14 2020 (r356609) +++ head/sys/arm/allwinner/axp209.c Fri Jan 10 18:53:14 2020 (r356610) @@ -708,6 +708,22 @@ axp2xx_regnode_voltage_to_reg(struct axp2xx_reg_sc *sc } static int +axp2xx_regnode_status(struct regnode *regnode, int *status) +{ + struct axp2xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + *status = 0; + axp2xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (val & sc->def->enable_mask) + *status = REGULATOR_STATUS_ENABLED; + + return (0); +} + +static int axp2xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { @@ -750,6 +766,7 @@ static regnode_method_t axp2xx_regnode_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, axp2xx_regnode_init), REGNODEMETHOD(regnode_enable, axp2xx_regnode_enable), + REGNODEMETHOD(regnode_status, axp2xx_regnode_status), REGNODEMETHOD(regnode_set_voltage, axp2xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp2xx_regnode_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), From owner-svn-src-head@freebsd.org Fri Jan 10 19:32:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EB4F1F16E6; Fri, 10 Jan 2020 19:32:09 +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 47vY5j0SLrz43Gr; Fri, 10 Jan 2020 19:32:09 +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 0B0411EF58; Fri, 10 Jan 2020 19:32:09 +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 00AJW8OM095246; Fri, 10 Jan 2020 19:32:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AJW8vW095245; Fri, 10 Jan 2020 19:32:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001101932.00AJW8vW095245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 10 Jan 2020 19:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356611 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 19:32:09 -0000 Author: glebius Date: Fri Jan 10 19:32:08 2020 New Revision: 356611 URL: https://svnweb.freebsd.org/changeset/base/356611 Log: Always multiple vm.pgcache_zone_max to number of CPUs, and rename it respectively. The tunable controls how big is the size of per-cpu vm page cache. Previously the value was split for all CPUs in system, so configuring same value on machines with different count of CPUs yielded in different cache size available to a particular CPU. Reviewed by: markj Obtained from: Netflix Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jan 10 18:53:14 2020 (r356610) +++ head/sys/vm/vm_page.c Fri Jan 10 19:32:08 2020 (r356611) @@ -228,7 +228,8 @@ vm_page_init_cache_zones(void *dummy __unused) int cache, domain, maxcache, pool; maxcache = 0; - TUNABLE_INT_FETCH("vm.pgcache_zone_max", &maxcache); + TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &maxcache); + maxcache *= mp_ncpus; for (domain = 0; domain < vm_ndomains; domain++) { vmd = VM_DOMAIN(domain); for (pool = 0; pool < VM_NFREEPOOL; pool++) { From owner-svn-src-head@freebsd.org Fri Jan 10 20:53:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CE471F38F2; Fri, 10 Jan 2020 20:53:59 +0000 (UTC) (envelope-from lbartoletti@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vZw73CKFz47r7; Fri, 10 Jan 2020 20:53:59 +0000 (UTC) (envelope-from lbartoletti@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68B691FE2C; Fri, 10 Jan 2020 20:53:59 +0000 (UTC) (envelope-from lbartoletti@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00AKrxKN046217; Fri, 10 Jan 2020 20:53:59 GMT (envelope-from lbartoletti@FreeBSD.org) Received: (from lbartoletti@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AKrx76046216; Fri, 10 Jan 2020 20:53:59 GMT (envelope-from lbartoletti@FreeBSD.org) Message-Id: <202001102053.00AKrx76046216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lbartoletti set sender to lbartoletti@FreeBSD.org using -f From: =?UTF-8?Q?Lo=c3=afc_Bartoletti?= Date: Fri, 10 Jan 2020 20:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356612 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: lbartoletti X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 356612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 20:53:59 -0000 Author: lbartoletti (ports committer) Date: Fri Jan 10 20:53:58 2020 New Revision: 356612 URL: https://svnweb.freebsd.org/changeset/base/356612 Log: Add myself (lbartoletti) as a ports commiter Step 5 (Update Mentor and Mentee Information) from Commiters guide. I also alphababetize mentees from tcberner. Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D23125 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Jan 10 19:32:08 2020 (r356611) +++ head/share/misc/committers-ports.dot Fri Jan 10 20:53:58 2020 (r356612) @@ -163,6 +163,7 @@ krion [label="Kirill Ponomarew\nkrion@FreeBSD.org\n200 kwm [label="Koop Mast\nkwm@FreeBSD.org\n2004/09/14"] laszlof [label="Frank Laszlo\nlaszlof@FreeBSD.org\n2006/11/07"] lawrance [label="Sam Lawrance\nlawrance@FreeBSD.org\n2005/04/11\n2007/02/21"] +lbartoletti [label="Loïc Bartoletti\nlbartoletti@FreeBSD.org\n2020/01/02"] lbr [label="Lars Balker Rasmussen\nlbr@FreeBSD.org\n2006/04/30"] leeym [label="Yen-Ming Lee\nleeym@FreeBSD.org\n2002/08/14"] ler [label="Larry Rosenman\nler@FreeBSD.org\n2017/01/09"] @@ -697,6 +698,7 @@ swills -> feld swills -> jmd swills -> jrm swills -> jsm +swills -> lbartoletti swills -> mfechner swills -> milki swills -> pclin @@ -724,13 +726,14 @@ tabthorpe -> zi tabthorpe -> gblach tcberner -> adridg -tcberner -> joneum -tcberner -> yuri -tcberner -> fernape tcberner -> arrowd -tcberner -> rigoletto +tcberner -> fernape +tcberner -> joneum tcberner -> kai +tcberner -> lbartoletti tcberner -> pkubaj +tcberner -> rigoletto +tcberner -> yuri thierry -> jadawin thierry -> riggs From owner-svn-src-head@freebsd.org Fri Jan 10 21:22:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A7A91F42C0; Fri, 10 Jan 2020 21:22:04 +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 47vbXW74Pbz49Lq; Fri, 10 Jan 2020 21:22:03 +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 EDCC52026E; Fri, 10 Jan 2020 21:22:03 +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 00ALM35r063533; Fri, 10 Jan 2020 21:22:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00ALM37Q063532; Fri, 10 Jan 2020 21:22:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001102122.00ALM37Q063532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 10 Jan 2020 21:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356613 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 356613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 21:22:04 -0000 Author: glebius Date: Fri Jan 10 21:22:03 2020 New Revision: 356613 URL: https://svnweb.freebsd.org/changeset/base/356613 Log: Add pfil(9) hook to vtnet(4). The patch could be simplier, using only the second chunk to vtnet_rxq_eof(), that passes full mbufs to pfil(9). Packet filter would m_free() them in case of returning PFIL_DROPPED. However, we pretend to be a hardware driver, so we first try to pass a memory buffer via PFIL_MEMPTR feature. This is mostly done for debugging purposes, so that one can experiment in bhyve with packet filters utilizing same features as a true driver. Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Jan 10 20:53:58 2020 (r356612) +++ head/sys/dev/virtio/network/if_vtnet.c Fri Jan 10 21:22:03 2020 (r356613) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -935,6 +936,7 @@ static int vtnet_setup_interface(struct vtnet_softc *sc) { device_t dev; + struct pfil_head_args pa; struct ifnet *ifp; dev = sc->vtnet_dev; @@ -1038,6 +1040,12 @@ vtnet_setup_interface(struct vtnet_softc *sc) DEBUGNET_SET(ifp, vtnet); + pa.pa_version = PFIL_VERSION; + pa.pa_flags = PFIL_IN; + pa.pa_type = PFIL_TYPE_ETHERNET; + pa.pa_headname = ifp->if_xname; + sc->vtnet_pfil = pfil_head_register(&pa); + return (0); } @@ -1773,9 +1781,11 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) struct vtnet_softc *sc; struct ifnet *ifp; struct virtqueue *vq; - struct mbuf *m; + struct mbuf *m, *mr; struct virtio_net_hdr_mrg_rxbuf *mhdr; int len, deq, nbufs, adjsz, count; + pfil_return_t pfil; + bool pfil_done; sc = rxq->vtnrx_sc; vq = rxq->vtnrx_vq; @@ -1812,6 +1822,35 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) adjsz = sizeof(struct virtio_net_hdr_mrg_rxbuf); } + /* + * If we have enough data in first mbuf, run it through + * pfil as a memory buffer before dequeueing the rest. + */ + if (PFIL_HOOKED_IN(sc->vtnet_pfil) && + len - adjsz >= ETHER_HDR_LEN + max_protohdr) { + pfil = pfil_run_hooks(sc->vtnet_pfil, + m->m_data + adjsz, ifp, + len - adjsz | PFIL_MEMPTR | PFIL_IN, NULL); + switch (pfil) { + case PFIL_REALLOCED: + mr = pfil_mem2mbuf(m->m_data + adjsz); + vtnet_rxq_input(rxq, mr, hdr); + /* FALLTHROUGH */ + case PFIL_DROPPED: + case PFIL_CONSUMED: + vtnet_rxq_discard_buf(rxq, m); + if (nbufs > 1) + vtnet_rxq_discard_merged_bufs(rxq, + nbufs); + continue; + default: + KASSERT(pfil == PFIL_PASS, + ("Filter returned %d!\n", pfil)); + }; + pfil_done = true; + } else + pfil_done = false; + if (vtnet_rxq_replace_buf(rxq, m, len) != 0) { rxq->vtnrx_stats.vrxs_iqdrops++; vtnet_rxq_discard_buf(rxq, m); @@ -1841,6 +1880,19 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) */ memcpy(hdr, mtod(m, void *), sizeof(struct virtio_net_hdr)); m_adj(m, adjsz); + + if (PFIL_HOOKED_IN(sc->vtnet_pfil) && pfil_done == false) { + pfil = pfil_run_hooks(sc->vtnet_pfil, &m, ifp, PFIL_IN, + NULL); + switch (pfil) { + case PFIL_DROPPED: + case PFIL_CONSUMED: + continue; + default: + KASSERT(pfil == PFIL_PASS, + ("Filter returned %d!\n", pfil)); + } + } vtnet_rxq_input(rxq, m, hdr); Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Fri Jan 10 20:53:58 2020 (r356612) +++ head/sys/dev/virtio/network/if_vtnetvar.h Fri Jan 10 21:22:03 2020 (r356613) @@ -136,6 +136,7 @@ struct vtnet_softc { struct ifnet *vtnet_ifp; struct vtnet_rxq *vtnet_rxqs; struct vtnet_txq *vtnet_txqs; + pfil_head_t vtnet_pfil; uint32_t vtnet_flags; #define VTNET_FLAG_SUSPENDED 0x0001 From owner-svn-src-head@freebsd.org Fri Jan 10 21:51:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E289E1F477D; Fri, 10 Jan 2020 21:51:27 +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 47vcBR5g0Sz4Bc8; Fri, 10 Jan 2020 21:51:27 +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 BD3C7207AA; Fri, 10 Jan 2020 21:51:27 +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 00ALpRUG078294; Fri, 10 Jan 2020 21:51:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00ALpRYE078293; Fri, 10 Jan 2020 21:51:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001102151.00ALpRYE078293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 21:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356614 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 356614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 21:51:27 -0000 Author: kevans Date: Fri Jan 10 21:51:27 2020 New Revision: 356614 URL: https://svnweb.freebsd.org/changeset/base/356614 Log: tests: fusefs: silence remaining unsigned/signed comparison warnings External GCC turns these into errors; cast to long to silence them. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D23127 Modified: head/tests/sys/fs/fusefs/setattr.cc Modified: head/tests/sys/fs/fusefs/setattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/setattr.cc Fri Jan 10 21:22:03 2020 (r356613) +++ head/tests/sys/fs/fusefs/setattr.cc Fri Jan 10 21:51:27 2020 (r356614) @@ -586,11 +586,11 @@ TEST_F(Setattr, utimensat) { in.body.setattr.valid == valid && (time_t)in.body.setattr.atime == newtimes[0].tv_sec && - in.body.setattr.atimensec == + (long)in.body.setattr.atimensec == newtimes[0].tv_nsec && (time_t)in.body.setattr.mtime == newtimes[1].tv_sec && - in.body.setattr.mtimensec == + (long)in.body.setattr.mtimensec == newtimes[1].tv_nsec); }, Eq(true)), _) @@ -641,7 +641,7 @@ TEST_F(Setattr, utimensat_mtime_only) { in.body.setattr.valid == valid && (time_t)in.body.setattr.mtime == newtimes[1].tv_sec && - in.body.setattr.mtimensec == + (long)in.body.setattr.mtimensec == newtimes[1].tv_nsec); }, Eq(true)), _) From owner-svn-src-head@freebsd.org Fri Jan 10 22:00:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7552A1F4EB5; Fri, 10 Jan 2020 22:00:40 +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 47vcP42btdz4CDC; Fri, 10 Jan 2020 22:00:40 +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 543B920933; Fri, 10 Jan 2020 22:00:40 +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 00AM0e45082665; Fri, 10 Jan 2020 22:00:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AM0eBf082664; Fri, 10 Jan 2020 22:00:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001102200.00AM0eBf082664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Jan 2020 22:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356615 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 22:00:40 -0000 Author: emaste Date: Fri Jan 10 22:00:39 2020 New Revision: 356615 URL: https://svnweb.freebsd.org/changeset/base/356615 Log: src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT, but previously other cases that forced KERBEROS off (such as WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off. Because the _SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed before other dependencies (CRYPT/KERBEROS) it's not easy to make this happen automatically. Instead just explicitly set KERBEROS_SUPPORT off where we set KERBEROS off. Reported by: Michael Dexter's Build Option Survey run Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jan 10 21:51:27 2020 (r356614) +++ head/share/mk/src.opts.mk Fri Jan 10 22:00:39 2020 (r356615) @@ -459,6 +459,7 @@ MK_CTF:= no MK_OPENSSL:= no MK_OPENSSH:= no MK_KERBEROS:= no +MK_KERBEROS_SUPPORT:= no .endif .if ${MK_CXX} == "no" @@ -498,6 +499,7 @@ MK_NLS_CATALOGS:= no .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no +MK_KERBEROS_SUPPORT:= no MK_LDNS:= no .endif From owner-svn-src-head@freebsd.org Fri Jan 10 22:20:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 924BD1F54D3; Fri, 10 Jan 2020 22:20:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vcqr3Kz5z4DFF; Fri, 10 Jan 2020 22:20:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6915920CBE; Fri, 10 Jan 2020 22:20:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00AMKOIF094967; Fri, 10 Jan 2020 22:20:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AMKOh7094966; Fri, 10 Jan 2020 22:20:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001102220.00AMKOh7094966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Jan 2020 22:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356617 - head/usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/camdd X-SVN-Commit-Revision: 356617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 22:20:24 -0000 Author: kevans Date: Fri Jan 10 22:20:23 2020 New Revision: 356617 URL: https://svnweb.freebsd.org/changeset/base/356617 Log: camdd: initialize devs earlier GCC9 points out that devs may be used initialized after the bailout label; in-fact, if num_io_opts != 2 then it is. Move the initialization up a little bit. Reviewed by: ken MFC after: 3 days Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Fri Jan 10 22:10:01 2020 (r356616) +++ head/usr.sbin/camdd/camdd.c Fri Jan 10 22:20:23 2020 (r356617) @@ -3226,13 +3226,13 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opt int error = 0; int i; + bzero(devs, sizeof(devs)); + if (num_io_opts != 2) { warnx("Must have one input and one output path"); error = 1; goto bailout; } - - bzero(devs, sizeof(devs)); for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { From owner-svn-src-head@freebsd.org Fri Jan 10 22:49:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F4611F5AC8; Fri, 10 Jan 2020 22:49:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vdTR3D8lz4FGZ; Fri, 10 Jan 2020 22:49:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64F0221222; Fri, 10 Jan 2020 22:49:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00AMnVno012970; Fri, 10 Jan 2020 22:49:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00AMnFLZ012886; Fri, 10 Jan 2020 22:49:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202001102249.00AMnFLZ012886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Jan 2020 22:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356618 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/hardware c... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/hardware components/namespace compo... X-SVN-Commit-Revision: 356618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 22:49:31 -0000 Author: jkim Date: Fri Jan 10 22:49:14 2020 New Revision: 356618 URL: https://svnweb.freebsd.org/changeset/base/356618 Log: MFV: r356607 Import ACPICA 20200110. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/acgetline.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/cmfsize.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmswitch.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtables.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbdump1.c head/sys/contrib/dev/acpica/common/dmtbdump2.c head/sys/contrib/dev/acpica/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslallocate.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcache.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcstyle.y head/sys/contrib/dev/acpica/compiler/asldebug.c head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslhelpers.y head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/aslkeywords.y head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparseop.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslpld.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslprimaries.y head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslprune.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/aslxrefout.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvdisasm.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconcat.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exserial.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/extrace.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utascii.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utnonansi.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utresdecode.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utuuid.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/acclib.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acconvert.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbinfo.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/acuuid.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acenvex.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/include/platform/acgccex.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/changes.txt Fri Jan 10 22:49:14 2020 (r356618) @@ -1,22 +1,61 @@ ---------------------------------------- +10 January 2020. Summary of changes for version 20200110: + + +1) ACPICA kernel-resident subsystem: + +Updated all copyrights to 2020. This affects all ACPICA source code +modules. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +ASL test suite (ASLTS): Updated all copyrights to 2020. + +Tools and utilities: Updated all signon copyrights to 2020. + +iASL: fix forward reference analysis for field declarations. Fixes +forward reference analysis for field declarations by searching the +parent scope for the named object when the object is not present in +the current scope. + +iASL: Improved the error output for ALREADY_EXISTS errors. Now, the +full pathname of the name that already exists is printed. + +iASL: Enhance duplicate Case() detection for buffers. Add check for +buffers with no initializer list (these buffers will be filled with +zeros at runtime.) + + +---------------------------------------- 13 December 2019. Summary of changes for version 20191213: 1) ACPICA kernel-resident subsystem: -Return a Buffer object for all fields created via the CreateField operator. Previously, an Integer would be returned if the size of the field was less than or equal to the current size of an Integer. Although this goes against the ACPI specification, it provides compatibility with other ACPI implementations. Also updated the ASLTS test suite to reflect this new behavior. +Return a Buffer object for all fields created via the CreateField +operator. Previously, an Integer would be returned if the size of +the field was less than or equal to the current size of an Integer. +Although this goes against the ACPI specification, it provides +compatibility with other ACPI implementations. Also updated the +ASLTS test suite to reflect this new behavior. 2) iASL Compiler/Disassembler and ACPICA tools: -iASL: Implemented detection of (and throw an error for) duplicate values for Case statements within a single Switch statement. Duplicate Integers, Strings, and Buffers are supported. +iASL: Implemented detection of (and throw an error for) duplicate +values for Case statements within a single Switch statement. Duplicate +Integers, Strings, and Buffers are supported. -iASL: Fix error logging issue during multiple file compilation -- Switch to the correct input file during error node creation. +iASL: Fix error logging issue during multiple file compilation -- +Switch to the correct input file during error node creation. -iASL: For duplicate named object creation, now emit an error instead of a warning - since this will cause a runtime error. +iASL: For duplicate named object creation, now emit an error instead +of a warning - since this will cause a runtime error. AcpiSrc: Add unix line-ending support for non-Windows builds. -iASL: Add an error condition for an attempt to create a NameString with > 255 NameSegs (the max allowable via the AML definition). +iASL: Add an error condition for an attempt to create a NameString +with > 255 NameSegs (the max allowable via the AML definition). ---------------------------------------- Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/acfileio.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/acgetline.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acgetline.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/acgetline.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/adfile.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/adisasm.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/adwalk.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/ahids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahids.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/ahids.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/ahtable.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/cmfsize.c ============================================================================== --- head/sys/contrib/dev/acpica/common/cmfsize.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/cmfsize.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmextern.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmswitch.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmswitch.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmswitch.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtable.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtables.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtables.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtables.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbdump1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump1.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbdump1.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbdump2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump2.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbdump2.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbdump3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump3.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbdump3.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbinfo1.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo1.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbinfo1.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbinfo2.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo2.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbinfo2.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/dmtbinfo3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo3.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/dmtbinfo3.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/common/getopt.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslallocate.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslallocate.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslallocate.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslascii.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslascii.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslascii.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcache.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcache.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcache.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Jan 10 22:49:14 2020 (r356618) @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslcstyle.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcstyle.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslcstyle.y Fri Jan 10 22:49:14 2020 (r356618) @@ -9,7 +9,7 @@ NoEcho(' * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asldebug.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldebug.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asldebug.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License @@ -751,7 +751,14 @@ AePrintSubError ( MainMessage = AeDecodeMessageId (Enode->MessageId); - fprintf (OutputFile, " %s%s", MainMessage, "\n "); + fprintf (OutputFile, " %s", MainMessage); + + if (Enode->Message) + { + fprintf (OutputFile, "(%s)", Enode->Message); + } + + fprintf (OutputFile, "\n "); (void) AePrintErrorSourceLine (OutputFile, Enode, &PrematureEOF, &Total); fprintf (OutputFile, "\n"); } Modified: head/sys/contrib/dev/acpica/compiler/aslexternal.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslexternal.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslexternal.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfileio.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslfileio.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslhelp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhelp.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslhelp.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslhelpers.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhelpers.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslhelpers.y Fri Jan 10 22:49:14 2020 (r356618) @@ -9,7 +9,7 @@ NoEcho(' * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslhex.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhex.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslhex.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslkeywords.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslkeywords.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslkeywords.y Fri Jan 10 22:49:14 2020 (r356618) @@ -9,7 +9,7 @@ NoEcho(' * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asllength.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllength.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asllength.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asllistsup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllistsup.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asllistsup.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License @@ -273,15 +273,15 @@ LdLoadFieldElements ( ACPI_PARSE_OBJECT *SourceRegion; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; + char *ExternalPath; SourceRegion = UtGetArg (Op, 0); if (SourceRegion) { Status = AcpiNsLookup (WalkState->ScopeInfo, - SourceRegion->Asl.Value.String, - AmlType, ACPI_IMODE_EXECUTE, - ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + SourceRegion->Asl.Value.String, AmlType, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (Status == AE_NOT_FOUND) { /* @@ -357,9 +357,16 @@ LdLoadFieldElements ( * The name already exists in this scope * But continue processing the elements */ + ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE); + AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child, - Child->Asl.Value.String, ASL_MSG_FOUND_HERE, Node->Op, - Node->Op->Asl.ExternalName); + ExternalPath, ASL_MSG_FOUND_HERE, Node->Op, + ExternalPath); + + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } } } else @@ -403,6 +410,7 @@ LdLoadResourceElements ( ACPI_PARSE_OBJECT *InitializerOp = NULL; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; + char *ExternalPath; /* @@ -419,10 +427,17 @@ LdLoadResourceElements ( { /* Actual node causing the error was saved in ParentMethod */ + ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE); + AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, (ACPI_PARSE_OBJECT *) Op->Asl.ParentMethod, - Op->Asl.Namepath, ASL_MSG_FOUND_HERE, Node->Op, - Node->Op->Asl.ExternalName); + ExternalPath, ASL_MSG_FOUND_HERE, Node->Op, + ExternalPath); + + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } return (AE_OK); } return (Status); @@ -499,6 +514,7 @@ LdNamespace1Begin ( BOOLEAN ForceNewScope = FALSE; const ACPI_OPCODE_INFO *OpInfo; ACPI_PARSE_OBJECT *ParentOp; + char *ExternalPath; ACPI_FUNCTION_NAME (LdNamespace1Begin); @@ -939,9 +955,16 @@ LdNamespace1Begin ( { /* Valid error, object already exists */ + ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE); + AslDualParseOpError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, - Op->Asl.ExternalName, ASL_MSG_FOUND_HERE, Node->Op, - Node->Op->Asl.ExternalName); + ExternalPath, ASL_MSG_FOUND_HERE, Node->Op, + ExternalPath); + + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } return_ACPI_STATUS (AE_OK); } } Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmapenter.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmapenter.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmapenter.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmapoutput.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmapoutput.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmapoutput.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmaputils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmaputils.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmaputils.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslnamesp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslnamesp.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslnamesp.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asloffset.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloffset.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asloffset.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslparseop.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslparseop.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslparseop.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslparser.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslparser.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslparser.y Fri Jan 10 22:49:14 2020 (r356618) @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslpld.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpld.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslpld.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslprepkg.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslprimaries.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprimaries.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslprimaries.y Fri Jan 10 22:49:14 2020 (r356618) @@ -11,7 +11,7 @@ NoEcho(' * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslprintf.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprintf.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslprintf.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslprune.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprune.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslprune.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslresource.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresource.c Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslresource.c Fri Jan 10 22:49:14 2020 (r356618) @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. * All rights reserved. * * 2. License Modified: head/sys/contrib/dev/acpica/compiler/aslresources.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresources.y Fri Jan 10 22:20:23 2020 (r356617) +++ head/sys/contrib/dev/acpica/compiler/aslresources.y Fri Jan 10 22:49:14 2020 (r356618) @@ -11,7 +11,7 @@ NoEcho(' * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Jan 10 23:18:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A238B1F64FF; Fri, 10 Jan 2020 23:18:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) (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 47vf6n3pfPz4Gtt; Fri, 10 Jan 2020 23:18:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ua1-x942.google.com with SMTP id c7so1372542uaf.5; Fri, 10 Jan 2020 15:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SVOjK/S6wPRrNC/OG2C7qto2aNa2HQQ0OZD+8YrXceg=; b=Dz/UazS/idq3wrXufGKIWt+GMrMfvCw6EMl5H11hmBIkHoASeCcsuL3EwyO3r7X0ET E4kdIAsoYgOJHOp69Jm5qtowtYCjRF9l5LAqvhbN/WA928dNqPYXnOQP+sYOkbVSmdYc 2s/S1HB+HgddJedQlq0brmVW22WwsiJqJ85KgYZ2hxG+FtboU7MNLRhaKG3vgocyUc+6 fHBpn2+SwbleMlebCpY0fJ9zRanD61k3uKsi96mO2V5NzxpSfmzqCaAnQiRqDdUh9TH9 J+KqDiAKyuj49Qz5SDhLdl5EPgJtFZeH/f5CVOM2AultyqOtR8h0MC49dhgpOili7RHf XMEQ== 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=SVOjK/S6wPRrNC/OG2C7qto2aNa2HQQ0OZD+8YrXceg=; b=EoSkkAgVjq3QzV2Y9V8R5SLlHJqhYIw9hsBBDXCVz+5lln5gVH8NYv8GBqPXcfqMH1 pfpMWVLlxfVSoWJN0kHiC675Mo6eewHsqYMbq6Cm1vjkRm8lCennLlMim+ZSGYIIXrXn XRaABPUYXDOYcY17r6U4WhUlLFnK+iijuyXdLMzKLJG4WtjWY/YvIzS+ttz9OCVcOwSq iShO8fW7UocYCpDU3ZBjUN0p7qTX1oHkfYY7i4PUMczNoiL/AicqmsZ3S7efjzL9eULl 4HmM09fxQuXC4NCxftb1ZklA8jox0UQwzgj5bOYX+CCnYSNoawhfU9uXN6ORnokai4kB ia0A== X-Gm-Message-State: APjAAAXBWJ4d1yyBhZcxKd+08vZl7y/icsL/7rHAgVgOS0bXn8p5dSIn 7LEc2kQHcAONFgmfpmHicpxT8t4Bx/6mPeL75HlayZZq X-Google-Smtp-Source: APXvYqwYi8rV4uBcSFAKOOf1NQk5moU2xEDg1o+LckIM8ihSx49HbKhb48tKGt/swl2vC8DCEPlXZcHqRmippop63W4= X-Received: by 2002:ab0:7049:: with SMTP id v9mr3704853ual.95.1578698304147; Fri, 10 Jan 2020 15:18:24 -0800 (PST) MIME-Version: 1.0 References: <202001102200.00AM0eBf082664@repo.freebsd.org> In-Reply-To: <202001102200.00AM0eBf082664@repo.freebsd.org> From: Enji Cooper Date: Fri, 10 Jan 2020 15:18:13 -0800 Message-ID: Subject: Re: svn commit: r356615 - head/share/mk To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47vf6n3pfPz4Gtt X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 23:18:25 -0000 On Fri, Jan 10, 2020 at 2:00 PM Ed Maste wrote: > > Author: emaste > Date: Fri Jan 10 22:00:39 2020 > New Revision: 356615 > URL: https://svnweb.freebsd.org/changeset/base/356615 > > Log: > src.opts.mk: force KERBEROS_SUPPORT off where KERBEROS forced off > > Explicitly setting WITHOUT_KERBEROS implies WITHOUT_KERBEROS_SUPPORT, > but previously other cases that forced KERBEROS off (such as > WITHOUT_CRYPT) did not also set KERBEROS_SUPPORT off. Because the > _SUPPORT dependent options (KERBEROS/KERBEROS_SUPPORT) are processed > before other dependencies (CRYPT/KERBEROS) it's not easy to make this > happen automatically. Instead just explicitly set KERBEROS_SUPPORT > off where we set KERBEROS off. I don't think this is the right change to make, given that src.opts.mk ( https://svnweb.freebsd.org/base/head/share/mk/src.opts.mk?revision=356615&view=markup#l233 ) states: 233 # MK_*_SUPPORT options which default to "yes" unless their corresponding 234 # MK_* variable is set to "no". The right change to make would be to shift these special cases to the variable defined on line 227 ( https://svnweb.freebsd.org/base/head/share/mk/src.opts.mk?revision=356615&view=markup#l227 ): 225 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding 226 # RIGHT option is disabled. 227 __DEFAULT_DEPENDENT_OPTIONS= \ 228 CLANG_FULL/CLANG \ 229 LOADER_VERIEXEC/BEARSSL \ 230 LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ 231 VERIEXEC/BEARSSL \ If `MK_CRYPT == no`'s setting of `MK_KERBEROS:=no` was moved here, then the rest would just work by virtue of precedence. Thanks, -Enji From owner-svn-src-head@freebsd.org Sat Jan 11 01:44:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8CE41F9F4E; Sat, 11 Jan 2020 01:44:55 +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 47vjMq42Dxz4Ptx; Sat, 11 Jan 2020 01:44:55 +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 858B623398; Sat, 11 Jan 2020 01:44:55 +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 00B1itwP020706; Sat, 11 Jan 2020 01:44:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B1itIT020705; Sat, 11 Jan 2020 01:44:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202001110144.00B1itIT020705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 11 Jan 2020 01:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356624 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 356624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 01:44:55 -0000 Author: pfg Date: Sat Jan 11 01:44:55 2020 New Revision: 356624 URL: https://svnweb.freebsd.org/changeset/base/356624 Log: Update ELFOSABI_* constants with OpenVOS. Reference: https://www.sco.com/developers/gabi/latest/ch4.eheader.html Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sat Jan 11 01:15:38 2020 (r356623) +++ head/sys/sys/elf_common.h Sat Jan 11 01:44:55 2020 (r356624) @@ -175,6 +175,7 @@ typedef struct { #define ELFOSABI_AROS 15 /* Amiga Research OS */ #define ELFOSABI_FENIXOS 16 /* FenixOS */ #define ELFOSABI_CLOUDABI 17 /* Nuxi CloudABI */ +#define ELFOSABI_OPENVOS 18 /* Stratus Technologies OpenVOS */ #define ELFOSABI_ARM_AEABI 64 /* ARM EABI */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ From owner-svn-src-head@freebsd.org Sat Jan 11 03:18:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 700E61FBFB8; Sat, 11 Jan 2020 03:18:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vlS82LpQz4Tmc; Sat, 11 Jan 2020 03:18:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BF0A2445E; Sat, 11 Jan 2020 03:18:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00B3ImxJ075306; Sat, 11 Jan 2020 03:18:48 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B3ImMZ075305; Sat, 11 Jan 2020 03:18:48 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001110318.00B3ImMZ075305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 11 Jan 2020 03:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356627 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 356627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 03:18:48 -0000 Author: mckusick Date: Sat Jan 11 03:18:47 2020 New Revision: 356627 URL: https://svnweb.freebsd.org/changeset/base/356627 Log: When a read error occurs while fetching a directory block to delete or rename an entry in it, properly reset the link count of the inode associated with the entry that was to have been changed. Tested by: Peter Holm MFC after: 7 days Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sat Jan 11 03:15:12 2020 (r356626) +++ head/sys/ufs/ufs/ufs_lookup.c Sat Jan 11 03:18:47 2020 (r356627) @@ -1169,6 +1169,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) struct inode *dp; struct direct *ep, *rep; struct buf *bp; + off_t offset; int error; dp = VTOI(dvp); @@ -1187,22 +1188,32 @@ ufs_dirremove(dvp, ip, flags, isrmdir) ip->i_flag |= IN_CHANGE; } } + if (flags & DOWHITEOUT) + offset = dp->i_offset; + else + offset = dp->i_offset - dp->i_count; + if ((error = UFS_BLKATOFF(dvp, offset, (char **)&ep, &bp)) != 0) { + if (ip) { + ip->i_effnlink++; + ip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(dvp)) { + softdep_change_linkcnt(ip); + } else { + ip->i_nlink++; + DIP_SET(ip, i_nlink, ip->i_nlink); + ip->i_flag |= IN_CHANGE; + } + } + return (error); + } if (flags & DOWHITEOUT) { /* * Whiteout entry: set d_ino to UFS_WINO. */ - if ((error = - UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0) - return (error); ep->d_ino = UFS_WINO; ep->d_type = DT_WHT; goto out; } - - if ((error = UFS_BLKATOFF(dvp, - (off_t)(dp->i_offset - dp->i_count), (char **)&ep, &bp)) != 0) - return (error); - /* Set 'rep' to the entry being removed. */ if (dp->i_count == 0) rep = ep; @@ -1302,12 +1313,22 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) } error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); - if (error) - return (error); - if (ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && - ep->d_ino != oip->i_number) { + if (error == 0 && ep->d_namlen == 2 && ep->d_name[1] == '.' && + ep->d_name[0] == '.' && ep->d_ino != oip->i_number) { brelse(bp); - return (EIDRM); + error = EIDRM; + } + if (error) { + oip->i_effnlink++; + oip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(vdp)) { + softdep_change_linkcnt(oip); + } else { + oip->i_nlink++; + DIP_SET(oip, i_nlink, oip->i_nlink); + oip->i_flag |= IN_CHANGE; + } + return (error); } ep->d_ino = newinum; if (!OFSFMT(vdp)) From owner-svn-src-head@freebsd.org Sat Jan 11 03:59:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CCD91FCCAB; Sat, 11 Jan 2020 03:59:07 +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 47vmLf718yz4WfX; Sat, 11 Jan 2020 03:59:06 +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 EBF6F24C0F; Sat, 11 Jan 2020 03:59:06 +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 00B3x659099055; Sat, 11 Jan 2020 03:59:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B3x6Rn099054; Sat, 11 Jan 2020 03:59:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001110359.00B3x6Rn099054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jan 2020 03:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356628 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 356628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 03:59:07 -0000 Author: delphij Date: Sat Jan 11 03:59:06 2020 New Revision: 356628 URL: https://svnweb.freebsd.org/changeset/base/356628 Log: Require FAT to occupy at least one sector. Obtained from: Android https://r.android.com/1205830 MFC after: 3 days Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sat Jan 11 03:18:47 2020 (r356627) +++ head/sbin/fsck_msdosfs/boot.c Sat Jan 11 03:59:06 2020 (r356628) @@ -250,7 +250,7 @@ readboot(int dosfs, struct bootblock *boot) boot->FATsecs = boot->bpbFATsmall; } - if (boot->FATsecs > UINT32_MAX / boot->bpbFATs) { + if (boot->FATsecs < 1 || boot->FATsecs > UINT32_MAX / boot->bpbFATs) { pfatal("Invalid FATs(%u) with FATsecs(%zu)", boot->bpbFATs, (size_t)boot->FATsecs); return FSFATAL; From owner-svn-src-head@freebsd.org Sat Jan 11 04:02:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 146511FCE9F; Sat, 11 Jan 2020 04:02:41 +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 47vmQm6q0zz4X3g; Sat, 11 Jan 2020 04:02:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E545024DF5; Sat, 11 Jan 2020 04:02:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00B42eVc005304; Sat, 11 Jan 2020 04:02:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B42eHa005303; Sat, 11 Jan 2020 04:02:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001110402.00B42eHa005303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jan 2020 04:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356629 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 356629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 04:02:41 -0000 Author: delphij Date: Sat Jan 11 04:02:40 2020 New Revision: 356629 URL: https://svnweb.freebsd.org/changeset/base/356629 Log: Apply typo fix from NetBSD, we have already applied all NetBSD changes so update the NetBSD tag while I'm there. MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sat Jan 11 03:59:06 2020 (r356628) +++ head/sbin/fsck_msdosfs/boot.c Sat Jan 11 04:02:40 2020 (r356629) @@ -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 */ @@ -356,7 +356,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-head@freebsd.org Sat Jan 11 06:06:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EA241FEB17; Sat, 11 Jan 2020 06:06:14 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vq9L1hzfz4cTk; Sat, 11 Jan 2020 06:06:14 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qk1-f196.google.com with SMTP id a203so4093449qkc.3; Fri, 10 Jan 2020 22:06:14 -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=EElFlyyGLpfYNs+4KoYP45TBV9jcnPVh2up1K0flSYQ=; b=IwS8pAEZSPfnptPImpc2gxRUCw1q6Ozobo0iG8Hz63EV1sGYlR8zEoDwjVSkBSOR7e 85YT4ZTqB7+BLmXRj8iz1wHBkm5HUAmEazlwtT29FLwSESQe9SqS02Mk1GrpL5YMOj2j nGXJqRhPvQz+LBNUAv00FLB27jrhlIfh19Mb3oybJGi3RHHy+XbIjvJhp1wvacuhQVt3 NAWn2gq0cBKCx/qJyDRv60uWuwIZohCFgbKzerw1ltSmwMUr/ibRwSFiFnC5vPwfoWvL 131W5aEW2MXt8F5XeUiNMjMrgCycPIwbdv2dOrKHhcfbvaknz9/Pr3NZq9ZqhOtc/Sg1 vEqg== X-Gm-Message-State: APjAAAVmEd62Nzv2xjMDSLbpei+YJC2tVLSk5eD79yOwtrg1vfXi6hB3 egTBXnYIexrK2GFNsh7kKuZ9sCdH X-Google-Smtp-Source: APXvYqxTItSV9u/yKzMYuhY+wvqwHQ9JrUd46ab3o1/A8VkAGroyUQ1AJVlYcsJqjVJ8yJ4MCxKtxA== X-Received: by 2002:ae9:ef4b:: with SMTP id d72mr6473100qkg.27.1578722772845; Fri, 10 Jan 2020 22:06:12 -0800 (PST) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id k9sm2193465qtq.75.2020.01.10.22.06.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2020 22:06:12 -0800 (PST) Received: by mail-qt1-f176.google.com with SMTP id w47so4121706qtk.4; Fri, 10 Jan 2020 22:06:12 -0800 (PST) X-Received: by 2002:ac8:5149:: with SMTP id h9mr5648108qtn.123.1578722772210; Fri, 10 Jan 2020 22:06:12 -0800 (PST) MIME-Version: 1.0 References: <202001102122.00ALM37Q063532@repo.freebsd.org> In-Reply-To: <202001102122.00ALM37Q063532@repo.freebsd.org> From: Ryan Libby Date: Fri, 10 Jan 2020 22:06:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r356613 - head/sys/dev/virtio/network To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47vq9L1hzfz4cTk 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 06:06:14 -0000 On Fri, Jan 10, 2020 at 1:22 PM Gleb Smirnoff wrote: > > Author: glebius > Date: Fri Jan 10 21:22:03 2020 > New Revision: 356613 > URL: https://svnweb.freebsd.org/changeset/base/356613 > > Log: > Add pfil(9) hook to vtnet(4). > > The patch could be simplier, using only the second chunk to > vtnet_rxq_eof(), that passes full mbufs to pfil(9). Packet > filter would m_free() them in case of returning PFIL_DROPPED. > > However, we pretend to be a hardware driver, so we first try > to pass a memory buffer via PFIL_MEMPTR feature. This is mostly > done for debugging purposes, so that one can experiment in bhyve > with packet filters utilizing same features as a true driver. > > Modified: > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/network/if_vtnetvar.h > > Modified: head/sys/dev/virtio/network/if_vtnet.c > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnet.c Fri Jan 10 20:53:58 2020 (r356612) > +++ head/sys/dev/virtio/network/if_vtnet.c Fri Jan 10 21:22:03 2020 (r356613) > @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > @@ -935,6 +936,7 @@ static int > vtnet_setup_interface(struct vtnet_softc *sc) > { > device_t dev; > + struct pfil_head_args pa; > struct ifnet *ifp; > > dev = sc->vtnet_dev; > @@ -1038,6 +1040,12 @@ vtnet_setup_interface(struct vtnet_softc *sc) > > DEBUGNET_SET(ifp, vtnet); > > + pa.pa_version = PFIL_VERSION; > + pa.pa_flags = PFIL_IN; > + pa.pa_type = PFIL_TYPE_ETHERNET; > + pa.pa_headname = ifp->if_xname; > + sc->vtnet_pfil = pfil_head_register(&pa); > + > return (0); > } > > @@ -1773,9 +1781,11 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > struct vtnet_softc *sc; > struct ifnet *ifp; > struct virtqueue *vq; > - struct mbuf *m; > + struct mbuf *m, *mr; > struct virtio_net_hdr_mrg_rxbuf *mhdr; > int len, deq, nbufs, adjsz, count; > + pfil_return_t pfil; > + bool pfil_done; > > sc = rxq->vtnrx_sc; > vq = rxq->vtnrx_vq; > @@ -1812,6 +1822,35 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > adjsz = sizeof(struct virtio_net_hdr_mrg_rxbuf); > } > > + /* > + * If we have enough data in first mbuf, run it through > + * pfil as a memory buffer before dequeueing the rest. > + */ > + if (PFIL_HOOKED_IN(sc->vtnet_pfil) && > + len - adjsz >= ETHER_HDR_LEN + max_protohdr) { > + pfil = pfil_run_hooks(sc->vtnet_pfil, > + m->m_data + adjsz, ifp, > + len - adjsz | PFIL_MEMPTR | PFIL_IN, NULL); Hi Gleb, gcc wants (len - adjsz) paranthesized. https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/12838/ --- if_vtnet.o --- /workspace/src/sys/dev/virtio/network/if_vtnet.c: In function 'vtnet_rxq_eof': /workspace/src/sys/dev/virtio/network/if_vtnet.c:1833:12: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses] len - adjsz | PFIL_MEMPTR | PFIL_IN, NULL); ~~~~^~~~~~~ > + switch (pfil) { > + case PFIL_REALLOCED: > + mr = pfil_mem2mbuf(m->m_data + adjsz); > + vtnet_rxq_input(rxq, mr, hdr); > + /* FALLTHROUGH */ > + case PFIL_DROPPED: > + case PFIL_CONSUMED: > + vtnet_rxq_discard_buf(rxq, m); > + if (nbufs > 1) > + vtnet_rxq_discard_merged_bufs(rxq, > + nbufs); > + continue; > + default: > + KASSERT(pfil == PFIL_PASS, > + ("Filter returned %d!\n", pfil)); > + }; > + pfil_done = true; > + } else > + pfil_done = false; > + > if (vtnet_rxq_replace_buf(rxq, m, len) != 0) { > rxq->vtnrx_stats.vrxs_iqdrops++; > vtnet_rxq_discard_buf(rxq, m); > @@ -1841,6 +1880,19 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > */ > memcpy(hdr, mtod(m, void *), sizeof(struct virtio_net_hdr)); > m_adj(m, adjsz); > + > + if (PFIL_HOOKED_IN(sc->vtnet_pfil) && pfil_done == false) { > + pfil = pfil_run_hooks(sc->vtnet_pfil, &m, ifp, PFIL_IN, > + NULL); > + switch (pfil) { > + case PFIL_DROPPED: > + case PFIL_CONSUMED: > + continue; > + default: > + KASSERT(pfil == PFIL_PASS, > + ("Filter returned %d!\n", pfil)); > + } > + } > > vtnet_rxq_input(rxq, m, hdr); > > > Modified: head/sys/dev/virtio/network/if_vtnetvar.h > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnetvar.h Fri Jan 10 20:53:58 2020 (r356612) > +++ head/sys/dev/virtio/network/if_vtnetvar.h Fri Jan 10 21:22:03 2020 (r356613) > @@ -136,6 +136,7 @@ struct vtnet_softc { > struct ifnet *vtnet_ifp; > struct vtnet_rxq *vtnet_rxqs; > struct vtnet_txq *vtnet_txqs; > + pfil_head_t vtnet_pfil; > > uint32_t vtnet_flags; > #define VTNET_FLAG_SUSPENDED 0x0001 > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat Jan 11 09:08:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0580822321E; Sat, 11 Jan 2020 09:08:03 +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 47vvC66Pxfz3GyP; Sat, 11 Jan 2020 09:08:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D75AF58A; Sat, 11 Jan 2020 09:08:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00B9828i085253; Sat, 11 Jan 2020 09:08:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B982Ot085252; Sat, 11 Jan 2020 09:08:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001110908.00B982Ot085252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Jan 2020 09:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356630 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 356630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 09:08:03 -0000 Author: kib Date: Sat Jan 11 09:08:02 2020 New Revision: 356630 URL: https://svnweb.freebsd.org/changeset/base/356630 Log: Stop prepending prefix to the result of realpath(3). The path is already absolute. Noted and reviewed by: rstone Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23121 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jan 11 04:02:40 2020 (r356629) +++ head/libexec/rtld-elf/rtld.c Sat Jan 11 09:08:02 2020 (r356630) @@ -5524,7 +5524,7 @@ static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res) { - char *abspath, *absres, *binpath, *pathenv, *pe, *res1; + char *binpath, *pathenv, *pe, *res1; const char *res; int fd; @@ -5569,31 +5569,16 @@ open_binary_fd(const char *argv0, bool search_in_path, rtld_die(); } if (res != NULL && res[0] != '/') { - abspath = getcwd(NULL, 0); - if (abspath != NULL) { - res1 = xmalloc(PATH_MAX); - if (realpath(res, res1) != NULL) { - if (res != argv0) - free(__DECONST(char *, res)); - res = res1; - } else { - free(res1); - } - absres = xmalloc(strlen(abspath) + - strlen(res) + 2); - strcpy(absres, abspath); - strcat(absres, "/"); - strcat(absres, res); - free(abspath); + res1 = xmalloc(PATH_MAX); + if (realpath(res, res1) != NULL) { if (res != argv0) free(__DECONST(char *, res)); - *binpath_res = absres; + res = res1; } else { - *binpath_res = res; + free(res1); } - } else { - *binpath_res = res; } + *binpath_res = res; return (fd); } From owner-svn-src-head@freebsd.org Sat Jan 11 09:19:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1366C223458; Sat, 11 Jan 2020 09:19:00 +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 47vvRl6ltPz3HPs; Sat, 11 Jan 2020 09:18:59 +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 E317F783; Sat, 11 Jan 2020 09:18:59 +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 00B9IxCt091013; Sat, 11 Jan 2020 09:18:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00B9Iwhj091004; Sat, 11 Jan 2020 09:18:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001110918.00B9Iwhj091004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Jan 2020 09:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356631 - in head/libexec/rtld-elf: . amd64 arm i386 mips powerpc64 sparc64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/libexec/rtld-elf: . amd64 arm i386 mips powerpc64 sparc64 X-SVN-Commit-Revision: 356631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 09:19:00 -0000 Author: kib Date: Sat Jan 11 09:18:58 2020 New Revision: 356631 URL: https://svnweb.freebsd.org/changeset/base/356631 Log: rtld: clean up Makefile. Move all MD statements into $MACHINE_ARCH/Makefile.inc. Unconditionally apply version script to rtld, the interpreter is not functional without it for long time. Reviewed by: brooks, emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23083 Added: head/libexec/rtld-elf/mips/Makefile.inc (contents, props changed) Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/arm/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc head/libexec/rtld-elf/powerpc64/Makefile.inc head/libexec/rtld-elf/sparc64/Makefile.inc Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/Makefile Sat Jan 11 09:18:58 2020 (r356631) @@ -37,11 +37,6 @@ RTLD_ARCH= ${MACHINE_ARCH} RTLD_ARCH= ${MACHINE_CPUARCH} .endif CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} -.if ${MACHINE_ARCH} == "powerpc64" -LDFLAGS+= -nostdlib -e _rtld_start -.else -LDFLAGS+= -nostdlib -e .rtld_start -.endif NO_WCAST_ALIGN= yes WARNS?= 6 @@ -52,36 +47,14 @@ SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} MLINKS?= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+= -fPIC -.else -CFLAGS+= -fpic -.endif -CFLAGS+= -DPIC $(DEBUG) -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -fvisibility=hidden -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS.reloc.c+=-fno-jump-tables -.endif -LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs +CFLAGS+= -fpic -DPIC $(DEBUG) +LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs -nostdlib -e ${RTLD_ENTRY} # Pull in the dependencies that we use from libc .include "rtld-libc/Makefile.inc" .if ${MK_TOOLCHAIN} == "no" LDFLAGS+= -L${LIBCDIR} .endif -.if ${MACHINE_CPUARCH} == "arm" -# Some of the required math functions (div & mod) are implemented in -# libcompiler_rt on ARM. The library also needs to be placed first to be -# correctly linked. As some of the functions are used before we have -# shared libraries. -LIBADD+= compiler_rt -.endif - - - -.if ${MK_SYMVER} == "yes" VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map VERSION_MAP= Version.map @@ -90,9 +63,9 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map .endif -.endif .sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" +RTLD_ENTRY?= .rtld_start # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/amd64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1,3 +1,3 @@ # $FreeBSD$ -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -fvisibility=hidden Modified: head/libexec/rtld-elf/arm/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/arm/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/arm/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,7 @@ # $FreeBSD$ + +# Some of the required math functions (div & mod) are implemented in +# libcompiler_rt on ARM. The library also needs to be placed first to be +# correctly linked. As some of the functions are used before we have +# shared libraries. +LIBADD+= compiler_rt Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/i386/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1,3 +1,3 @@ # $FreeBSD$ -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float +CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -fvisibility=hidden Added: head/libexec/rtld-elf/mips/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/mips/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +CFLAGS.reloc.c+=-fno-jump-tables Modified: head/libexec/rtld-elf/powerpc64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/powerpc64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/powerpc64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,3 @@ # $FreeBSD$ + +RTLD_ENTRY= _rtld_start Modified: head/libexec/rtld-elf/sparc64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/sparc64/Makefile.inc Sat Jan 11 09:08:02 2020 (r356630) +++ head/libexec/rtld-elf/sparc64/Makefile.inc Sat Jan 11 09:18:58 2020 (r356631) @@ -1 +1,3 @@ # $FreeBSD$ + +CFLAGS:=${CFLAGS:S/-fpic/-fPIC/} From owner-svn-src-head@freebsd.org Sat Jan 11 11:38:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E347822696F; Sat, 11 Jan 2020 11:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vyXB5pCKz3xpC; Sat, 11 Jan 2020 11:38:02 +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 C21F321BE; Sat, 11 Jan 2020 11:38:02 +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 00BBc22O078677; Sat, 11 Jan 2020 11:38:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BBc2cN078676; Sat, 11 Jan 2020 11:38:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001111138.00BBc2cN078676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 11 Jan 2020 11:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356632 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 356632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 11:38:03 -0000 Author: hselasky Date: Sat Jan 11 11:38:02 2020 New Revision: 356632 URL: https://svnweb.freebsd.org/changeset/base/356632 Log: Revert r356598 for now because it breaks some AMD based XHCI controllers. Reported by: jkim @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sat Jan 11 09:18:58 2020 (r356631) +++ head/sys/dev/usb/controller/xhci.c Sat Jan 11 11:38:02 2020 (r356632) @@ -1598,26 +1598,10 @@ static usb_error_t xhci_cmd_stop_ep(struct xhci_softc *sc, uint8_t suspend, uint8_t ep_id, uint8_t slot_id) { - struct usb_page_search buf_dev; - struct xhci_dev_ctx *pdev; struct xhci_trb trb; uint32_t temp; DPRINTF("\n"); - - usbd_get_page(&sc->sc_hw.devs[slot_id].device_pc, 0, &buf_dev); - pdev = buf_dev.buffer; - usb_pc_cpu_invalidate(&sc->sc_hw.devs[slot_id].device_pc); - - switch (XHCI_EPCTX_0_EPSTATE_GET(pdev->ctx_ep[ep_id - 1].dwEpCtx0)) { - case XHCI_EPCTX_0_EPSTATE_DISABLED: - case XHCI_EPCTX_0_EPSTATE_STOPPED: - DPRINTF("Endpoint %u on slot %u is already stopped\n", - ep_id, slot_id); - return (USB_ERR_NORMAL_COMPLETION); - default: - break; - } trb.qwTrb0 = 0; trb.dwTrb2 = 0; From owner-svn-src-head@freebsd.org Sat Jan 11 12:02:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA28A227D28; Sat, 11 Jan 2020 12:02:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vz485tVpz40bW; Sat, 11 Jan 2020 12:02:16 +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 C53EA274D; Sat, 11 Jan 2020 12:02:16 +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 00BC2Gj8096224; Sat, 11 Jan 2020 12:02:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BC2GZH096212; Sat, 11 Jan 2020 12:02:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001111202.00BC2GZH096212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 11 Jan 2020 12:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356633 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 356633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 12:02:17 -0000 Author: hselasky Date: Sat Jan 11 12:02:16 2020 New Revision: 356633 URL: https://svnweb.freebsd.org/changeset/base/356633 Log: Make sure the VNET is properly set when reaping mbufs in ipoib. Else the following panic may happen: panic() icmp_error() ipoib_cm_mb_reap() linux_work_fn() taskqueue_run_locked() taskqueue_thread_loop() fork_exit() fork_trampoline() Submitted by: Andreas Kempe MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Jan 11 11:38:02 2020 (r356632) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Jan 11 12:02:16 2020 (r356633) @@ -1268,6 +1268,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); + CURVNET_SET_QUIET(priv->dev->if_vnet); + for (;;) { IF_DEQUEUE(&priv->cm.mb_queue, mb); if (mb == NULL) @@ -1293,6 +1295,8 @@ static void ipoib_cm_mb_reap(struct work_struct *work) spin_lock_irqsave(&priv->lock, flags); } + + CURVNET_RESTORE(); spin_unlock_irqrestore(&priv->lock, flags); } From owner-svn-src-head@freebsd.org Sat Jan 11 17:41:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7D1C1F0514; Sat, 11 Jan 2020 17:41:20 +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 47w6bN4Xg9z4Jk2; Sat, 11 Jan 2020 17:41:20 +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 9713367A3; Sat, 11 Jan 2020 17:41:20 +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 00BHfKxw099467; Sat, 11 Jan 2020 17:41:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BHfK23099466; Sat, 11 Jan 2020 17:41:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202001111741.00BHfK23099466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jan 2020 17:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356636 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 356636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 17:41:20 -0000 Author: delphij Date: Sat Jan 11 17:41:20 2020 New Revision: 356636 URL: https://svnweb.freebsd.org/changeset/base/356636 Log: 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 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23082 Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sat Jan 11 16:28:35 2020 (r356635) +++ head/sbin/fsck_msdosfs/boot.c Sat Jan 11 17:41:20 2020 (r356636) @@ -266,8 +266,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) { if (boot->NumClusters > (CLUST_RSRVD & CLUST32_MASK)) { @@ -310,11 +313,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; From owner-svn-src-head@freebsd.org Sat Jan 11 18:36:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54B4B1F191F; Sat, 11 Jan 2020 18:36:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47w7pg1b9jz4MPT; Sat, 11 Jan 2020 18:36:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D5C77249; Sat, 11 Jan 2020 18:36:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00BIaBFj031864; Sat, 11 Jan 2020 18:36:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BIaAjY031862; Sat, 11 Jan 2020 18:36:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001111836.00BIaAjY031862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 11 Jan 2020 18:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356637 - in head/sys: dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 356637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 18:36:11 -0000 Author: manu Date: Sat Jan 11 18:36:10 2020 New Revision: 356637 URL: https://svnweb.freebsd.org/changeset/base/356637 Log: arm64: allwinner: dtso: Add spi0 spigen DTSO This overlays can be used on A64 board to use spigen and spi(8) on the spi0 pins. Tested On: Pine64-LTS, A64-Olinuxino Submitted by: Gary Otten Added: head/sys/dts/arm64/overlays/sun50i-a64-spi0-spigen.dtso (contents, props changed) Modified: head/sys/modules/dtb/allwinner/Makefile Added: head/sys/dts/arm64/overlays/sun50i-a64-spi0-spigen.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-a64-spi0-spigen.dtso Sat Jan 11 18:36:10 2020 (r356637) @@ -0,0 +1,17 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&{/soc/spi@1c68000} { + status = "okay"; + + spigen0: spigen0 { + compatible = "freebsd,spigen"; + reg = <0>; + spi-max-frequency = <500000>; + status = "okay"; + }; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Sat Jan 11 17:41:20 2020 (r356636) +++ head/sys/modules/dtb/allwinner/Makefile Sat Jan 11 18:36:10 2020 (r356637) @@ -54,6 +54,7 @@ DTSO= sun50i-a64-opp.dtso \ sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-sid.dtso \ + sun50i-a64-spi0-spigen.dtso \ sun50i-a64-ths.dtso \ sun50i-a64-timer.dtso \ sun50i-h5-opp.dtso \ From owner-svn-src-head@freebsd.org Sat Jan 11 18:55:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23DC11F1F58; Sat, 11 Jan 2020 18:55:13 +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 47w8Dd09Cnz4NLw; Sat, 11 Jan 2020 18:55:13 +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 00D9775E0; Sat, 11 Jan 2020 18:55:13 +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 00BItCcg043792; Sat, 11 Jan 2020 18:55:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BItCxW043787; Sat, 11 Jan 2020 18:55:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001111855.00BItCxW043787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 11 Jan 2020 18:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356638 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 356638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 18:55:13 -0000 Author: bz Date: Sat Jan 11 18:55:12 2020 New Revision: 356638 URL: https://svnweb.freebsd.org/changeset/base/356638 Log: in6_mcast: make in6_joingroup_locked() static in6_joingroup_locked() is only used file-local. No need to export it hance make it static. Modified: head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Sat Jan 11 18:36:10 2020 (r356637) +++ head/sys/netinet6/in6_mcast.c Sat Jan 11 18:55:12 2020 (r356638) @@ -121,8 +121,6 @@ MTX_SYSINIT(in6_multi_free_mtx, &in6_multi_free_mtx, " struct sx in6_multi_sx; SX_SYSINIT(in6_multi_sx, &in6_multi_sx, "in6_multi_sx"); - - static void im6f_commit(struct in6_mfilter *); static int im6f_get_source(struct in6_mfilter *imf, const struct sockaddr_in6 *psin, @@ -144,6 +142,8 @@ static void im6s_merge(struct ip6_msource *ims, const struct in6_msource *lims, const int rollback); static int in6_getmulti(struct ifnet *, const struct in6_addr *, struct in6_multi **); +static int in6_joingroup_locked(struct ifnet *, const struct in6_addr *, + struct in6_mfilter *, struct in6_multi **, int); static int in6m_get_source(struct in6_multi *inm, const struct in6_addr *addr, const int noalloc, struct ip6_msource **pims); @@ -1197,7 +1197,7 @@ in6_joingroup(struct ifnet *ifp, const struct in6_addr * If the MLD downcall fails, the group is not joined, and an error * code is returned. */ -int +static int in6_joingroup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr, /*const*/ struct in6_mfilter *imf, struct in6_multi **pinm, const int delay) Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sat Jan 11 18:36:10 2020 (r356637) +++ head/sys/netinet6/in6_var.h Sat Jan 11 18:55:12 2020 (r356638) @@ -863,8 +863,6 @@ int im6o_mc_filter(const struct ip6_moptions *, const const struct sockaddr *, const struct sockaddr *); int in6_joingroup(struct ifnet *, const struct in6_addr *, struct in6_mfilter *, struct in6_multi **, int); -int in6_joingroup_locked(struct ifnet *, const struct in6_addr *, - struct in6_mfilter *, struct in6_multi **, int); int in6_leavegroup(struct in6_multi *, struct in6_mfilter *); int in6_leavegroup_locked(struct in6_multi *, struct in6_mfilter *); void in6m_clear_recorded(struct in6_multi *); From owner-svn-src-head@freebsd.org Sat Jan 11 19:12:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E24C1F2638; Sat, 11 Jan 2020 19:12:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 47w8d42hKzz4PSn; Sat, 11 Jan 2020 19:12:56 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f51.google.com with SMTP id c16so5560761ioh.6; Sat, 11 Jan 2020 11:12:56 -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=g5zxvE/7aQ6l3VzZs3rsZJHUTxnwELaBPeaobzp9MjM=; b=infrJsSZgYvy3D55CHsnPS89JgqYaLJXWBD02MkR5yd+WB2FotXWFlRXexZPhcKxzz P+8lpiZVwdkwda7W+aboJFtcFv6Sy4twX2BuDTZ3JwWZ8jdBCcLga8koeoxIgn80MmBL yOm6O49Uv1RKdqZDWomLJKimT/3fnbYArlWgG9YWSC8qRCvlbi6b/1mWcbfh4YC3wLZp zP5tJ6lsQCDx243m4KzGMorWDqzkmku8W2PgKx7fxSJw8zqPGbKvQCepYyfSPkJk0P3X /cU7PFJ1MGgtr1FtcikoW26egwDRrGSxkH/TneTAnUw196DR2IK8hdGR+gGIM4rMYZaP 2a4g== X-Gm-Message-State: APjAAAU0+v2rFDcj8UgmWSbS1FrgCFoo1Ez7lInTTBhEDw4b/I3FWgtL RxiZnZRJ1GzmrEQtpkg7H0jSLzLU2XfgJtblgn1C7w== X-Google-Smtp-Source: APXvYqwMZX86IulOVuMVKvrXnjJ+zTdC79I5ptnHSizUBfE0t9sO4AMdqgNdlAPl65jYQuO1vU6IqDnI83vkGXdwOvQ= X-Received: by 2002:a02:ba91:: with SMTP id g17mr8596219jao.106.1578769975205; Sat, 11 Jan 2020 11:12:55 -0800 (PST) MIME-Version: 1.0 References: <202001102200.00AM0eBf082664@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Sat, 11 Jan 2020 14:12:42 -0500 Message-ID: Subject: Re: svn commit: r356615 - head/share/mk To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47w8d42hKzz4PSn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.51 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[51.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.12)[ip: (-5.62), ipnet: 209.85.128.0/17(-3.09), asn: 15169(-1.84), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[51.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 19:12:57 -0000 On Fri, 10 Jan 2020 at 18:18, Enji Cooper wrote: > > If `MK_CRYPT == no`'s setting of `MK_KERBEROS:=no` was moved here, > then the rest would just work by virtue of precedence. As far as I can tell that doesn't actually work, but I haven't looked in detail to figure out why. From owner-svn-src-head@freebsd.org Sat Jan 11 20:07:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2236E1F39F7; Sat, 11 Jan 2020 20:07:31 +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 47w9r26yyjz4S10; Sat, 11 Jan 2020 20:07:30 +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 EA88382D0; Sat, 11 Jan 2020 20:07:30 +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 00BK7UU4086405; Sat, 11 Jan 2020 20:07:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BK7UOQ086404; Sat, 11 Jan 2020 20:07:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001112007.00BK7UOQ086404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 11 Jan 2020 20:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356639 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 356639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 20:07:31 -0000 Author: glebius Date: Sat Jan 11 20:07:30 2020 New Revision: 356639 URL: https://svnweb.freebsd.org/changeset/base/356639 Log: Pacify gcc. Reported by: rlibby Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Jan 11 18:55:12 2020 (r356638) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Jan 11 20:07:30 2020 (r356639) @@ -1830,7 +1830,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) len - adjsz >= ETHER_HDR_LEN + max_protohdr) { pfil = pfil_run_hooks(sc->vtnet_pfil, m->m_data + adjsz, ifp, - len - adjsz | PFIL_MEMPTR | PFIL_IN, NULL); + (len - adjsz) | PFIL_MEMPTR | PFIL_IN, NULL); switch (pfil) { case PFIL_REALLOCED: mr = pfil_mem2mbuf(m->m_data + adjsz); From owner-svn-src-head@freebsd.org Sat Jan 11 22:29:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E40CE1F6AA0; Sat, 11 Jan 2020 22:29:44 +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 47wF085XqVz4Ym3; Sat, 11 Jan 2020 22:29:44 +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 B98179C35; Sat, 11 Jan 2020 22:29:44 +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 00BMTi6G071795; Sat, 11 Jan 2020 22:29:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMTim4071794; Sat, 11 Jan 2020 22:29:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001112229.00BMTim4071794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 11 Jan 2020 22:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356640 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 356640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:29:45 -0000 Author: jhibbits Date: Sat Jan 11 22:29:44 2020 New Revision: 356640 URL: https://svnweb.freebsd.org/changeset/base/356640 Log: powerpc/mpc85xx: Fix localbus child reg property decoding r302340, as an attempt to fix the localbus child handling post-rman change, actually broke child resource allocation, due to typos in fdt_lbc_reg_decode(). This went unnoticed because there aren't any drivers currently in tree that use localbus. Modified: head/sys/powerpc/mpc85xx/lbc.c Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Sat Jan 11 20:07:30 2020 (r356639) +++ head/sys/powerpc/mpc85xx/lbc.c Sat Jan 11 22:29:44 2020 (r356640) @@ -391,13 +391,13 @@ fdt_lbc_reg_decode(phandle_t node, struct lbc_softc *s /* Get address/size. */ start = count = 0; - for (j = 0; j < addr_cells; j++) { + for (j = 0; j < addr_cells - 1; j++) { start <<= 32; start |= reg[j]; } for (j = 0; j < size_cells; j++) { count <<= 32; - count |= reg[addr_cells + j - 1]; + count |= reg[addr_cells + j]; } reg += addr_cells - 1 + size_cells; From owner-svn-src-head@freebsd.org Sat Jan 11 22:55:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC0761F742A; Sat, 11 Jan 2020 22:55: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 47wFYX5wxZz4b2G; Sat, 11 Jan 2020 22:55: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 C28A8A19F; Sat, 11 Jan 2020 22:55: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 00BMtCDX089915; Sat, 11 Jan 2020 22:55:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMtCts089914; Sat, 11 Jan 2020 22:55:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112255.00BMtCts089914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 22:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356641 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:55:13 -0000 Author: mjg Date: Sat Jan 11 22:55:12 2020 New Revision: 356641 URL: https://svnweb.freebsd.org/changeset/base/356641 Log: vfs: add missing CLTFLA_MPSAFE annotations This covers all kern/vfs_*.c files. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:29:44 2020 (r356640) +++ head/sys/kern/vfs_subr.c Sat Jan 11 22:55:12 2020 (r356641) @@ -2404,7 +2404,8 @@ sysctl_vfs_worklist_len(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_vfs, OID_AUTO, worklist_len, CTLTYPE_INT | CTLFLAG_RD, NULL, 0, +SYSCTL_PROC(_vfs, OID_AUTO, worklist_len, + CTLTYPE_INT | CTLFLAG_MPSAFE| CTLFLAG_RD, NULL, 0, sysctl_vfs_worklist_len, "I", "Syncer thread worklist length"); static struct proc *updateproc; @@ -5467,7 +5468,7 @@ sysctl_vfs_ctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE | CTLFLAG_WR, +SYSCTL_PROC(_vfs, OID_AUTO, ctl, CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_WR, NULL, 0, sysctl_vfs_ctl, "", "Sysctl by fsid"); From owner-svn-src-head@freebsd.org Sat Jan 11 22:56:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C634F1F7608; Sat, 11 Jan 2020 22:56:21 +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 47wFZs4vT7z4bDB; Sat, 11 Jan 2020 22:56:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E75A1A0; Sat, 11 Jan 2020 22:56:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00BMuLnT090007; Sat, 11 Jan 2020 22:56:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMuKI3090003; Sat, 11 Jan 2020 22:56:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112256.00BMuKI3090003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 22:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356642 - 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: 356642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:56:21 -0000 Author: mjg Date: Sat Jan 11 22:56:20 2020 New Revision: 356642 URL: https://svnweb.freebsd.org/changeset/base/356642 Log: vfs: incomplete pass at converting more ints to u_long Most notably numvnodes and freevnodes were u_long, but parameters used to govern them remained as ints. Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_hash.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_cache.c Sat Jan 11 22:56:20 2020 (r356642) @@ -1979,13 +1979,13 @@ nchinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); void -cache_changesize(int newmaxvnodes) +cache_changesize(u_long newmaxvnodes) { struct nchashhead *new_nchashtbl, *old_nchashtbl; u_long new_nchash, old_nchash; struct namecache *ncp; uint32_t hash; - int newncsize; + u_long newncsize; int i; newncsize = newmaxvnodes * ncsizefactor; Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_hash.c Sat Jan 11 22:56:20 2020 (r356642) @@ -199,7 +199,7 @@ vfs_hash_rehash(struct vnode *vp, u_int hash) } void -vfs_hash_changesize(int newmaxvnodes) +vfs_hash_changesize(u_long newmaxvnodes) { struct vfs_hash_head *vfs_hash_newtbl, *vfs_hash_oldtbl; u_long vfs_hash_newmask, vfs_hash_oldmask; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_subr.c Sat Jan 11 22:56:20 2020 (r356642) @@ -310,20 +310,21 @@ static enum { SYNCER_RUNNING, SYNCER_SHUTTING_DOWN, SY syncer_state; /* Target for maximum number of vnodes. */ -int desiredvnodes; -static int gapvnodes; /* gap between wanted and desired */ -static int vhiwat; /* enough extras after expansion */ -static int vlowat; /* minimal extras before expansion */ -static int vstir; /* nonzero to stir non-free vnodes */ +u_long desiredvnodes; +static u_long gapvnodes; /* gap between wanted and desired */ +static u_long vhiwat; /* enough extras after expansion */ +static u_long vlowat; /* minimal extras before expansion */ +static u_long vstir; /* nonzero to stir non-free vnodes */ static volatile int vsmalltrigger = 8; /* pref to keep if > this many pages */ static int sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) { - int error, old_desiredvnodes; + u_long old_desiredvnodes; + int error; old_desiredvnodes = desiredvnodes; - if ((error = sysctl_handle_int(oidp, arg1, arg2, req)) != 0) + if ((error = sysctl_handle_long(oidp, arg1, arg2, req)) != 0) return (error); if (old_desiredvnodes != desiredvnodes) { wantfreevnodes = desiredvnodes / 4; @@ -336,7 +337,7 @@ sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0, - sysctl_update_desiredvnodes, "I", "Target for maximum number of vnodes"); + sysctl_update_desiredvnodes, "UL", "Target for maximum number of vnodes"); SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)"); static int vnlru_nowhere; @@ -459,7 +460,7 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_ * grows, the ratio of the memory size in KB to vnodes approaches 64:1. */ #ifndef MAXVNODES_MAX -#define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */ +#define MAXVNODES_MAX (512UL * 1024 * 1024 / 64) /* 8M */ #endif static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); @@ -582,7 +583,7 @@ vntblinit(void *dummy __unused) desiredvnodes = min(physvnodes, virtvnodes); if (desiredvnodes > MAXVNODES_MAX) { if (bootverbose) - printf("Reducing kern.maxvnodes %d -> %d\n", + printf("Reducing kern.maxvnodes %lu -> %lu\n", desiredvnodes, MAXVNODES_MAX); desiredvnodes = MAXVNODES_MAX; } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/sys/vnode.h Sat Jan 11 22:56:20 2020 (r356642) @@ -434,7 +434,7 @@ extern int vttoif_tab[]; */ extern struct vnode *rootvnode; /* root (i.e. "/") vnode */ extern struct mount *rootdevmp; /* "/dev" mount */ -extern int desiredvnodes; /* number of vnodes desired */ +extern u_long desiredvnodes; /* number of vnodes desired */ extern struct uma_zone *namei_zone; extern struct vattr va_null; /* predefined null vattr structure */ @@ -607,7 +607,7 @@ typedef int (*vn_get_ino_t)(struct mount *, void *, in int bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn); /* cache_* may belong in namei.h. */ -void cache_changesize(int newhashsize); +void cache_changesize(u_long newhashsize); #define cache_enter(dvp, vp, cnp) \ cache_enter_time(dvp, vp, cnp, NULL, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, @@ -924,7 +924,7 @@ int fifo_printinfo(struct vnode *); /* vfs_hash.c */ typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); -void vfs_hash_changesize(int newhashsize); +void vfs_hash_changesize(u_long newhashsize); int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp); From owner-svn-src-head@freebsd.org Sat Jan 11 22:58:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9703F1F7955; Sat, 11 Jan 2020 22:58:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wFd43VTyz4bWt; Sat, 11 Jan 2020 22:58:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7352EA1A3; Sat, 11 Jan 2020 22:58:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00BMwG6n090265; Sat, 11 Jan 2020 22:58:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMwEM0090257; Sat, 11 Jan 2020 22:58:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112258.00BMwEM0090257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 22:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356643 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Commit-Revision: 356643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:58:16 -0000 Author: mjg Date: Sat Jan 11 22:58:14 2020 New Revision: 356643 URL: https://svnweb.freebsd.org/changeset/base/356643 Log: vfs: prealloc vnodes in getnewvnode_reserve Having a reserved vnode count does not guarantee that getnewvnodes wont block later. Said blocking partially defeats the purpose of reserving in the first place. Preallocate instaed. The only consumer was always passing "1" as count and never nesting reservations. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.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 head/sys/kern/kern_thread.c head/sys/kern/subr_trap.c head/sys/kern/vfs_subr.c head/sys/sys/proc.h head/sys/sys/vnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sat Jan 11 22:58:14 2020 (r356643) @@ -815,7 +815,7 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *vap, vnode_t * return (SET_ERROR(EDQUOT)); } - getnewvnode_reserve(1); + getnewvnode_reserve(); tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + 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 Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jan 11 22:58:14 2020 (r356643) @@ -1800,7 +1800,7 @@ zfs_create(vnode_t *dvp, char *name, vattr_t *vap, int goto out; } - getnewvnode_reserve(1); + getnewvnode_reserve(); tx = dmu_tx_create(os); @@ -2092,7 +2092,7 @@ zfs_mkdir(vnode_t *dvp, char *dirname, vattr_t *vap, v /* * Add a new entry to the directory. */ - getnewvnode_reserve(1); + getnewvnode_reserve(); tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_zap(tx, dzp->z_id, TRUE, dirname); dmu_tx_hold_zap(tx, DMU_NEW_OBJECT, FALSE, NULL); @@ -4003,7 +4003,7 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, char *name, v return (SET_ERROR(EDQUOT)); } - getnewvnode_reserve(1); + getnewvnode_reserve(); tx = dmu_tx_create(zfsvfs->z_os); fuid_dirtied = zfsvfs->z_fuid_dirty; dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, MAX(1, len)); 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 Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jan 11 22:58:14 2020 (r356643) @@ -644,8 +644,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int b zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - KASSERT(curthread->td_vp_reserv > 0, - ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); + KASSERT(curthread->td_vp_reserved != NULL, + ("zfs_znode_alloc: getnewvnode without preallocated vnode")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -1157,7 +1157,7 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t * int err; td = curthread; - getnewvnode_reserve(1); + getnewvnode_reserve(); again: *zpp = NULL; ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/kern/kern_thread.c Sat Jan 11 22:58:14 2020 (r356643) @@ -82,7 +82,7 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x "struct thread KBI td_flags"); _Static_assert(offsetof(struct thread, td_pflags) == 0x104, "struct thread KBI td_pflags"); -_Static_assert(offsetof(struct thread, td_frame) == 0x478, +_Static_assert(offsetof(struct thread, td_frame) == 0x480, "struct thread KBI td_frame"); _Static_assert(offsetof(struct thread, td_emuldata) == 0x690, "struct thread KBI td_emuldata"); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/kern/subr_trap.c Sat Jan 11 22:58:14 2020 (r356643) @@ -187,8 +187,8 @@ userret(struct thread *td, struct trapframe *frame) } KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, ("userret: Returning with with pinned thread")); - KASSERT(td->td_vp_reserv == 0, - ("userret: Returning while holding vnode reservation")); + KASSERT(td->td_vp_reserved == NULL, + ("userret: Returning with preallocated vnode")); KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, ("userret: Returning with stop signals deferred")); KASSERT(td->td_su == NULL, Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/kern/vfs_subr.c Sat Jan 11 22:58:14 2020 (r356643) @@ -1527,40 +1527,29 @@ getnewvnode_wait(int suspended) * watermark handling works. */ void -getnewvnode_reserve(u_int count) +getnewvnode_reserve(void) { u_long rnumvnodes, rfreevnodes; struct thread *td; - /* Pre-adjust like the pre-adjust in getnewvnode(), with any count. */ - /* XXX no longer so quick, but this part is not racy. */ + td = curthread; + MPASS(td->td_vp_reserved == NULL); + mtx_lock(&vnode_free_list_mtx); rnumvnodes = atomic_load_long(&numvnodes); rfreevnodes = atomic_load_long(&freevnodes); - if (rnumvnodes + count > desiredvnodes && rfreevnodes > wantfreevnodes) - vnlru_free_locked(ulmin(rnumvnodes + count - desiredvnodes, + if (rnumvnodes + 1 > desiredvnodes && rfreevnodes > wantfreevnodes) + vnlru_free_locked(ulmin(rnumvnodes + 1 - desiredvnodes, rfreevnodes - wantfreevnodes), NULL); - mtx_unlock(&vnode_free_list_mtx); - - td = curthread; - /* First try to be quick and racy. */ - if (atomic_fetchadd_long(&numvnodes, count) + count <= desiredvnodes) { - td->td_vp_reserv += count; - vcheckspace(); /* XXX no longer so quick, but more racy */ - return; - } else - atomic_subtract_long(&numvnodes, count); - - mtx_lock(&vnode_free_list_mtx); - while (count > 0) { - if (getnewvnode_wait(0) == 0) { - count--; - td->td_vp_reserv++; - atomic_add_long(&numvnodes, 1); - } + if (rnumvnodes + 1 > desiredvnodes) { + while (getnewvnode_wait(0) != 0) + continue; } vcheckspace(); + atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); + + td->td_vp_reserved = uma_zalloc(vnode_zone, M_WAITOK); } /* @@ -1577,8 +1566,11 @@ getnewvnode_drop_reserve(void) struct thread *td; td = curthread; - atomic_subtract_long(&numvnodes, td->td_vp_reserv); - td->td_vp_reserv = 0; + if (td->td_vp_reserved != NULL) { + atomic_subtract_long(&numvnodes, 1); + uma_zfree(vnode_zone, td->td_vp_reserved); + td->td_vp_reserved = NULL; + } } /* @@ -1599,11 +1591,11 @@ getnewvnode(const char *tag, struct mount *mp, struct KASSERT(vops->registered, ("%s: not registered vector op %p\n", __func__, vops)); - vp = NULL; td = curthread; - if (td->td_vp_reserv > 0) { - td->td_vp_reserv -= 1; - goto alloc; + if (td->td_vp_reserved != NULL) { + vp = td->td_vp_reserved; + td->td_vp_reserved = NULL; + goto init; } mtx_lock(&vnode_free_list_mtx); if (numvnodes < desiredvnodes) @@ -1639,9 +1631,9 @@ getnewvnode(const char *tag, struct mount *mp, struct vcheckspace(); atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); -alloc: - counter_u64_add(vnodes_created, 1); vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK); +init: + counter_u64_add(vnodes_created, 1); /* * Locks are given the generic name "vnode" when created. * Follow the historic practice of using the filesystem Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/sys/proc.h Sat Jan 11 22:58:14 2020 (r356643) @@ -297,7 +297,7 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ - u_int td_vp_reserv; /* (k) Count of reserved vnodes. */ + struct vnode *td_vp_reserved;/* (k) Prealloated vnode. */ u_int td_no_sleeping; /* (k) Sleeping disabled count. */ void *td_su; /* (k) FFS SU private */ sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jan 11 22:56:20 2020 (r356642) +++ head/sys/sys/vnode.h Sat Jan 11 22:58:14 2020 (r356643) @@ -624,7 +624,7 @@ void freebsd11_cvtnstat(struct stat *sb, struct nstat int freebsd11_cvtstat(struct stat *st, struct freebsd11_stat *ost); int getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp); -void getnewvnode_reserve(u_int count); +void getnewvnode_reserve(void); void getnewvnode_drop_reserve(void); int insmntque1(struct vnode *vp, struct mount *mp, void (*dtr)(struct vnode *, void *), void *dtr_arg); From owner-svn-src-head@freebsd.org Sat Jan 11 22:59:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F25741F7A05; Sat, 11 Jan 2020 22:59:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wFfm69Dkz4bfW; Sat, 11 Jan 2020 22:59: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 CEFF2A1A4; Sat, 11 Jan 2020 22:59: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 00BMxivW090370; Sat, 11 Jan 2020 22:59:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMxiZk090369; Sat, 11 Jan 2020 22:59:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112259.00BMxiZk090369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 22:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356644 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:59:45 -0000 Author: mjg Date: Sat Jan 11 22:59:44 2020 New Revision: 356644 URL: https://svnweb.freebsd.org/changeset/base/356644 Log: vfs: deduplicate vnode allocation logic This creates a dedicated routine (vn_alloc) to allocate vnodes. As a side effect code duplicationw with getnewvnode_reserve is eleminated. Add vn_free for symmetry. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:58:14 2020 (r356643) +++ head/sys/kern/vfs_subr.c Sat Jan 11 22:59:44 2020 (r356644) @@ -1496,7 +1496,7 @@ vcheckspace(void) * Wait if necessary for space for a new vnode. */ static int -getnewvnode_wait(int suspended) +vn_alloc_wait(int suspended) { mtx_assert(&vnode_free_list_mtx, MA_OWNED); @@ -1522,81 +1522,12 @@ getnewvnode_wait(int suspended) return (numvnodes >= desiredvnodes ? ENFILE : 0); } -/* - * This hack is fragile, and probably not needed any more now that the - * watermark handling works. - */ -void -getnewvnode_reserve(void) +static struct vnode * +vn_alloc(struct mount *mp) { - u_long rnumvnodes, rfreevnodes; - struct thread *td; - - td = curthread; - MPASS(td->td_vp_reserved == NULL); - - mtx_lock(&vnode_free_list_mtx); - rnumvnodes = atomic_load_long(&numvnodes); - rfreevnodes = atomic_load_long(&freevnodes); - if (rnumvnodes + 1 > desiredvnodes && rfreevnodes > wantfreevnodes) - vnlru_free_locked(ulmin(rnumvnodes + 1 - desiredvnodes, - rfreevnodes - wantfreevnodes), NULL); - if (rnumvnodes + 1 > desiredvnodes) { - while (getnewvnode_wait(0) != 0) - continue; - } - vcheckspace(); - atomic_add_long(&numvnodes, 1); - mtx_unlock(&vnode_free_list_mtx); - - td->td_vp_reserved = uma_zalloc(vnode_zone, M_WAITOK); -} - -/* - * This hack is fragile, especially if desiredvnodes or wantvnodes are - * misconfgured or changed significantly. Reducing desiredvnodes below - * the reserved amount should cause bizarre behaviour like reducing it - * below the number of active vnodes -- the system will try to reduce - * numvnodes to match, but should fail, so the subtraction below should - * not overflow. - */ -void -getnewvnode_drop_reserve(void) -{ - struct thread *td; - - td = curthread; - if (td->td_vp_reserved != NULL) { - atomic_subtract_long(&numvnodes, 1); - uma_zfree(vnode_zone, td->td_vp_reserved); - td->td_vp_reserved = NULL; - } -} - -/* - * Return the next vnode from the free list. - */ -int -getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, - struct vnode **vpp) -{ - struct vnode *vp; - struct thread *td; - struct lock_object *lo; static int cyclecount; int error __unused; - CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); - - KASSERT(vops->registered, - ("%s: not registered vector op %p\n", __func__, vops)); - - td = curthread; - if (td->td_vp_reserved != NULL) { - vp = td->td_vp_reserved; - td->td_vp_reserved = NULL; - goto init; - } mtx_lock(&vnode_free_list_mtx); if (numvnodes < desiredvnodes) cyclecount = 0; @@ -1619,7 +1550,7 @@ getnewvnode(const char *tag, struct mount *mp, struct else if (freevnodes > 0) vnlru_free_locked(1, NULL); else { - error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag & + error = vn_alloc_wait(mp != NULL && (mp->mnt_kern_flag & MNTK_SUSPEND)); #if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ if (error != 0) { @@ -1631,8 +1562,40 @@ getnewvnode(const char *tag, struct mount *mp, struct vcheckspace(); atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); - vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK); -init: + return (uma_zalloc(vnode_zone, M_WAITOK)); +} + +static void +vn_free(struct vnode *vp) +{ + + atomic_subtract_long(&numvnodes, 1); + uma_zfree(vnode_zone, vp); +} + +/* + * Return the next vnode from the free list. + */ +int +getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, + struct vnode **vpp) +{ + struct vnode *vp; + struct thread *td; + struct lock_object *lo; + + CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); + + KASSERT(vops->registered, + ("%s: not registered vector op %p\n", __func__, vops)); + + td = curthread; + if (td->td_vp_reserved != NULL) { + vp = td->td_vp_reserved; + td->td_vp_reserved = NULL; + } else { + vp = vn_alloc(mp); + } counter_u64_add(vnodes_created, 1); /* * Locks are given the generic name "vnode" when created. @@ -1695,6 +1658,28 @@ init: return (0); } +void +getnewvnode_reserve(void) +{ + struct thread *td; + + td = curthread; + MPASS(td->td_vp_reserved == NULL); + td->td_vp_reserved = vn_alloc(NULL); +} + +void +getnewvnode_drop_reserve(void) +{ + struct thread *td; + + td = curthread; + if (td->td_vp_reserved != NULL) { + vn_free(td->td_vp_reserved); + td->td_vp_reserved = NULL; + } +} + static void freevnode(struct vnode *vp) { @@ -1710,7 +1695,6 @@ freevnode(struct vnode *vp) * so as not to contaminate the freshly allocated vnode. */ CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); - atomic_subtract_long(&numvnodes, 1); bo = &vp->v_bufobj; VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("cleaned vnode still on the free list.")); @@ -1751,7 +1735,7 @@ freevnode(struct vnode *vp) vp->v_iflag = 0; vp->v_vflag = 0; bo->bo_flag = 0; - uma_zfree(vnode_zone, vp); + vn_free(vp); } /* From owner-svn-src-head@freebsd.org Sat Jan 11 23:00:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 447961F7ADC; Sat, 11 Jan 2020 23:00: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 47wFhB16pYz4bpx; Sat, 11 Jan 2020 23:00:58 +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 21BF5A1D8; Sat, 11 Jan 2020 23:00:58 +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 00BN0wYC090551; Sat, 11 Jan 2020 23:00:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BN0wQs090550; Sat, 11 Jan 2020 23:00:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112300.00BN0wQs090550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 23:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356645 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 23:00:58 -0000 Author: mjg Date: Sat Jan 11 23:00:57 2020 New Revision: 356645 URL: https://svnweb.freebsd.org/changeset/base/356645 Log: vfs: only recalculate watermarks when limits are changing Previously they would get recalculated all the time, in particular in: getnewvnode -> vcheckspace -> vspace Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:59:44 2020 (r356644) +++ head/sys/kern/vfs_subr.c Sat Jan 11 23:00:57 2020 (r356645) @@ -118,6 +118,7 @@ static void vnlru_return_batches(struct vfsops *mnt_op static void destroy_vpollinfo(struct vpollinfo *vi); static int v_inval_buf_range_locked(struct vnode *vp, struct bufobj *bo, daddr_t startlbn, daddr_t endlbn); +static void vnlru_recalc(void); /* * These fences are intended for cases where some synchronization is @@ -194,8 +195,6 @@ static TAILQ_HEAD(freelst, vnode) vnode_free_list; * whenever vnlru_proc() becomes active. */ static u_long wantfreevnodes; -SYSCTL_ULONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, - &wantfreevnodes, 0, "Target for minimum number of \"free\" vnodes"); static u_long freevnodes; SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, "Number of \"free\" vnodes"); @@ -317,27 +316,65 @@ static u_long vlowat; /* minimal extras before expans static u_long vstir; /* nonzero to stir non-free vnodes */ static volatile int vsmalltrigger = 8; /* pref to keep if > this many pages */ +/* + * Note that no attempt is made to sanitize these parameters. + */ static int -sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) +sysctl_maxvnodes(SYSCTL_HANDLER_ARGS) { - u_long old_desiredvnodes; + u_long val; int error; - old_desiredvnodes = desiredvnodes; - if ((error = sysctl_handle_long(oidp, arg1, arg2, req)) != 0) + val = desiredvnodes; + error = sysctl_handle_long(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) return (error); - if (old_desiredvnodes != desiredvnodes) { - wantfreevnodes = desiredvnodes / 4; - /* XXX locking seems to be incomplete. */ - vfs_hash_changesize(desiredvnodes); - cache_changesize(desiredvnodes); - } + + if (val == desiredvnodes) + return (0); + mtx_lock(&vnode_free_list_mtx); + desiredvnodes = val; + wantfreevnodes = desiredvnodes / 4; + vnlru_recalc(); + mtx_unlock(&vnode_free_list_mtx); + /* + * XXX There is no protection against multiple threads changing + * desiredvnodes at the same time. Locking above only helps vnlru and + * getnewvnode. + */ + vfs_hash_changesize(desiredvnodes); + cache_changesize(desiredvnodes); return (0); } SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, - CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0, - sysctl_update_desiredvnodes, "UL", "Target for maximum number of vnodes"); + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_maxvnodes, + "UL", "Target for maximum number of vnodes"); + +static int +sysctl_wantfreevnodes(SYSCTL_HANDLER_ARGS) +{ + u_long val; + int error; + + val = wantfreevnodes; + error = sysctl_handle_long(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (val == wantfreevnodes) + return (0); + mtx_lock(&vnode_free_list_mtx); + wantfreevnodes = val; + vnlru_recalc(); + mtx_unlock(&vnode_free_list_mtx); + return (0); +} + +SYSCTL_PROC(_vfs, OID_AUTO, wantfreevnodes, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_wantfreevnodes, + "UL", "Target for minimum number of \"free\" vnodes"); + SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)"); static int vnlru_nowhere; @@ -591,6 +628,12 @@ vntblinit(void *dummy __unused) mtx_init(&mntid_mtx, "mntid", NULL, MTX_DEF); TAILQ_INIT(&vnode_free_list); mtx_init(&vnode_free_list_mtx, "vnode_free_list", NULL, MTX_DEF); + /* + * The lock is taken to appease WITNESS. + */ + mtx_lock(&vnode_free_list_mtx); + vnlru_recalc(); + mtx_unlock(&vnode_free_list_mtx); vnode_zone = uma_zcreate("VNODE", sizeof (struct vnode), NULL, NULL, vnode_init, vnode_fini, UMA_ALIGN_PTR, 0); vnodepoll_zone = uma_zcreate("VNODEPOLL", sizeof (struct vpollinfo), @@ -1211,7 +1254,16 @@ vnlru_free(int count, struct vfsops *mnt_op) mtx_unlock(&vnode_free_list_mtx); } +static void +vnlru_recalc(void) +{ + mtx_assert(&vnode_free_list_mtx, MA_OWNED); + gapvnodes = imax(desiredvnodes - wantfreevnodes, 100); + vhiwat = gapvnodes / 11; /* 9% -- just under the 10% in vlrureclaim() */ + vlowat = vhiwat / 2; +} + /* XXX some names and initialization are bad for limits and watermarks. */ static int vspace(void) @@ -1219,9 +1271,6 @@ vspace(void) u_long rnumvnodes, rfreevnodes; int space; - gapvnodes = imax(desiredvnodes - wantfreevnodes, 100); - vhiwat = gapvnodes / 11; /* 9% -- just under the 10% in vlrureclaim() */ - vlowat = vhiwat / 2; rnumvnodes = atomic_load_long(&numvnodes); rfreevnodes = atomic_load_long(&freevnodes); if (rnumvnodes > desiredvnodes)