From owner-svn-src-head@freebsd.org Sun Aug 2 16:34: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 03DCB3A1E79; Sun, 2 Aug 2020 16:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKRS36P1pz4dyy; Sun, 2 Aug 2020 16:34:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF3622645C; Sun, 2 Aug 2020 16:34:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072GYRkh002923; Sun, 2 Aug 2020 16:34:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GYR5B002922; Sun, 2 Aug 2020 16:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202008021634.072GYR5B002922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 2 Aug 2020 16:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363770 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 16:34:28 -0000 Author: cem Date: Sun Aug 2 16:34:27 2020 New Revision: 363770 URL: https://svnweb.freebsd.org/changeset/base/363770 Log: Unlocked getblk: Fix new false-positive assertion A free buf's lock may be held (temporarily) due to unlocked lookup, so buf_alloc() must acquire it without LK_NOWAIT. The unlocked getblk path should unlock it promptly once it realizes the identity does not match the buffer it was searching for. Reported by: gallatin Reviewed by: kib Tested by: pho X-MFC-With: r363482 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25914 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Aug 2 04:25:36 2020 (r363769) +++ head/sys/kern/vfs_bio.c Sun Aug 2 16:34:27 2020 (r363770) @@ -1637,7 +1637,7 @@ static struct buf * buf_alloc(struct bufdomain *bd) { struct buf *bp; - int freebufs; + int freebufs, error; /* * We can only run out of bufs in the buf zone if the average buf @@ -1660,8 +1660,10 @@ buf_alloc(struct bufdomain *bd) if (freebufs == bd->bd_lofreebuffers) bufspace_daemon_wakeup(bd); - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) - panic("getnewbuf_empty: Locked buf %p on free queue.", bp); + error = BUF_LOCK(bp, LK_EXCLUSIVE, NULL); + KASSERT(error == 0, ("%s: BUF_LOCK on free buf %p: %d.", __func__, bp, + error)); + (void)error; KASSERT(bp->b_vp == NULL, ("bp: %p still has vnode %p.", bp, bp->b_vp)); From owner-svn-src-head@freebsd.org Sun Aug 2 16:41: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 B3D1E3A2398; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKRcJ4NWFz4fYs; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79C5826563; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072GfaMc004554; Sun, 2 Aug 2020 16:41:36 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GfaqI004537; Sun, 2 Aug 2020 16:41:36 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008021641.072GfaqI004537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 2 Aug 2020 16:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363771 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 363771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 16:41:36 -0000 Author: 0mp (doc,ports committer) Date: Sun Aug 2 16:41:36 2020 New Revision: 363771 URL: https://svnweb.freebsd.org/changeset/base/363771 Log: Document automatic handling of font height for BDF files PR: 248395 Submitted by: Dmitry Wagin Reviewed by: bcr, emaste, tsoome Differential Revision: https://reviews.freebsd.org/D25907 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Aug 2 16:34:27 2020 (r363770) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Aug 2 16:41:36 2020 (r363771) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 10, 2020 +.Dd August 2, 2020 .Dt VTFONTCVT 8 .Os .Sh NAME @@ -63,7 +63,7 @@ file. .It Fl h Ar height Set font height. The default is 16. -Font height is set automatically for HEX files that have a +Font height is set automatically for BDF files and for HEX files that have a .Ql # Height: Ar height comment before any font data. .It Fl n @@ -75,7 +75,7 @@ Display verbose statistics about the converted font. .It Fl w Ar width Set font width. The default is 8. -Font width is set automatically for HEX files that have a +Font width is set automatically for BDF files and for HEX files that have a .Ql # Width: Ar width comment before any font data. .El From owner-svn-src-head@freebsd.org Sun Aug 2 16:59: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 E730E3A23F1; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKS0f5tPZz3Rcc; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADF3126B61; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072GxE4o016305; Sun, 2 Aug 2020 16:59:14 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GxEVY016304; Sun, 2 Aug 2020 16:59:14 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008021659.072GxEVY016304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 2 Aug 2020 16:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363772 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 363772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 16:59:15 -0000 Author: 0mp (doc,ports committer) Date: Sun Aug 2 16:59:14 2020 New Revision: 363772 URL: https://svnweb.freebsd.org/changeset/base/363772 Log: core(5) appeared in Version 1 AT&T UNIX Based on the scans of manual pages available at https://www.bell-labs.com/usr/dmr/www/man51.pdf, which are a part of the following collection: https://www.bell-labs.com/usr/dmr/www/1stEdman.html. Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D25849 Modified: head/share/man/man5/core.5 Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Sun Aug 2 16:41:36 2020 (r363771) +++ head/share/man/man5/core.5 Sun Aug 2 16:59:14 2020 (r363772) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd February 13, 2018 +.Dd August 2, 2020 .Dt CORE 5 .Os .Sh NAME @@ -171,4 +171,4 @@ command can be used: A .Nm file format appeared in -.At v6 . +.At v1 . From owner-svn-src-head@freebsd.org Sun Aug 2 19:42: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 DD9D13A5C44; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKWcb5dn8z3bws; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4DC08C1D; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072Jg7Ik020796; Sun, 2 Aug 2020 19:42:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072Jg7iu020794; Sun, 2 Aug 2020 19:42:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008021942.072Jg7iu020794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 19:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363780 - 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: 363780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 19:42:07 -0000 Author: mjg Date: Sun Aug 2 19:42:06 2020 New Revision: 363780 URL: https://svnweb.freebsd.org/changeset/base/363780 Log: vfs: move namecache initialisation into cache_vnode_init Modified: head/sys/kern/vfs_cache.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 Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/kern/vfs_cache.c Sun Aug 2 19:42:06 2020 (r363780) @@ -2071,6 +2071,15 @@ nchinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); void +cache_vnode_init(struct vnode *vp) +{ + + LIST_INIT(&vp->v_cache_src); + TAILQ_INIT(&vp->v_cache_dst); + vp->v_cache_dd = NULL; +} + +void cache_changesize(u_long newmaxvnodes) { struct nchashhead *new_nchashtbl, *old_nchashtbl; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/kern/vfs_subr.c Sun Aug 2 19:42:06 2020 (r363780) @@ -563,8 +563,7 @@ vnode_init(void *mem, int size, int flags) /* * Initialize namecache. */ - LIST_INIT(&vp->v_cache_src); - TAILQ_INIT(&vp->v_cache_dst); + cache_vnode_init(vp); /* * Initialize rangelocks. */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/sys/vnode.h Sun Aug 2 19:42:06 2020 (r363780) @@ -635,6 +635,7 @@ void cache_enter_time(struct vnode *dvp, struct vnode struct timespec *dtsp); int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp); +void cache_vnode_init(struct vnode *vp); void cache_purge(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp, bool force); From owner-svn-src-head@freebsd.org Sun Aug 2 20:00: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 350903A64CB; Sun, 2 Aug 2020 20:00: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX240knpz3cYC; Sun, 2 Aug 2020 20:00: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 F14398BC3; Sun, 2 Aug 2020 20:00:43 +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 072K0hfi028196; Sun, 2 Aug 2020 20:00:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K0h7C028195; Sun, 2 Aug 2020 20:00:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022000.072K0h7C028195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363781 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 20:00:44 -0000 Author: mjg Date: Sun Aug 2 20:00:43 2020 New Revision: 363781 URL: https://svnweb.freebsd.org/changeset/base/363781 Log: vfs: shorten v_iflag and v_vflag While here renumber VI_* flags to remove the gaps. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25921 Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 2 19:42:06 2020 (r363780) +++ head/sys/sys/vnode.h Sun Aug 2 20:00:43 2020 (r363781) @@ -107,6 +107,7 @@ struct vnode { enum vtype v_type:8; /* u vnode type */ short v_irflag; /* i frequently read flags */ seqc_t v_seqc; /* i modification count */ + uint32_t v_nchash; /* u namecache hash */ struct vop_vector *v_op; /* u vnode operations vector */ void *v_data; /* u private data for fs */ @@ -171,8 +172,8 @@ struct vnode { u_int v_holdcnt; /* I prevents recycling. */ u_int v_usecount; /* I ref count of users */ - u_int v_iflag; /* i vnode flags (see below) */ - u_int v_vflag; /* v vnode flags */ + u_short v_iflag; /* i vnode flags (see below) */ + u_short v_vflag; /* v vnode flags */ u_short v_mflag; /* l mnt-specific vnode flags */ short v_dbatchcpu; /* i LRU requeue deferral batch */ int v_writecount; /* I ref count of writers or @@ -245,10 +246,10 @@ struct xvnode { #define VIRF_DOOMED 0x0001 /* This vnode is being recycled */ #define VI_TEXT_REF 0x0001 /* Text ref grabbed use ref */ -#define VI_MOUNT 0x0020 /* Mount in progress */ -#define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ -#define VI_OWEINACT 0x1000 /* Need to call inactive */ -#define VI_DEFINACT 0x2000 /* deferred inactive */ +#define VI_MOUNT 0x0002 /* Mount in progress */ +#define VI_DOINGINACT 0x0004 /* VOP_INACTIVE is in progress */ +#define VI_OWEINACT 0x0008 /* Need to call inactive */ +#define VI_DEFINACT 0x0010 /* 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 Sun Aug 2 20:02:06 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 ADA1E3A66D8; Sun, 2 Aug 2020 20:02:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX3f43LSz3dJD; Sun, 2 Aug 2020 20:02:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FD138F27; Sun, 2 Aug 2020 20:02:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072K26c5031423; Sun, 2 Aug 2020 20:02:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K26lC031422; Sun, 2 Aug 2020 20:02:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022002.072K26lC031422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363782 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 20:02:06 -0000 Author: mjg Date: Sun Aug 2 20:02:06 2020 New Revision: 363782 URL: https://svnweb.freebsd.org/changeset/base/363782 Log: vfs: store precomputed namecache hash in the vnode This significantly speeds up path lookup, Cascade Lake doing access(2) on ufs on /usr/obj/usr/src/amd64.amd64/sys/GENERIC/vnode_if.c, ops/s: before: 2535298 after: 2797621 Over +10%. The reversed order of computation here does not seem to matter for hash distribution. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25921 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 2 20:00:43 2020 (r363781) +++ head/sys/kern/vfs_cache.c Sun Aug 2 20:02:06 2020 (r363782) @@ -490,14 +490,22 @@ cache_assert_vnode_locked(struct vnode *vp) cache_assert_vlp_locked(vlp); } +/* + * TODO: With the value stored we can do better than computing the hash based + * on the address and the choice of FNV should also be revisisted. + */ +static void +cache_prehash(struct vnode *vp) +{ + + vp->v_nchash = fnv_32_buf(&vp, sizeof(vp), FNV1_32_INIT); +} + static uint32_t cache_get_hash(char *name, u_char len, struct vnode *dvp) { - uint32_t hash; - hash = fnv_32_buf(name, len, FNV1_32_INIT); - hash = fnv_32_buf(&dvp, sizeof(dvp), hash); - return (hash); + return (fnv_32_buf(name, len, dvp->v_nchash)); } static inline struct rwlock * @@ -2077,6 +2085,7 @@ cache_vnode_init(struct vnode *vp) LIST_INIT(&vp->v_cache_src); TAILQ_INIT(&vp->v_cache_dst); vp->v_cache_dd = NULL; + cache_prehash(vp); } void From owner-svn-src-head@freebsd.org Sun Aug 2 20:03: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 B5ED43A69A8; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX574MSDz3dFQ; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791038D6A; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072K3Nmb034050; Sun, 2 Aug 2020 20:03:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K3NHC034049; Sun, 2 Aug 2020 20:03:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022003.072K3NHC034049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363783 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 20:03:23 -0000 Author: mjg Date: Sun Aug 2 20:03:23 2020 New Revision: 363783 URL: https://svnweb.freebsd.org/changeset/base/363783 Log: Bump __FreeBSD_version after vnode layout changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Aug 2 20:02:06 2020 (r363782) +++ head/sys/sys/param.h Sun Aug 2 20:03:23 2020 (r363783) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300103 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300104 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Aug 2 20:18: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 2F0383A6BE3; Sun, 2 Aug 2020 20:18:38 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKXQk0S2Cz3dvv; Sun, 2 Aug 2020 20:18:38 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EFD8F46; Sun, 2 Aug 2020 20:18:37 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072KIb5N040666; Sun, 2 Aug 2020 20:18:37 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072KIbFX040665; Sun, 2 Aug 2020 20:18:37 GMT (envelope-from jah@FreeBSD.org) Message-Id: <202008022018.072KIbFX040665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 2 Aug 2020 20:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363784 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 363784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 02 Aug 2020 20:18:38 -0000 Author: jah Date: Sun Aug 2 20:18:37 2020 New Revision: 363784 URL: https://svnweb.freebsd.org/changeset/base/363784 Log: vt(4): CONS_HISTORY/CONS_CLRHIST should operate on issuing terminal Currently the CONS_HISTORY and CONS_CLRHIST ioctls modify the state of the active terminal instead of the terminal against which the ioctl was issued. Because of the way vidcontrol(1) works, these are the same in most cases. But a poorly-timed window switch can make them differ. This is reproducible by issuing e.g. 'vidcontrol -s 2 && vidcontrol -C' to switch from vty 1 to vty 2; teken will reset the cursor position on vty 1 but vt(4) will clear the history buffer of vty 2, producing an interesting state of affairs. Differential Revision: https://reviews.freebsd.org/D25564 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Aug 2 20:03:23 2020 (r363783) +++ head/sys/dev/vt/vt_core.c Sun Aug 2 20:18:37 2020 (r363784) @@ -454,7 +454,7 @@ vt_window_postswitch(struct vt_window *vw) return (0); } -/* vt_late_window_switch will done VT switching for regular case. */ +/* vt_late_window_switch will do VT switching for regular case. */ static int vt_late_window_switch(struct vt_window *vw) { @@ -2326,12 +2326,11 @@ skip_thunk: case CONS_HISTORY: if (*(int *)data < 0) return EINVAL; - if (*(int *)data != vd->vd_curwindow->vw_buf.vb_history_size) - vtbuf_sethistory_size(&vd->vd_curwindow->vw_buf, - *(int *)data); + if (*(int *)data != vw->vw_buf.vb_history_size) + vtbuf_sethistory_size(&vw->vw_buf, *(int *)data); return (0); case CONS_CLRHIST: - vtbuf_clearhistory(&vd->vd_curwindow->vw_buf); + vtbuf_clearhistory(&vw->vw_buf); /* * Invalidate the entire visible window; it is not guaranteed * that this operation will be immediately followed by a scroll @@ -2339,9 +2338,11 @@ skip_thunk: * to remain visible. */ VT_LOCK(vd); - vd->vd_flags |= VDF_INVALID; + if (vw == vd->vd_curwindow) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vw, 0); + } VT_UNLOCK(vd); - vt_resume_flush_timer(vd->vd_curwindow, 0); return (0); case CONS_GET: /* XXX */ From owner-svn-src-head@freebsd.org Mon Aug 3 10:19: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 17B92375B5B; Mon, 3 Aug 2020 10:19:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKv5N6y8bz4bv6; Mon, 3 Aug 2020 10:19:52 +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 B9B7712B53; Mon, 3 Aug 2020 10:19:52 +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 073AJqo6058094; Mon, 3 Aug 2020 10:19:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073AJpwk058088; Mon, 3 Aug 2020 10:19:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031019.073AJpwk058088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 10:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363795 - in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller X-SVN-Commit-Revision: 363795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 10:19:53 -0000 Author: andrew Date: Mon Aug 3 10:19:50 2020 New Revision: 363795 URL: https://svnweb.freebsd.org/changeset/base/363795 Log: Handle Raspberry Pi 4 xhci firmware loading. The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. Submitted by: Robert Crowston Differential Revision: https://reviews.freebsd.org/D25261 Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/conf/files.arm64 head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Aug 3 10:19:50 2020 (r363795) @@ -397,10 +397,10 @@ int bcm2835_mbox_property(void *msg, size_t msg_size) { struct bcm_mbox_softc *sc; - struct msg_set_power_state *buf; bus_dma_tag_t msg_tag; bus_dmamap_t msg_map; bus_addr_t msg_phys; + char *buf; uint32_t reg; device_t mbox; int err; @@ -468,6 +468,26 @@ bcm2835_mbox_set_power_state(uint32_t device_id, boole } int +bcm2835_mbox_notify_xhci_reset(uint32_t pci_dev_addr) +{ + struct msg_notify_xhci_reset msg; + int err; + + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.pci_device_addr = pci_dev_addr; + msg.end_tag = 0; + + err = bcm2835_mbox_property(&msg, sizeof(msg)); + + return (err); +} + +int bcm2835_mbox_get_clock_rate(uint32_t clock_id, uint32_t *hz) { struct msg_get_clock_rate msg; @@ -572,3 +592,4 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) return (err); } + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 10:19:50 2020 (r363795) @@ -112,6 +112,24 @@ struct msg_set_power_state { /* Sets the power state for a given device */ int bcm2835_mbox_set_power_state(uint32_t, boolean_t); +#define BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET 0x00030058 + +struct msg_notify_xhci_reset { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t pci_device_addr; + } req; + struct { + } resp; + } body; + uint32_t end_tag; +}; + +/* Prompts the VideoCore processor to reload the xhci firmware. */ +int bcm2835_mbox_notify_xhci_reset(uint32_t); + #define BCM2835_MBOX_CLOCK_ID_EMMC 0x00000001 #define BCM2838_MBOX_CLOCK_ID_EMMC2 0x0000000c Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c Mon Aug 3 10:19:50 2020 (r363795) @@ -0,0 +1,217 @@ +/*- + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2020 Dr Robert Harvey Crowston + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * $FreeBSD$ + * + */ + +/* + * VIA VL805 controller on the Raspberry Pi 4. + * The VL805 is a generic xhci controller. However, in the newer hardware + * revisions of the Raspberry Pi 4, it is incapable of loading its own firmware. + * Instead, the VideoCore GPU must load the firmware into the controller at the + * appropriate time. This driver is a shim that pre-loads the firmware before + * handing control to the xhci generic driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define VL805_FIRMWARE_REG 0x50 +#define PCIE_BUS_SHIFT 20 +#define PCIE_SLOT_SHIFT 15 +#define PCIE_FUNC_SHIFT 12 + +static int +bcm_xhci_probe(device_t dev) +{ + phandle_t root; + uint32_t device_id; + + device_id = pci_get_devid(dev); + if (device_id != 0x34831106) /* VIA VL805 USB 3.0 controller. */ + return (ENXIO); + + /* + * The VIA chip is not unique to the Pi, but we only want to use this + * driver if the SoC is a Raspberry Pi 4. Walk the device tree to + * discover if the system is a Pi 4. + */ + root = OF_finddevice("/"); + if (root == -1) + return (ENXIO); + if (!ofw_bus_node_is_compatible(root, "raspberrypi,4-model-b")) + return (ENXIO); + + /* + * On the Pi 4, the VIA chip with the firmware-loading limitation is + * soldered-on to a particular bus/slot/function. But, it's possible a + * user could desolder the VIA chip, replace it with a pci-pci bridge, + * then plug in a commodity VIA PCI-e card on the new bridge. In that + * case we don't want to try to load the firmware to a commodity + * expansion card. + */ + if (pci_get_bus(dev) != 1 || pci_get_slot(dev) != 0 || + pci_get_function(dev) != 0 ) + return (ENXIO); + + device_set_desc(dev, + "VL805 USB 3.0 controller (on the Raspberry Pi 4b)"); + + return (BUS_PROBE_SPECIFIC); +} + +static uint32_t +bcm_xhci_check_firmware(device_t dev, bool expect_loaded) +{ + uint32_t revision; + bool loaded; + + revision = pci_read_config(dev, VL805_FIRMWARE_REG, 4); + loaded = !(revision == 0 || revision == 0xffffffff); + + if (expect_loaded && !loaded) + device_printf(dev, "warning: xhci firmware not found.\n"); + else if (bootverbose && !loaded) + device_printf(dev, "note: xhci firmware not found.\n"); + else if (bootverbose) + device_printf(dev, + "note: xhci firmware detected; firmware is revision %x.\n", + revision); + + if (!loaded) + return 0; + + return (revision); +} + +static void +bcm_xhci_install_xhci_firmware(device_t dev) +{ + uint32_t revision, dev_addr; + int error; + + revision = bcm_xhci_check_firmware(dev, false); + if (revision > 0) { + /* + * With the pre-June 2020 boot firmware, it does not seem + * possible to reload already-installed xhci firmware. + */ + return; + } + + /* + * Notify the VideoCore gpu processor that it needs to reload the xhci + * firmware into the xhci controller. This needs to happen after the pci + * bridge topology is registered with the controller. + */ + if (bootverbose) + device_printf(dev, "note: installing xhci firmware.\n"); + + dev_addr = + pci_get_bus(dev) << PCIE_BUS_SHIFT | + pci_get_slot(dev) << PCIE_SLOT_SHIFT | + pci_get_function(dev) << PCIE_FUNC_SHIFT; + + error = bcm2835_mbox_notify_xhci_reset(dev_addr); + if (error) + device_printf(dev, + "warning: xhci firmware install failed (error %d).\n", + error); + + DELAY(1000); + bcm_xhci_check_firmware(dev, true); + + return; +} + +static int +bcm_xhci_attach(device_t dev) +{ + struct xhci_softc *sc; + int error; + + sc = device_get_softc(dev); + + bcm_xhci_install_xhci_firmware(dev); + + error = xhci_pci_attach(dev); + if (error) + return (error); + + /* 32 bit DMA is a limitation of the PCI-e controller, not the VL805. */ + sc->sc_bus.dma_bits = 32; + if (bootverbose) + device_printf(dev, "note: switched to 32-bit DMA.\n"); + + return (0); +} + +/* + * Device method table. + */ +static device_method_t bcm_xhci_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, bcm_xhci_probe), + DEVMETHOD(device_attach, bcm_xhci_attach), +}; + +DEFINE_CLASS_1(bcm_xhci, bcm_xhci_driver, bcm_xhci_methods, + sizeof(struct xhci_softc), xhci_pci_driver); + +static devclass_t xhci_devclass; +DRIVER_MODULE(bcm_xhci, pci, bcm_xhci_driver, xhci_devclass, 0, 0); MODULE_DEPEND(bcm_xhci, usb, 1, 1, 1); + Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 3 10:19:50 2020 (r363795) @@ -19,6 +19,7 @@ arm/broadcom/bcm2835/bcm2835_vcbus.c standard arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm2838_pci.c optional pci +arm/broadcom/bcm2835/bcm2838_xhci.c optional xhci arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt dev/mbox/mbox_if.m standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/conf/files.arm64 Mon Aug 3 10:19:50 2020 (r363795) @@ -107,6 +107,7 @@ arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci +arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/dev/usb/controller/xhci.h Mon Aug 3 10:19:50 2020 (r363795) @@ -544,5 +544,8 @@ usb_error_t xhci_init(struct xhci_softc *, device_t, u usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); +int xhci_pci_attach(device_t); + +DECLARE_CLASS(xhci_pci_driver); #endif /* _XHCI_H_ */ Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Aug 3 10:19:50 2020 (r363795) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include "usb_if.h" static device_probe_t xhci_pci_probe; -static device_attach_t xhci_pci_attach; static device_detach_t xhci_pci_detach; static usb_take_controller_t xhci_pci_take_controller; @@ -80,15 +79,12 @@ static device_method_t xhci_device_methods[] = { DEVMETHOD_END }; -static driver_t xhci_driver = { - .name = "xhci", - .methods = xhci_device_methods, - .size = sizeof(struct xhci_softc), -}; +DEFINE_CLASS_0(xhci, xhci_pci_driver, xhci_device_methods, + sizeof(struct xhci_softc)); static devclass_t xhci_devclass; -DRIVER_MODULE(xhci, pci, xhci_driver, xhci_devclass, NULL, NULL); +DRIVER_MODULE(xhci, pci, xhci_pci_driver, xhci_devclass, NULL, NULL); MODULE_DEPEND(xhci, usb, 1, 1, 1); static const char * @@ -223,7 +219,7 @@ xhci_pci_port_route(device_t self, uint32_t set, uint3 return (0); } -static int +int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); From owner-svn-src-head@freebsd.org Mon Aug 3 12:48: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 42D85379DD5; Mon, 3 Aug 2020 12:48:54 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyPK3KKJz3WZs; Mon, 3 Aug 2020 12:48:53 +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 B6631147BD; Mon, 3 Aug 2020 12:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073CmqRh051121; Mon, 3 Aug 2020 12:48:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073CmpJg051118; Mon, 3 Aug 2020 12:48:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202008031248.073CmpJg051118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 3 Aug 2020 12:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363796 - in head: lib/libc/riscv/gen sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: lib/libc/riscv/gen sys/riscv/include X-SVN-Commit-Revision: 363796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 12:48:55 -0000 Author: kp Date: Mon Aug 3 12:48:51 2020 New Revision: 363796 URL: https://svnweb.freebsd.org/changeset/base/363796 Log: libc: Provide sub fp(s|g)etmask() implementations for RISC-V RISC-V doesn't support floating-point exceptions. RISC-V Instruction Set Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status Register: "As allowed by the standard, we do not support traps on floating-point exceptions in the base ISA, but instead require explicit checks of the flags in software. We considered adding branches controlled directly by the contents of the floating-point accrued exception flags, but ultimately chose to omit these instructions to keep the ISA simple." We still need these functions, because some applications (notably Perl) call them, but we cannot provide a meaningful implementation. Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25740 Added: head/lib/libc/riscv/gen/fpgetmask.c (contents, props changed) head/lib/libc/riscv/gen/fpsetmask.c (contents, props changed) Modified: head/lib/libc/riscv/gen/Makefile.inc head/sys/riscv/include/ieeefp.h Modified: head/lib/libc/riscv/gen/Makefile.inc ============================================================================== --- head/lib/libc/riscv/gen/Makefile.inc Mon Aug 3 10:19:50 2020 (r363795) +++ head/lib/libc/riscv/gen/Makefile.inc Mon Aug 3 12:48:51 2020 (r363796) @@ -3,6 +3,8 @@ SRCS+= _ctx_start.S \ fabs.S \ flt_rounds.c \ + fpgetmask.c \ + fpsetmask.c \ infinity.c \ ldexp.c \ makecontext.c \ Added: head/lib/libc/riscv/gen/fpgetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpgetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +fp_except_t +fpgetmask(void) +{ + + return (0); +} Added: head/lib/libc/riscv/gen/fpsetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpsetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/** + * RISC-V doesn't support floating-point exceptions: RISC-V Instruction Set + * Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status + * Register: "As allowed by the standard, we do not support traps on + * floating-point exceptions in the base ISA, but instead require explicit + * checks of the flags in software. We considered adding branches controlled + * directly by the contents of the floating-point accrued exception flags, but + * ultimately chose to omit these instructions to keep the ISA simple." + * + * We still need this function, because some applications (notably Perl) call + * it, but we cannot provide a meaningful implementation. + **/ +fp_except_t +fpsetmask(fp_except_t mask) +{ + + return (0); +} Modified: head/sys/riscv/include/ieeefp.h ============================================================================== --- head/sys/riscv/include/ieeefp.h Mon Aug 3 10:19:50 2020 (r363795) +++ head/sys/riscv/include/ieeefp.h Mon Aug 3 12:48:51 2020 (r363796) @@ -4,5 +4,6 @@ #define _MACHINE_IEEEFP_H_ /* TODO */ +typedef int fp_except_t; #endif /* _MACHINE_IEEEFP_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 3 12:51: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 0B82237A18E; Mon, 3 Aug 2020 12:51:15 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyS26Zp4z3XBg; Mon, 3 Aug 2020 12:51:14 +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 C549A14B93; Mon, 3 Aug 2020 12:51:14 +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 073CpEG5054403; Mon, 3 Aug 2020 12:51:14 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073CpEB4054402; Mon, 3 Aug 2020 12:51:14 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202008031251.073CpEB4054402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 3 Aug 2020 12:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363797 - head/contrib/googletest/googletest/test X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/googletest/googletest/test X-SVN-Commit-Revision: 363797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 12:51:15 -0000 Author: lwhsu Date: Mon Aug 3 12:51:14 2020 New Revision: 363797 URL: https://svnweb.freebsd.org/changeset/base/363797 Log: Disable tests failing after r363679 PR: 248452 Sponsored by: The FreeBSD Foundation Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:48:51 2020 (r363796) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:51:14 2020 (r363797) @@ -403,6 +403,8 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -413,6 +415,7 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -861,6 +864,8 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -868,6 +873,7 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { From owner-svn-src-head@freebsd.org Mon Aug 3 13:12: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 4200A37AB54; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyw811GKz3YhS; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 072E014E6F; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073DC7ZM067632; Mon, 3 Aug 2020 13:12:07 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073DC7Bp067631; Mon, 3 Aug 2020 13:12:07 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008031312.073DC7Bp067631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 3 Aug 2020 13:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363798 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 13:12:08 -0000 Author: 0mp (doc,ports committer) Date: Mon Aug 3 13:12:07 2020 New Revision: 363798 URL: https://svnweb.freebsd.org/changeset/base/363798 Log: Do not mention portsnap(8) in ports.7 As we are moving away from portsnap, let's not recommend it in the manual page. Reviewed by: bcr (manpages), mat (portmgr) Differential Revision: https://reviews.freebsd.org/D25847 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Aug 3 12:51:14 2020 (r363797) +++ head/share/man/man7/ports.7 Mon Aug 3 13:12:07 2020 (r363798) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2020 +.Dd August 3, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -70,9 +70,7 @@ branch contains all the latest changes, while the branches only provide critical fixes. The .Em head -branch can be installed or updated using either -.Xr portsnap 8 , -or from Subversion repository at: +branch can be installed or updated from the Subversion repository located at: .Pp .Lk https://svn.FreeBSD.org/ports/head .Pp @@ -626,8 +624,7 @@ is going to be built with Python 3.7 support.) .Xr make 1 , .Xr make.conf 5 , .Xr development 7 , -.Xr pkg 7 , -.Xr portsnap 8 +.Xr pkg 7 .Pp Additional developer documentation: .Bl -dash -width "" -offset indent From owner-svn-src-head@freebsd.org Mon Aug 3 16:26: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 BC0A237F7FA; Mon, 3 Aug 2020 16:26:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL3D34c69z438p; Mon, 3 Aug 2020 16:26:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 817AC174C0; Mon, 3 Aug 2020 16:26:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073GQBC7089142; Mon, 3 Aug 2020 16:26:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073GQBB5089141; Mon, 3 Aug 2020 16:26:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031626.073GQBB5089141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 16:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363799 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 363799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 16:26:11 -0000 Author: andrew Date: Mon Aug 3 16:26:10 2020 New Revision: 363799 URL: https://svnweb.freebsd.org/changeset/base/363799 Log: Allow child classes of simplebus to call attach directly Reduce code duplication when a bus is subclassed from simplebus by allowing them to call simplebus_attach directly. This is useful when the child bus will just implement the same calls. As not all children will expect to have a ranges property, e.g. the Raspberry Pi firmware, allow this property to be missing. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25925 Modified: head/sys/dev/fdt/simplebus.c head/sys/dev/fdt/simplebus.h Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Mon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.c Mon Aug 3 16:26:10 2020 (r363799) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); * Bus interface. */ static int simplebus_probe(device_t dev); -static int simplebus_attach(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static void simplebus_probe_nomatch(device_t bus, device_t child); @@ -134,7 +133,7 @@ simplebus_probe(device_t dev) return (BUS_PROBE_GENERIC); } -static int +int simplebus_attach(device_t dev) { struct simplebus_softc *sc; @@ -142,7 +141,8 @@ simplebus_attach(device_t dev) sc = device_get_softc(dev); simplebus_init(dev, 0); - if (simplebus_fill_ranges(sc->node, sc) < 0) { + if ((sc->flags & SB_FLAG_NO_RANGES) == 0 && + simplebus_fill_ranges(sc->node, sc) < 0) { device_printf(dev, "could not get ranges\n"); return (ENXIO); } Modified: head/sys/dev/fdt/simplebus.h ============================================================================== --- head/sys/dev/fdt/simplebus.h Mon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.h Mon Aug 3 16:26:10 2020 (r363799) @@ -47,6 +47,8 @@ struct simplebus_softc { struct simplebus_range *ranges; int nranges; +#define SB_FLAG_NO_RANGES (1 << 0) /* Bus doesn't have ranges property */ + int flags; pcell_t acells, scells; }; @@ -63,4 +65,7 @@ struct simplebus_devinfo *simplebus_setup_dinfo(device struct simplebus_devinfo *di); int simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc); + +int simplebus_attach(device_t dev); + #endif /* _FDT_SIMPLEBUS_H */ From owner-svn-src-head@freebsd.org Mon Aug 3 16:43: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 5F31F37FDB9; Mon, 3 Aug 2020 16:43:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL3cF1vy4z44wp; Mon, 3 Aug 2020 16:43:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AAC217904; Mon, 3 Aug 2020 16:43:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073GheAF002211; Mon, 3 Aug 2020 16:43:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073Ghewx002210; Mon, 3 Aug 2020 16:43:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031643.073Ghewx002210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 16:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363800 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 16:43:41 -0000 Author: andrew Date: Mon Aug 3 16:43:40 2020 New Revision: 363800 URL: https://svnweb.freebsd.org/changeset/base/363800 Log: Allow the Raspberry Pi firmware driver to be a bus There are child nodes in the device tree, e.g. the Raspberry Pi firmware GPIO device. Add support for this to be a bus so we can attach these children. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25848 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Mon Aug 3 16:26:10 2020 (r363799) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Mon Aug 3 16:43:40 2020 (r363800) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -47,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include struct bcm2835_firmware_softc { - device_t sc_dev; + struct simplebus_softc sc; phandle_t sc_mbox; }; @@ -82,7 +84,6 @@ bcm2835_firmware_attach(device_t dev) int rv; sc = device_get_softc(dev); - sc->sc_dev = dev; node = ofw_bus_get_node(dev); rv = OF_getencprop(node, "mboxes", &mbox, sizeof(mbox)); @@ -94,14 +95,17 @@ bcm2835_firmware_attach(device_t dev) OF_device_register_xref(OF_xref_from_node(node), dev); - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree_node = device_get_sysctl_tree(sc->sc_dev); + ctx = device_get_sysctl_ctx(dev); + tree_node = device_get_sysctl_tree(dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "revision", CTLTYPE_UINT | CTLFLAG_RD, sc, sizeof(*sc), sysctl_bcm2835_firmware_get_revision, "IU", "Firmware revision"); - return (0); + + /* The firmwaare doesn't have a ranges property */ + sc->sc.flags |= SB_FLAG_NO_RANGES; + return (simplebus_attach(dev)); } int @@ -150,7 +154,7 @@ sysctl_bcm2835_firmware_get_revision(SYSCTL_HANDLER_AR uint32_t rev; int err; - if (bcm2835_firmware_property(sc->sc_dev, + if (bcm2835_firmware_property(sc->sc.dev, BCM2835_MBOX_TAG_FIRMWARE_REVISION, &rev, sizeof(rev)) != 0) return (ENXIO); @@ -171,11 +175,9 @@ static device_method_t bcm2835_firmware_methods[] = { }; static devclass_t bcm2835_firmware_devclass; -static driver_t bcm2835_firmware_driver = { - "bcm2835_firmware", - bcm2835_firmware_methods, - sizeof(struct bcm2835_firmware_softc), -}; +DEFINE_CLASS_1(bcm2835_firmware, bcm2835_firmware_driver, + bcm2835_firmware_methods, sizeof(struct bcm2835_firmware_softc), + simplebus_driver); EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); From owner-svn-src-head@freebsd.org Mon Aug 3 17:17: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 321B83A2011; Mon, 3 Aug 2020 17:17:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL4M20Yqrz46ts; Mon, 3 Aug 2020 17:17:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC2E017D9D; Mon, 3 Aug 2020 17:17:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073HHHrJ021312; Mon, 3 Aug 2020 17:17:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HHHEv021311; Mon, 3 Aug 2020 17:17:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008031717.073HHHEv021311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2020 17:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363801 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 17:17:18 -0000 Author: kib Date: Mon Aug 3 17:17:17 2020 New Revision: 363801 URL: https://svnweb.freebsd.org/changeset/base/363801 Log: Provide more correct description for sysctl kern.smp.cores. Reported by: dewayne@heuristicsystems.com.au PR: 248454 Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon Aug 3 16:43:40 2020 (r363800) +++ head/sys/kern/subr_smp.c Mon Aug 3 17:17:17 2020 (r363801) @@ -104,7 +104,7 @@ SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLF int mp_ncores = -1; /* how many physical cores running */ SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, - "Number of CPUs online"); + "Number of physical cores online"); int smp_topology = 0; /* Which topology we're using. */ SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, From owner-svn-src-head@freebsd.org Mon Aug 3 17:18: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 B10F53A1A6C; Mon, 3 Aug 2020 17:18:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL4N541gwz47Xf; Mon, 3 Aug 2020 17:18:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 550E517D1C; Mon, 3 Aug 2020 17:18:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073HIDPs021419; Mon, 3 Aug 2020 17:18:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HIDPi021417; Mon, 3 Aug 2020 17:18:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031718.073HIDPi021417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 17:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363802 - in head/sys: arm/broadcom/bcm2835 conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 conf X-SVN-Commit-Revision: 363802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 17:18:13 -0000 Author: andrew Date: Mon Aug 3 17:18:12 2020 New Revision: 363802 URL: https://svnweb.freebsd.org/changeset/base/363802 Log: Add a GPIO driver for the Raspberry Pi firmware GPIOs These exist on the Raspberry Pi 3 and 4 and control and external IO expander. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25858 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c Mon Aug 3 17:18:12 2020 (r363802) @@ -0,0 +1,457 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2015 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "gpio_if.h" + +#define RPI_FW_GPIO_PINS 8 +#define RPI_FW_GPIO_BASE 128 +#define RPI_FW_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +struct rpi_fw_gpio_softc { + device_t sc_busdev; + device_t sc_firmware; + struct sx sc_sx; + struct gpio_pin sc_gpio_pins[RPI_FW_GPIO_PINS]; + uint8_t sc_gpio_state; +}; + +#define RPI_FW_GPIO_LOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#define RPI_FW_GPIO_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) + +static struct ofw_compat_data compat_data[] = { + {"raspberrypi,firmware-gpio", 1}, + {NULL, 0} +}; + +static int +rpi_fw_gpio_pin_configure(struct rpi_fw_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + union msg_get_gpio_config old_cfg; + union msg_set_gpio_config new_cfg; + int rv; + + bzero(&old_cfg, sizeof(old_cfg)); + bzero(&new_cfg, sizeof(new_cfg)); + old_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, &old_cfg, sizeof(old_cfg)); + if (rv == 0 && old_cfg.resp.gpio != 0) + rv = EIO; + if (rv != 0) + goto fail; + + new_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + if (flags & GPIO_PIN_INPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_IN; + new_cfg.req.state = 0; + pin->gp_flags = GPIO_PIN_INPUT; + } else if (flags & GPIO_PIN_OUTPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_OUT; + if (flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW)) { + if (flags & GPIO_PIN_PRESET_HIGH) { + new_cfg.req.state = 1; + sc->sc_gpio_state |= (1 << pin->gp_pin); + } else { + new_cfg.req.state = 0; + sc->sc_gpio_state &= ~(1 << pin->gp_pin); + } + } else { + if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) { + new_cfg.req.state = 1; + } else { + new_cfg.req.state = 0; + } + } + pin->gp_flags = GPIO_PIN_OUTPUT; + } else { + new_cfg.req.dir = old_cfg.resp.dir; + /* Use the old state to decide high/low */ + if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) + new_cfg.req.state = 1; + else + new_cfg.req.state = 0; + } + new_cfg.req.pol = old_cfg.resp.pol; + new_cfg.req.term_en = 0; + new_cfg.req.term_pull_up = 0; + + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG, &new_cfg, sizeof(new_cfg)); + +fail: + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static device_t +rpi_fw_gpio_get_bus(device_t dev) +{ + struct rpi_fw_gpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->sc_busdev); +} + +static int +rpi_fw_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = RPI_FW_GPIO_PINS - 1; + return (0); +} + +static int +rpi_fw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + *caps = RPI_FW_GPIO_DEFAULT_CAPS; + return (0); +} + +static int +rpi_fw_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct rpi_fw_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + RPI_FW_GPIO_LOCK(sc); + *flags = sc->sc_gpio_pins[i].gp_flags; + RPI_FW_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rpi_fw_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + RPI_FW_GPIO_LOCK(sc); + memcpy(name, sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME); + RPI_FW_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rpi_fw_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + return (rpi_fw_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags)); +} + +static int +rpi_fw_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct rpi_fw_gpio_softc *sc; + union msg_set_gpio_state state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + state.req.gpio = RPI_FW_GPIO_BASE + pin; + state.req.state = value; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_STATE, &state, sizeof(state)); + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && state.resp.gpio != 0) + rv = EINVAL; + if (rv == 0) { + sc->sc_gpio_pins[i].gp_flags &= ~(GPIO_PIN_PRESET_HIGH | + GPIO_PIN_PRESET_LOW); + if (value) + sc->sc_gpio_state |= (1 << i); + else + sc->sc_gpio_state &= ~(1 << i); + } + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static int +rpi_fw_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct rpi_fw_gpio_softc *sc; + union msg_get_gpio_state state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + bzero(&state, sizeof(state)); + state.req.gpio = RPI_FW_GPIO_BASE + pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_STATE, &state, sizeof(state)); + RPI_FW_GPIO_UNLOCK(sc); + + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && state.resp.gpio != 0) + rv = EINVAL; + if (rv == 0) + *val = !state.resp.state; + + return (rv); +} + +static int +rpi_fw_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct rpi_fw_gpio_softc *sc; + union msg_get_gpio_state old_state; + union msg_set_gpio_state new_state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + bzero(&old_state, sizeof(old_state)); + bzero(&new_state, sizeof(new_state)); + + old_state.req.gpio = RPI_FW_GPIO_BASE + pin; + new_state.req.gpio = RPI_FW_GPIO_BASE + pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_STATE, &old_state, sizeof(old_state)); + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && old_state.resp.gpio == 0) { + /* Set the new state to invert the GPIO */ + new_state.req.state = !old_state.resp.state; + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_STATE, &new_state, + sizeof(new_state)); + } + if (rv == 0 && (old_state.resp.gpio != 0 || new_state.resp.gpio != 0)) + rv = EINVAL; + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static int +rpi_fw_gpio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Raspberry Pi Firmware GPIO controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rpi_fw_gpio_attach(device_t dev) +{ + union msg_get_gpio_config cfg; + struct rpi_fw_gpio_softc *sc; + char *names; + phandle_t gpio; + int i, nelems, elm_pos, rv; + + sc = device_get_softc(dev); + sc->sc_firmware = device_get_parent(dev); + sx_init(&sc->sc_sx, "Raspberry Pi firmware gpio"); + /* Find our node. */ + gpio = ofw_bus_get_node(dev); + if (!OF_hasprop(gpio, "gpio-controller")) + /* This is not a GPIO controller. */ + goto fail; + + nelems = OF_getprop_alloc(gpio, "gpio-line-names", (void **)&names); + if (nelems <= 0) + names = NULL; + elm_pos = 0; + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + /* Set the current pin name */ + if (names != NULL && elm_pos < nelems && + names[elm_pos] != '\0') { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "%s", names + elm_pos); + /* Find the next pin name */ + elm_pos += strlen(names + elm_pos) + 1; + } else { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", i); + } + + sc->sc_gpio_pins[i].gp_pin = i; + sc->sc_gpio_pins[i].gp_caps = RPI_FW_GPIO_DEFAULT_CAPS; + + bzero(&cfg, sizeof(cfg)); + cfg.req.gpio = RPI_FW_GPIO_BASE + i; + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, &cfg, sizeof(cfg)); + if (rv == 0 && cfg.resp.gpio == 0) { + if (cfg.resp.dir == BCM2835_FIRMWARE_GPIO_IN) + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_INPUT; + else + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_OUTPUT; + } else { + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_INPUT; + } + } + free(names, M_OFWPROP); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + goto fail; + + return (0); + +fail: + sx_destroy(&sc->sc_sx); + + return (ENXIO); +} + +static int +rpi_fw_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t rpi_fw_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rpi_fw_gpio_probe), + DEVMETHOD(device_attach, rpi_fw_gpio_attach), + DEVMETHOD(device_detach, rpi_fw_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, rpi_fw_gpio_get_bus), + DEVMETHOD(gpio_pin_max, rpi_fw_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, rpi_fw_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, rpi_fw_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, rpi_fw_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, rpi_fw_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, rpi_fw_gpio_pin_get), + DEVMETHOD(gpio_pin_set, rpi_fw_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, rpi_fw_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t rpi_fw_gpio_devclass; + +static driver_t rpi_fw_gpio_driver = { + "gpio", + rpi_fw_gpio_methods, + sizeof(struct rpi_fw_gpio_softc), +}; + +EARLY_DRIVER_MODULE(rpi_fw_gpio, bcm2835_firmware, rpi_fw_gpio_driver, + rpi_fw_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Aug 3 17:17:17 2020 (r363801) +++ head/sys/conf/files.arm64 Mon Aug 3 17:18:12 2020 (r363802) @@ -108,6 +108,7 @@ arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci +arm/broadcom/bcm2835/raspberrypi_gpio.c optional soc_brcm_bcm2837 gpio | soc_brcm_bcm2838 gpio arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt From owner-svn-src-head@freebsd.org Mon Aug 3 17:53: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 31C443A3373; Mon, 3 Aug 2020 17:53:16 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL58X0bh5z4BVt; Mon, 3 Aug 2020 17:53:16 +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 EC07118433; Mon, 3 Aug 2020 17:53:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073HrFop046260; Mon, 3 Aug 2020 17:53:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HrF9c046259; Mon, 3 Aug 2020 17:53:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008031753.073HrF9c046259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Aug 2020 17:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363804 - head/lib/ncurses/ncurses X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/ncurses/ncurses X-SVN-Commit-Revision: 363804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 17:53:16 -0000 Author: jhb Date: Mon Aug 3 17:53:15 2020 New Revision: 363804 URL: https://svnweb.freebsd.org/changeset/base/363804 Log: Pass the full CFLAGS to cpp for MKlib_gen.sh. GCC's cpp was exiting immediately when it failed to find requested includes ( and ). clang-cpp emitted an error for the missing header files but continued processing the file (thus not honoring any macros defined in the missing headers). Arguably, the awk script is buggy since it doesn't check the return value of the command it executes. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D25731 Modified: head/lib/ncurses/ncurses/Makefile Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:51:57 2020 (r363803) +++ head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:53:15 2020 (r363804) @@ -345,7 +345,7 @@ codes.c: MKcodes.awk ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \ + LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ "${AWK}" generated < curses.h >$@ lib_keyname.c: keys.list MKkeyname.awk From owner-svn-src-head@freebsd.org Mon Aug 3 18:07: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 04C0A3A3C3D; Mon, 3 Aug 2020 18:07:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BL5SR6Mvyz4CKZ; Mon, 3 Aug 2020 18:07:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id BFF8C2B354; Mon, 3 Aug 2020 18:07:02 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.39.20071300 Date: Mon, 03 Aug 2020 11:06:59 -0700 Subject: Re: svn commit: r363733 - head/usr.sbin/bhyve From: Ravi Pokala To: Peter Grehan , , , Message-ID: Thread-Topic: svn commit: r363733 - head/usr.sbin/bhyve References: <202007311210.06VCATN9057871@repo.freebsd.org> In-Reply-To: <202007311210.06VCATN9057871@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 18:07:04 -0000 -----Original Message----- From: on behalf of Peter Grehan Date: 2020-07-31, Friday at 05:10 To: , , Subject: svn commit: r363733 - head/usr.sbin/bhyve Author: grehan Date: Fri Jul 31 12:10:28 2020 New Revision: 363733 URL: https://svnweb.freebsd.org/changeset/base/363733 Log: Replace magic numbers in Identify page register 0 with ATA definitions. No functional change. Verified with objdump output before/after. Requested by: rpokala Reviewed by: rpokala MFC after: 3 weeks Thanks! :-) -Ravi (rpokala@) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:09:59 2020 (r363732) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:10:28 2020 (r363733) @@ -999,7 +999,8 @@ ata_identify_init(struct ahci_port* p, int atapi) struct ata_params* ata_ident = &p->ata_ident; if (atapi) { - ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + ata_ident->config = ATA_PROTO_ATAPI | ATA_ATAPI_TYPE_CDROM | + ATA_ATAPI_REMOVABLE | ATA_DRQ_FAST; ata_ident->capabilities1 = ATA_SUPPORT_LBA | ATA_SUPPORT_DMA; ata_ident->capabilities2 = (1 << 14 | 1); From owner-svn-src-head@freebsd.org Mon Aug 3 18:08: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 C47573A3C4B; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL5Tc4pdGz4Cl5; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8470B17EFC; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073I84OO052985; Mon, 3 Aug 2020 18:08:04 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073I84oi052984; Mon, 3 Aug 2020 18:08:04 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008031808.073I84oi052984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 3 Aug 2020 18:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363805 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 363805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 18:08:04 -0000 Author: arichardson Date: Mon Aug 3 18:08:04 2020 New Revision: 363805 URL: https://svnweb.freebsd.org/changeset/base/363805 Log: Allow building setmode.c on Linux/macOS We bootstrap this file to allow compiling FreeBSD on Linux systems since some boostrap tools use setmode(). Unfortunately, glibc's sys/stat.h declares a non-static getumask() function (which is unimplemented!) and that conflicts with the local getumask() function. To work around this simply use a different name here. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25929 Modified: head/lib/libc/gen/setmode.c Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Mon Aug 3 17:53:15 2020 (r363804) +++ head/lib/libc/gen/setmode.c Mon Aug 3 18:08:04 2020 (r363805) @@ -70,7 +70,7 @@ typedef struct bitcmd { #define CMD2_OBITS 0x08 #define CMD2_UBITS 0x10 -static mode_t getumask(void); +static mode_t get_current_umask(void); static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t); static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG @@ -186,7 +186,7 @@ setmode(const char *p) * Get a copy of the mask for the permissions that are mask relative. * Flip the bits, we want what's not set. */ - mask = ~getumask(); + mask = ~get_current_umask(); setlen = SET_LEN + 2; @@ -343,13 +343,14 @@ out: } static mode_t -getumask(void) +get_current_umask(void) { sigset_t sigset, sigoset; size_t len; mode_t mask; u_short smask; +#ifdef KERN_PROC_UMASK /* * First try requesting the umask without temporarily modifying it. * Note that this does not work if the sysctl @@ -359,7 +360,7 @@ getumask(void) if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 }, 4, &smask, &len, NULL, 0) == 0) return (smask); - +#endif /* * Since it's possible that the caller is opening files inside a signal * handler, protect them as best we can. From owner-svn-src-head@freebsd.org Mon Aug 3 18:08: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 53F933A3EC2; Mon, 3 Aug 2020 18:08:13 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL5Tm6mM1z4Cnq; Mon, 3 Aug 2020 18:08:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1127718617; Mon, 3 Aug 2020 18:08:11 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073I8ACS053039; Mon, 3 Aug 2020 18:08:10 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073I8ANI053038; Mon, 3 Aug 2020 18:08:10 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008031808.073I8ANI053038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 3 Aug 2020 18:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363806 - head/usr.sbin/nmtree X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/nmtree X-SVN-Commit-Revision: 363806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 18:08:13 -0000 Author: arichardson Date: Mon Aug 3 18:08:10 2020 New Revision: 363806 URL: https://svnweb.freebsd.org/changeset/base/363806 Log: Allow bootstrapping mtree on Linux systems Linux glibc has a dummy lchmod that always fails and emitting a linker warning when used. Don't fail the build due to that warning when bootstrapping by setting LD_FATAL_WARNINGS=no. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25930 Modified: head/usr.sbin/nmtree/Makefile Modified: head/usr.sbin/nmtree/Makefile ============================================================================== --- head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:04 2020 (r363805) +++ head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:10 2020 (r363806) @@ -22,4 +22,10 @@ MLINKS= mtree.8 nmtree.8 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.if defined(BOOTSTRAPPING) +# Linux glibc has a dummy lchmod that always fails. Don't fail due to +# the linker warning that it emits. +LD_FATAL_WARNINGS=no +.endif + .include From owner-svn-src-head@freebsd.org Mon Aug 3 19:18: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 7D9D73A5B27; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL7332lhZz4Jj2; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4169D193AA; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073JIdMW097209; Mon, 3 Aug 2020 19:18:39 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073JId8R097208; Mon, 3 Aug 2020 19:18:39 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031918.073JId8R097208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 19:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363809 - head/usr.bin/gh-bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/gh-bc X-SVN-Commit-Revision: 363809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 19:18:39 -0000 Author: se Date: Mon Aug 3 19:18:38 2020 New Revision: 363809 URL: https://svnweb.freebsd.org/changeset/base/363809 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:00:12 2020 (r363808) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 19:18:38 2020 (r363809) @@ -59,6 +59,10 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif +.if ${MK_TESTS} != "no" +#SUBDIR+= tests +.endif + .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} NLSSRCFILES_${catalog:C/.*://}= ${catalog:C/.*://}.msg From owner-svn-src-head@freebsd.org Mon Aug 3 19:20: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 A20583A5B42; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL75C48Mtz4JgF; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72365190BB; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073JKVnW097397; Mon, 3 Aug 2020 19:20:31 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073JKRTE097372; Mon, 3 Aug 2020 19:20:27 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031920.073JKRTE097372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 19:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363810 - in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Commit-Revision: 363810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 19:20:31 -0000 Author: se Date: Mon Aug 3 19:20:26 2020 New Revision: 363810 URL: https://svnweb.freebsd.org/changeset/base/363810 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Added: head/contrib/bc/tests/bc/misc6.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6.txt head/contrib/bc/tests/bc/misc6_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6_results.txt head/contrib/bc/tests/bc/misc7.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7.txt head/contrib/bc/tests/bc/misc7_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7_results.txt head/contrib/bc/tests/bc/stdin1.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1.txt head/contrib/bc/tests/bc/stdin1_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1_results.txt head/contrib/bc/tests/bc/stdin2.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2.txt head/contrib/bc/tests/bc/stdin2_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2_results.txt Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/include/bc.h head/contrib/bc/include/vm.h head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/bc/manuals/dc/N.1.md head/contrib/bc/manuals/dc/NP.1 head/contrib/bc/manuals/dc/NP.1.md head/contrib/bc/manuals/dc/P.1 head/contrib/bc/manuals/dc/P.1.md head/contrib/bc/src/args.c head/contrib/bc/src/bc/bc.c head/contrib/bc/src/bc/parse.c head/contrib/bc/src/dc/dc.c head/contrib/bc/src/vm.c head/contrib/bc/tests/bc/all.txt Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/Makefile.in Mon Aug 3 19:20:26 2020 (r363810) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/NEWS.md Mon Aug 3 19:20:26 2020 (r363810) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like the one in the last release except it applies if files are being +executed. I also made the fix more general. + +The behavior that was changed is that `bc` now exits when given `-e`, `-f`, +`--expression` or `--file`. However, if the last one of those is `-f-` (using +`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of +the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits. + +Next, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables +since their use is not needed with the behavior change. + +Finally, I made it so `bc` does not print the header, though the `-q` and +`--quiet` options were kept for compatibility with GNU `bc`. + ## 3.1.3 This is a production release that fixes one minor bug: if `bc` was invoked like Modified: head/contrib/bc/README.md ============================================================================== --- head/contrib/bc/README.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/README.md Mon Aug 3 19:20:26 2020 (r363810) @@ -262,8 +262,8 @@ Other projects based on this bc are: toybox `bc` should be reported there. * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better - to report bugs there, and the maintainers of the package will contact me if - necessary. + to [report bugs there][24], as well as [submit patches][25], and the + maintainers of the package will contact me if necessary. ## Language @@ -332,4 +332,6 @@ Folders: [20]: https://git.yzena.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator -[23]: https://github.com/freebsd/freebsd/tree/master/contrib/bc +[23]: https://svnweb.freebsd.org/base/head/contrib/bc/ +[24]: https://bugs.freebsd.org/ +[25]: https://reviews.freebsd.org/ Modified: head/contrib/bc/include/bc.h ============================================================================== --- head/contrib/bc/include/bc.h Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/include/bc.h Mon Aug 3 19:20:26 2020 (r363810) @@ -159,9 +159,6 @@ void bc_parse_expr(BcParse *p, uint8_t flags); void bc_parse_parse(BcParse *p); void bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next); -// This is necessary to clear up for if statements at the end of files. -void bc_parse_noElse(BcParse *p); - extern const char bc_sig_msg[]; extern const uchar bc_sig_msg_len; Modified: head/contrib/bc/include/vm.h ============================================================================== --- head/contrib/bc/include/vm.h Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/include/vm.h Mon Aug 3 19:20:26 2020 (r363810) @@ -102,11 +102,10 @@ #define BC_FLAG_G (UINTMAX_C(1)<<4) #endif // BC_ENABLED -#define BC_FLAG_Q (UINTMAX_C(1)<<5) -#define BC_FLAG_I (UINTMAX_C(1)<<6) -#define BC_FLAG_P (UINTMAX_C(1)<<7) -#define BC_FLAG_TTYIN (UINTMAX_C(1)<<8) -#define BC_FLAG_TTY (UINTMAX_C(1)<<9) +#define BC_FLAG_I (UINTMAX_C(1)<<5) +#define BC_FLAG_P (UINTMAX_C(1)<<6) +#define BC_FLAG_TTYIN (UINTMAX_C(1)<<7) +#define BC_FLAG_TTY (UINTMAX_C(1)<<8) #define BC_TTYIN (vm.flags & BC_FLAG_TTYIN) #define BC_TTY (vm.flags & BC_FLAG_TTY) @@ -279,12 +278,6 @@ #define BC_VM_INVALID_CATALOG ((nl_catd) -1) -// dc does not use is_stdin. -#if !BC_ENABLED -#define bc_vm_process(text, is_stdin) bc_vm_process(text) -#else // BC_ENABLED -#endif // BC_ENABLED - typedef struct BcVm { volatile sig_atomic_t status; @@ -310,6 +303,7 @@ typedef struct BcVm { uint16_t nchars; uint16_t line_len; + bool no_exit_exprs; bool eof; BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH]; @@ -360,7 +354,7 @@ typedef struct BcVm { void bc_vm_info(const char* const help); void bc_vm_boot(int argc, char *argv[], const char *env_len, - const char* const env_args, const char* env_exp_quit); + const char* const env_args); void bc_vm_shutdown(void); void bc_vm_printf(const char *fmt, ...); Modified: head/contrib/bc/manuals/bc.1.md.in ============================================================================== --- head/contrib/bc/manuals/bc.1.md.in Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc.1.md.in Mon Aug 3 19:20:26 2020 (r363810) @@ -195,11 +195,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -229,9 +229,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -241,9 +242,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1614,12 +1614,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/A.1 ============================================================================== --- head/contrib/bc/manuals/bc/A.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/A.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -231,10 +231,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -246,10 +248,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1913,14 +1914,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/A.1.md ============================================================================== --- head/contrib/bc/manuals/bc/A.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/A.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -153,11 +153,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -187,9 +187,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -199,9 +200,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1523,12 +1523,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/E.1 ============================================================================== --- head/contrib/bc/manuals/bc/E.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/E.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/E.1.md ============================================================================== --- head/contrib/bc/manuals/bc/E.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/E.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -171,9 +171,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -183,9 +184,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -919,12 +919,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EH.1 ============================================================================== --- head/contrib/bc/manuals/bc/EH.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EH.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EH.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EH.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EH.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHN.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHN.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHN.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHN.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHN.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHN.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHNP.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHNP.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHNP.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHNP.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHNP.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHNP.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHP.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHP.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHP.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHP.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHP.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHP.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EN.1 ============================================================================== --- head/contrib/bc/manuals/bc/EN.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EN.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EN.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EN.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EN.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 3 20:26: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 B4D423A6E80; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL8Xs4Rcgz4MW6; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750F11A212; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073KQ5jY040430; Mon, 3 Aug 2020 20:26:05 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073KQ4BK040427; Mon, 3 Aug 2020 20:26:04 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008032026.073KQ4BK040427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363811 - in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests X-SVN-Commit-Revision: 363811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 20:26:05 -0000 Author: se Date: Mon Aug 3 20:26:04 2020 New Revision: 363811 URL: https://svnweb.freebsd.org/changeset/base/363811 Log: Connect the tests provided with the new bc and dc The tests compare the command output (including of error cases) with the expected output and exit code. Not all tests are executed, since some expect to have a known good bc and dc binary installed and compare results of large amounts of generated data being processed by both versions to test for regressions. Added: head/usr.bin/gh-bc/tests/ head/usr.bin/gh-bc/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/gh-bc/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Aug 3 19:20:26 2020 (r363810) +++ head/etc/mtree/BSD.tests.dist Mon Aug 3 20:26:04 2020 (r363811) @@ -1002,6 +1002,8 @@ .. getconf .. + gh-bc + .. grep .. gzip Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:20:26 2020 (r363810) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -59,9 +59,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -.if ${MK_TESTS} != "no" -#SUBDIR+= tests -.endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} Added: head/usr.bin/gh-bc/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gh-bc/tests/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +.include + +PACKAGE= tests + +TEST_DIR= ${SRCTOP}/contrib/bc + +TESTSDIR= ${TESTSBASE}/usr.bin/gh-bc + +.PATH: ${SRCTOP}/tests + +FILESGROUPS+= FILESf +FILESfPACKAGE= ${PACKAGE} +FILESfDIR= ${TESTSDIR} +FILESf= ${TEST_DIR}/functions.sh +FILESfMODE= 0755 + +FILESGROUPS+= FILEStests +FILEStestsPACKAGE= ${PACKAGE} +FILEStestsDIR= ${TESTSDIR}/tests +FILEStests!= echo ${TEST_DIR}/tests/*.py ${TEST_DIR}/tests/*.sh ${TEST_DIR}/tests/*.txt +FILEStestsMODE= 0755 + +FILESGROUPS+= FILESbc +FILESbcPACKAGE= ${PACKAGE} +FILESbcDIR= ${TESTSDIR}/tests/bc +FILESbc!= echo ${TEST_DIR}/tests/bc/*.* + +FILESGROUPS+= FILESbc_errors +FILESbc_errorsPACKAGE= ${PACKAGE} +FILESbc_errorsDIR= ${TESTSDIR}/tests/bc/errors +FILESbc_errors!= echo ${TEST_DIR}/tests/bc/errors/*.* + +FILESGROUPS+= FILESbc_scripts +FILESbc_scriptsPACKAGE= ${PACKAGE} +FILESbc_scriptsDIR= ${TESTSDIR}/tests/bc/scripts +FILESbc_scripts!= echo ${TEST_DIR}/tests/bc/scripts/*.* +FILESbc_scriptsMODE= 0755 + +FILESGROUPS+= FILESdc +FILESdcPACKAGE= ${PACKAGE} +FILESdcDIR= ${TESTSDIR}/tests/dc +FILESdc!= echo ${TEST_DIR}/tests/dc/*.* + +FILESGROUPS+= FILESdc_errors +FILESdc_errorsPACKAGE= ${PACKAGE} +FILESdc_errorsDIR= ${TESTSDIR}/tests/dc/errors +FILESdc_errors!= echo ${TEST_DIR}/tests/dc/errors/*.* + +FILESGROUPS+= FILESdc_scripts +FILESdc_scriptsPACKAGE= ${PACKAGE} +FILESdc_scriptsDIR= ${TESTSDIR}/tests/dc/scripts +FILESdc_scripts!= echo ${TEST_DIR}/tests/dc/scripts/*.* +FILESdc_scriptsMODE= 0755 + +PLAIN_TESTS_SH= bc_tests dc_tests + +bc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh bc 1 1 0 0 bc" >> ${.TARGET} + +dc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh dc 1 1 0 0 dc" >> ${.TARGET} + +.include From owner-svn-src-head@freebsd.org Mon Aug 3 22:12: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 DDD143A8C21; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLBvQ5cY4z4Rmh; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A54431B589; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073MCIBv007841; Mon, 3 Aug 2020 22:12:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073MCIqu007800; Mon, 3 Aug 2020 22:12:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008032212.073MCIqu007800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Aug 2020 22:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363812 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 22:12:18 -0000 Author: imp Date: Mon Aug 3 22:12:18 2020 New Revision: 363812 URL: https://svnweb.freebsd.org/changeset/base/363812 Log: Some function had the blank lines, others didn't. Most of the ones that didn't were newer, so remove this now-optional blank line everywhere. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Aug 3 20:26:04 2020 (r363811) +++ head/sys/kern/subr_bus.c Mon Aug 3 22:12:18 2020 (r363812) @@ -234,7 +234,6 @@ devclass_sysctl_handler(SYSCTL_HANDLER_ARGS) static void devclass_sysctl_init(devclass_t dc) { - if (dc->sysctl_tree != NULL) return; sysctl_ctx_init(&dc->sysctl_ctx); @@ -453,7 +452,6 @@ devinit(void) static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); if (devsoftc.inuse) { mtx_unlock(&devsoftc.mtx); @@ -468,7 +466,6 @@ devopen(struct cdev *dev, int oflags, int devtype, str static int devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); devsoftc.inuse = 0; devsoftc.nonblock = 0; @@ -522,7 +519,6 @@ static int devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { switch (cmd) { - case FIONBIO: if (*(int*)data) devsoftc.nonblock = 1; @@ -585,7 +581,6 @@ devkqfilter(struct cdev *dev, struct knote *kn) static void filt_devctl_detach(struct knote *kn) { - knlist_remove(&devsoftc.sel.si_note, kn, 0); } @@ -661,7 +656,6 @@ out: void devctl_queue_data(char *data) { - devctl_queue_data_f(data, M_NOWAIT); } @@ -704,7 +698,6 @@ void devctl_notify(const char *system, const char *subsystem, const char *type, const char *data) { - devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } @@ -876,7 +869,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) void devctl_safe_quote_sb(struct sbuf *sb, const char *src) { - while (*src != '\0') { if (*src == '"' || *src == '\\') sbuf_putc(sb, '\\'); @@ -2597,7 +2589,6 @@ device_claim_softc(device_t dev) void * device_get_ivars(device_t dev) { - KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)")); return (dev->ivars); } @@ -2608,7 +2599,6 @@ device_get_ivars(device_t dev) void device_set_ivars(device_t dev, void * ivars) { - KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)")); dev->ivars = ivars; } @@ -3087,7 +3077,6 @@ device_detach(device_t dev) int device_quiesce(device_t dev) { - PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); @@ -3148,7 +3137,6 @@ device_set_unit(device_t dev, int unit) void resource_init_map_request_impl(struct resource_map_request *args, size_t sz) { - bzero(args, sz); args->size = sz; args->memattr = VM_MEMATTR_UNCACHEABLE; @@ -3704,7 +3692,6 @@ resource_list_purge(struct resource_list *rl) device_t bus_generic_add_child(device_t dev, u_int order, const char *name, int unit) { - return (device_add_child_ordered(dev, order, name, unit)); } @@ -3852,7 +3839,6 @@ bus_generic_suspend_child(device_t dev, device_t child int bus_generic_resume_child(device_t dev, device_t child) { - DEVICE_RESUME(child); child->flags &= ~DF_SUSPENDED; @@ -3944,7 +3930,6 @@ bus_helper_reset_post(device_t dev, int flags) static void bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags) { - child = TAILQ_NEXT(child, link); if (child == NULL) return; @@ -4356,7 +4341,6 @@ int bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_BIND_INTR(dev->parent, child, irq, cpu)); @@ -4373,7 +4357,6 @@ int bus_generic_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_CONFIG_INTR(dev->parent, irq, trig, pol)); @@ -4390,7 +4373,6 @@ int bus_generic_describe_intr(device_t dev, device_t child, struct resource *irq, void *cookie, const char *descr) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_DESCRIBE_INTR(dev->parent, child, irq, cookie, @@ -4408,7 +4390,6 @@ int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset)); @@ -4424,7 +4405,6 @@ bus_generic_get_cpus(device_t dev, device_t child, enu bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_DMA_TAG(dev->parent, child)); @@ -4440,7 +4420,6 @@ bus_generic_get_dma_tag(device_t dev, device_t child) bus_space_tag_t bus_generic_get_bus_tag(device_t dev, device_t child) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_BUS_TAG(dev->parent, child)); @@ -4587,7 +4566,6 @@ bus_generic_child_present(device_t dev, device_t child int bus_generic_get_domain(device_t dev, device_t child, int *domain) { - if (dev->parent) return (BUS_GET_DOMAIN(dev->parent, dev, domain)); @@ -4603,7 +4581,6 @@ bus_generic_get_domain(device_t dev, device_t child, i int bus_null_rescan(device_t dev) { - return (ENXIO); } @@ -5101,7 +5078,6 @@ static int root_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { - switch (op) { case INTR_CPUS: /* Default to returning the set of all CPUs. */ @@ -5182,7 +5158,6 @@ DECLARE_MODULE(rootbus, root_bus_mod, SI_SUB_DRIVERS, void root_bus_configure(void) { - PDEBUG((".")); /* Eventually this will be split up, but this is sufficient for now. */ @@ -5556,7 +5531,6 @@ bus_data_generation_check(int generation) void bus_data_generation_update(void) { - atomic_add_int(&bus_data_generation, 1); } @@ -5944,7 +5918,6 @@ static struct cdevsw devctl2_cdevsw = { static void devctl2_init(void) { - make_dev_credf(MAKEDEV_ETERNAL, &devctl2_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "devctl2"); } @@ -5960,7 +5933,6 @@ SYSCTL_INT(_debug, OID_AUTO, obsolete_panic, CTLFLAG_R static void gone_panic(int major, int running, const char *msg) { - switch (obsolete_panic) { case 0: @@ -5977,7 +5949,6 @@ gone_panic(int major, int running, const char *msg) void _gone_in(int major, const char *msg) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); if (P_OSREL_MAJOR(__FreeBSD_version) >= major) printf("Obsolete code will be removed soon: %s\n", msg); @@ -5989,7 +5960,6 @@ _gone_in(int major, const char *msg) void _gone_in_dev(device_t dev, int major, const char *msg) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); if (P_OSREL_MAJOR(__FreeBSD_version) >= major) device_printf(dev, From owner-svn-src-head@freebsd.org Mon Aug 3 22:13: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 092E03A8E04; Mon, 3 Aug 2020 22:13:04 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLBwH6QxHz4SGV; Mon, 3 Aug 2020 22:13:03 +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 C14531B3D5; Mon, 3 Aug 2020 22:13:03 +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 073MD32f008087; Mon, 3 Aug 2020 22:13:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073MD3om008083; Mon, 3 Aug 2020 22:13:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008032213.073MD3om008083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2020 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363813 - in head: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Commit-Revision: 363813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 03 Aug 2020 22:13:04 -0000 Author: kib Date: Mon Aug 3 22:13:02 2020 New Revision: 363813 URL: https://svnweb.freebsd.org/changeset/base/363813 Log: Add SOL_LOCAL symbolic constant for unix socket option level. The constant seems to exists on MacOS X >= 10.8. Requested by: swills Reviewed by: allanjude, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25933 Modified: head/lib/libc/gen/getpeereid.c head/share/man/man4/unix.4 head/sys/kern/uipc_usrreq.c head/sys/sys/un.h Modified: head/lib/libc/gen/getpeereid.c ============================================================================== --- head/lib/libc/gen/getpeereid.c Mon Aug 3 22:12:18 2020 (r363812) +++ head/lib/libc/gen/getpeereid.c Mon Aug 3 22:13:02 2020 (r363813) @@ -47,7 +47,7 @@ getpeereid(int s, uid_t *euid, gid_t *egid) int error; xuclen = sizeof(xuc); - error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); if (xuc.cr_version != XUCRED_VERSION) { Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Mon Aug 3 22:12:18 2020 (r363812) +++ head/share/man/man4/unix.4 Mon Aug 3 22:13:02 2020 (r363813) @@ -28,7 +28,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd August 3, 2020 .Dt UNIX 4 .Os .Sh NAME @@ -195,7 +195,9 @@ The sending process could have exited and its process reused for a new process. .Sh SOCKET OPTIONS .Tn UNIX -domain sockets support a number of socket options which can be set with +domain sockets support a number of socket options for the options level +.Dv SOL_LOCAL , +which can be set with .Xr setsockopt 2 and tested with .Xr getsockopt 2 : Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Aug 3 22:12:18 2020 (r363812) +++ head/sys/kern/uipc_usrreq.c Mon Aug 3 22:13:02 2020 (r363813) @@ -1470,7 +1470,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt struct xucred xu; int error, optval; - if (sopt->sopt_level != 0) + if (sopt->sopt_level != SOL_LOCAL) return (EINVAL); unp = sotounpcb(so); Modified: head/sys/sys/un.h ============================================================================== --- head/sys/sys/un.h Mon Aug 3 22:12:18 2020 (r363812) +++ head/sys/sys/un.h Mon Aug 3 22:13:02 2020 (r363813) @@ -62,6 +62,8 @@ struct sockaddr_un { #if __BSD_VISIBLE +#define SOL_LOCAL 0 /* Options for local socket */ + /* Socket options. */ #define LOCAL_PEERCRED 1 /* retrieve peer credentials */ #define LOCAL_CREDS 2 /* pass credentials to receiver */ From owner-svn-src-head@freebsd.org Tue Aug 4 02:06: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 6DF073ADAB0; Tue, 4 Aug 2020 02:06:50 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJ622Hvcz4fks; Tue, 4 Aug 2020 02:06:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 335C01E0ED; Tue, 4 Aug 2020 02:06:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07426o3S050071; Tue, 4 Aug 2020 02:06:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07426oHE050070; Tue, 4 Aug 2020 02:06:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040206.07426oHE050070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363817 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 363817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:06:50 -0000 Author: kevans Date: Tue Aug 4 02:06:49 2020 New Revision: 363817 URL: https://svnweb.freebsd.org/changeset/base/363817 Log: regex(3): belatedly document REG_POSIX from r363734 My original patch included this documented, but it appears that I failed to include the manpage update. Do so now. Modified: head/lib/libc/regex/regex.3 Modified: head/lib/libc/regex/regex.3 ============================================================================== --- head/lib/libc/regex/regex.3 Tue Aug 4 00:28:06 2020 (r363816) +++ head/lib/libc/regex/regex.3 Tue Aug 4 02:06:49 2020 (r363817) @@ -32,7 +32,7 @@ .\" @(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd May 25, 2016 +.Dd April 15, 2017 .Dt REGEX 3 .Os .Sh NAME @@ -178,6 +178,17 @@ member is of type .Ft "const char *" . This flag permits inclusion of NULs in the RE; they are considered ordinary characters. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_POSIX +Compile only +.St -p1003.2 +compliant expressions. +This flag has no effect unless linking against +.Nm libregex . This is an extension, compatible with but not specified by .St -p1003.2 , From owner-svn-src-head@freebsd.org Tue Aug 4 02:14: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 779863AE012; Tue, 4 Aug 2020 02:14:52 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJHJ2WyMz4gKX; Tue, 4 Aug 2020 02:14:52 +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 3A96E1DEE1; Tue, 4 Aug 2020 02:14:52 +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 0742EqYg056051; Tue, 4 Aug 2020 02:14:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742Epw2056049; Tue, 4 Aug 2020 02:14:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040214.0742Epw2056049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363818 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 363818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:14:52 -0000 Author: kevans Date: Tue Aug 4 02:14:51 2020 New Revision: 363818 URL: https://svnweb.freebsd.org/changeset/base/363818 Log: libregex: Implement a subset of the GNU extensions The entire patch-set is not yet mature enough for commit, but this usable subset is generally enough for googletest to be happy with and mostly map to some existing concepts, so they're not as invasive. The specific changes included here are: - Branching in BREs with \| - \w and \W for [[:alnum:]] and [^[:alnum:]] respectively - \s and \S for [[:space:]] and [^[:space:]] respectively - Additional quantifiers in BREs, \? and \+ (self-explanatory) There's some #ifdef'd out work for allowing empty branches as a match-all. This is a feature that's under assessment... future work will determine how standard this behavior is and act accordingly. Modified: head/lib/libc/regex/regcomp.c head/lib/libc/regex/regex2.h Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Tue Aug 4 02:06:49 2020 (r363817) +++ head/lib/libc/regex/regcomp.c Tue Aug 4 02:14:51 2020 (r363818) @@ -92,6 +92,7 @@ struct parse { const char *next; /* next character in RE */ const char *end; /* end of string (-> NUL normally) */ int error; /* has an error been seen? */ + int gnuext; sop *strip; /* malloced strip */ sopno ssize; /* malloced strip size (allocated) */ sopno slen; /* malloced strip length (used) */ @@ -131,7 +132,9 @@ static int p_count(struct parse *p); static void p_bracket(struct parse *p); static int p_range_cmp(wchar_t c1, wchar_t c2); static void p_b_term(struct parse *p, cset *cs); +static int p_b_pseudoclass(struct parse *p, char c); static void p_b_cclass(struct parse *p, cset *cs); +static void p_b_cclass_named(struct parse *p, cset *cs, const char[]); static void p_b_eclass(struct parse *p, cset *cs); static wint_t p_b_symbol(struct parse *p); static wint_t p_b_coll_elem(struct parse *p, wint_t endc); @@ -181,6 +184,7 @@ static char nuls[10]; /* place to point scanner in ev #define SEESPEC(a) (p->bre ? SEETWO('\\', a) : SEE(a)) #define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) #define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) +#define EATSPEC(a) (p->bre ? EATTWO('\\', a) : EAT(a)) #define NEXT() (p->next++) #define NEXT2() (p->next += 2) #define NEXTn(n) (p->next += (n)) @@ -270,14 +274,22 @@ regcomp_internal(regex_t * __restrict preg, p->pbegin[i] = 0; p->pend[i] = 0; } +#ifdef LIBREGEX + if (cflags®_POSIX) { + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; + } else + p->gnuext = p->allowbranch = true; +#else + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; +#endif if (cflags & REG_EXTENDED) { - p->allowbranch = true; p->bre = false; p->parse_expr = p_ere_exp; p->pre_parse = NULL; p->post_parse = NULL; } else { - p->allowbranch = false; p->bre = true; p->parse_expr = p_simp_re; p->pre_parse = p_bre_pre_parse; @@ -388,6 +400,10 @@ p_ere_exp(struct parse *p, struct branchc *bc) sopno pos; int count; int count2; +#ifdef LIBREGEX + int i; + int handled; +#endif sopno subno; int wascaret = 0; @@ -395,6 +411,9 @@ p_ere_exp(struct parse *p, struct branchc *bc) assert(MORE()); /* caller should have ensured this */ c = GETNEXT(); +#ifdef LIBREGEX + handled = 0; +#endif pos = HERE(); switch (c) { case '(': @@ -457,6 +476,47 @@ p_ere_exp(struct parse *p, struct branchc *bc) case '\\': (void)REQUIRE(MORE(), REG_EESCAPE); wc = WGETNEXT(); +#ifdef LIBREGEX + if (p->gnuext) { + handled = 1; + switch (wc) { + case 'W': + case 'w': + case 'S': + case 's': + p_b_pseudoclass(p, wc); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + i = wc - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0) { + assert(i <= p->g->nsub); + EMIT(OBACK_, i); + assert(p->pbegin[i] != 0); + assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); + assert(OP(p->strip[p->pend[i]]) == ORPAREN); + (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + EMIT(O_BACK, i); + } else + SETERROR(REG_ESUBREG); + p->g->backrefs = 1; + break; + default: + handled = 0; + } + /* Don't proceed to the POSIX bits if we've already handled it */ + if (handled) + break; + } +#endif switch (wc) { case '<': EMIT(OBOW, 0); @@ -567,7 +627,7 @@ p_branch_eat_delim(struct parse *p, struct branchc *bc (void)bc; nskip = 0; - while (EAT('|')) + while (EATSPEC('|')) ++nskip; return (nskip); } @@ -619,9 +679,15 @@ static bool p_branch_empty(struct parse *p, struct branchc *bc) { +#if defined(LIBREGEX) && defined(NOTYET) + if (bc->outer) + p->g->iflags |= EMPTBR; + return (true); +#else (void)bc; SETERROR(REG_EMPTY); return (false); +#endif } /* @@ -713,7 +779,11 @@ p_re(struct parse *p, } if (p->post_parse != NULL) p->post_parse(p, &bc); - (void) REQUIRE(HERE() != bc.start, REG_EMPTY); + (void) REQUIRE(p->gnuext || HERE() != bc.start, REG_EMPTY); +#ifdef LIBREGEX + if (HERE() == bc.start && !p_branch_empty(p, &bc)) + break; +#endif if (!p->allowbranch) break; /* @@ -740,101 +810,122 @@ static bool /* was the simple RE an unbackslashed $? p_simp_re(struct parse *p, struct branchc *bc) { int c; + int cc; /* convenient/control character */ int count; int count2; sopno pos; + bool handled; int i; wint_t wc; sopno subno; # define BACKSL (1<gnuext) { + handled = true; + switch (c) { + case BACKSL|'W': + case BACKSL|'w': + case BACKSL|'S': + case BACKSL|'s': + p_b_pseudoclass(p, cc); + break; + default: + handled = false; + } + } +#endif } - switch (c) { - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'<': - EMIT(OBOW, 0); - break; - case BACKSL|'>': - EMIT(OEOW, 0); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_re(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); + if (!handled) { + switch (c) { + case '.': + if (p->g->cflags®_NEWLINE) + nonnewline(p); + else + EMIT(OANY, 0); + break; + case '[': + p_bracket(p); + break; + case BACKSL|'<': + EMIT(OBOW, 0); + break; + case BACKSL|'>': + EMIT(OEOW, 0); + break; + case BACKSL|'{': + SETERROR(REG_BADRPT); + break; + case BACKSL|'(': + p->g->nsub++; + subno = p->g->nsub; + if (subno < NPAREN) + p->pbegin[subno] = HERE(); + EMIT(OLPAREN, subno); + /* the MORE here is an error heuristic */ + if (MORE() && !SEETWO('\\', ')')) + p_re(p, '\\', ')'); + if (subno < NPAREN) { + p->pend[subno] = HERE(); + assert(p->pend[subno] != 0); + } + EMIT(ORPAREN, subno); + (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN); + break; + case BACKSL|')': /* should not get here -- must be user */ + SETERROR(REG_EPAREN); + break; + case BACKSL|'1': + case BACKSL|'2': + case BACKSL|'3': + case BACKSL|'4': + case BACKSL|'5': + case BACKSL|'6': + case BACKSL|'7': + case BACKSL|'8': + case BACKSL|'9': + i = (c&~BACKSL) - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0) { + assert(i <= p->g->nsub); + EMIT(OBACK_, i); + assert(p->pbegin[i] != 0); + assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); + assert(OP(p->strip[p->pend[i]]) == ORPAREN); + (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + EMIT(O_BACK, i); + } else + SETERROR(REG_ESUBREG); + p->g->backrefs = 1; + break; + case '*': + /* + * Ordinary if used as the first character beyond BOL anchor of + * a (sub-)expression, counts as a bad repetition operator if it + * appears otherwise. + */ + (void)REQUIRE(bc->nchain == 0, REG_BADRPT); + /* FALLTHROUGH */ + default: + if (p->error != 0) + return (false); /* Definitely not $... */ + p->next--; + wc = WGETNEXT(); + if ((c & BACKSL) == 0 || may_escape(p, wc)) + ordinary(p, wc); + else + SETERROR(REG_EESCAPE); + break; } - EMIT(ORPAREN, subno); - (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - /* - * Ordinary if used as the first character beyond BOL anchor of - * a (sub-)expression, counts as a bad repetition operator if it - * appears otherwise. - */ - (void)REQUIRE(bc->nchain == 0, REG_BADRPT); - /* FALLTHROUGH */ - default: - if (p->error != 0) - return (false); /* Definitely not $... */ - p->next--; - wc = WGETNEXT(); - if ((c & BACKSL) == 0 || may_escape(p, wc)) - ordinary(p, wc); - else - SETERROR(REG_EESCAPE); - break; } if (EAT('*')) { /* implemented as +? */ @@ -843,6 +934,14 @@ p_simp_re(struct parse *p, struct branchc *bc) ASTERN(O_PLUS, pos); INSERT(OQUEST_, pos); ASTERN(O_QUEST, pos); +#ifdef LIBREGEX + } else if (p->gnuext && EATTWO('\\', '?')) { + INSERT(OQUEST_, pos); + ASTERN(O_QUEST, pos); + } else if (p->gnuext && EATTWO('\\', '+')) { + INSERT(OPLUS_, pos); + ASTERN(O_PLUS, pos); +#endif } else if (EATTWO('\\', '{')) { count = p_count(p); if (EAT(',')) { @@ -1035,6 +1134,41 @@ p_b_term(struct parse *p, cset *cs) } /* + - p_b_pseudoclass - parse a pseudo-class (\w, \W, \s, \S) + == static int p_b_pseudoclass(struct parse *p, char c) + */ +static int +p_b_pseudoclass(struct parse *p, char c) { + cset *cs; + + if ((cs = allocset(p)) == NULL) + return(0); + + if (p->g->cflags®_ICASE) + cs->icase = 1; + + switch (c) { + case 'W': + cs->invert = 1; + /* PASSTHROUGH */ + case 'w': + p_b_cclass_named(p, cs, "alnum"); + break; + case 'S': + cs->invert = 1; + /* PASSTHROUGH */ + case 's': + p_b_cclass_named(p, cs, "space"); + break; + default: + return(0); + } + + EMIT(OANYOF, (int)(cs - p->g->sets)); + return(1); +} + +/* - p_b_cclass - parse a character-class name and deal with it == static void p_b_cclass(struct parse *p, cset *cs); */ @@ -1043,7 +1177,6 @@ p_b_cclass(struct parse *p, cset *cs) { const char *sp = p->next; size_t len; - wctype_t wct; char clname[16]; while (MORE() && isalpha((uch)PEEK())) @@ -1055,6 +1188,17 @@ p_b_cclass(struct parse *p, cset *cs) } memcpy(clname, sp, len); clname[len] = '\0'; + + p_b_cclass_named(p, cs, clname); +} +/* + - p_b_cclass_named - deal with a named character class + == static void p_b_cclass_named(struct parse *p, cset *cs, const char []); + */ +static void +p_b_cclass_named(struct parse *p, cset *cs, const char clname[]) { + wctype_t wct; + if ((wct = wctype(clname)) == 0) { SETERROR(REG_ECTYPE); return; Modified: head/lib/libc/regex/regex2.h ============================================================================== --- head/lib/libc/regex/regex2.h Tue Aug 4 02:06:49 2020 (r363817) +++ head/lib/libc/regex/regex2.h Tue Aug 4 02:14:51 2020 (r363818) @@ -182,6 +182,7 @@ struct re_guts { # define USEBOL 01 /* used ^ */ # define USEEOL 02 /* used $ */ # define BAD 04 /* something wrong */ +# define EMPTBR 010 /* empty branch present */ int nbol; /* number of ^ used */ int neol; /* number of $ used */ char *must; /* match must contain this string */ From owner-svn-src-head@freebsd.org Tue Aug 4 02:16: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 22B903ADDDA; Tue, 4 Aug 2020 02:16:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJKS04mkz3Rhr; Tue, 4 Aug 2020 02:16: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 DA3101DC74; Tue, 4 Aug 2020 02:16: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 0742Gh07056184; Tue, 4 Aug 2020 02:16:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742GhUW056183; Tue, 4 Aug 2020 02:16:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040216.0742GhUW056183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363819 - head/lib/libregex/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libregex/tests X-SVN-Commit-Revision: 363819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:16:44 -0000 Author: kevans Date: Tue Aug 4 02:16:43 2020 New Revision: 363819 URL: https://svnweb.freebsd.org/changeset/base/363819 Log: libregex: disable some of the unimplemented test cases for now This should allow the tests to actually pass. Future work will uncomment the unimplemented tests as they're implemented. Modified: head/lib/libregex/tests/gnuext.in head/lib/libregex/tests/libregex_test.sh Modified: head/lib/libregex/tests/gnuext.in ============================================================================== --- head/lib/libregex/tests/gnuext.in Tue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/gnuext.in Tue Aug 4 02:16:43 2020 (r363819) @@ -17,14 +17,16 @@ a\|b\|c b abc a \s\+ b aSNTb SNT # Word boundaries (\b, \B, \<, \>, \`, \') # (is/not boundary, start/end word, start/end subject string) -\babc\b & abc +# Most of these are disabled for the moment, and will be re-enabled as +# we become feature complete. +#\babc\b & abc \ & abc -\Babc\B & abc -\B[abc]\B & b -\B[abc]+ - bc -\B[abc]\+ b bc -\`abc\' & abc abc -\`.+\' - abNc abNc -\`.\+\' b abNc abNc -(\`a) - Na -(a\') - aN +#\Babc\B & abc +#\B[abc]\B & b +#\B[abc]+ - bc +#\B[abc]\+ b bc +#\`abc\' & abc abc +#\`.+\' - abNc abNc +#\`.\+\' b abNc abNc +#(\`a) - Na +#(a\') - aN Modified: head/lib/libregex/tests/libregex_test.sh ============================================================================== --- head/lib/libregex/tests/libregex_test.sh Tue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/libregex_test.sh Tue Aug 4 02:16:43 2020 (r363819) @@ -30,10 +30,6 @@ check() { local dataname="${1}"; shift - if [ "${dataname}" == "gnuext" ]; then - atf_expect_fail "GNU extensions are not currently implemented" - fi - prog="$(atf_get_srcdir)/h_regex" data="$(atf_get_srcdir)/data/${dataname}.in" From owner-svn-src-head@freebsd.org Tue Aug 4 02: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 784463AE18A; Tue, 4 Aug 2020 02:18:25 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJMP2fBdz3Rv2; Tue, 4 Aug 2020 02:18:25 +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 3E02B1DE5E; Tue, 4 Aug 2020 02:18:25 +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 0742IPbf056300; Tue, 4 Aug 2020 02:18:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742IOa6056297; Tue, 4 Aug 2020 02:18:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040218.0742IOa6056297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363820 - in head: lib/googletest/gtest share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/googletest/gtest share/mk X-SVN-Commit-Revision: 363820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:18:25 -0000 Author: kevans Date: Tue Aug 4 02:18:24 2020 New Revision: 363820 URL: https://svnweb.freebsd.org/changeset/base/363820 Log: gtest: link against libregex for GNU extensions gtest tests want to use \w ([[:alnum:]]) at the very least, which was causing them to fail after r363679. Start linking against libregex so that this shorthand is implemented. PR: 248452 Modified: head/lib/googletest/gtest/Makefile head/share/mk/src.libnames.mk Modified: head/lib/googletest/gtest/Makefile ============================================================================== --- head/lib/googletest/gtest/Makefile Tue Aug 4 02:16:43 2020 (r363819) +++ head/lib/googletest/gtest/Makefile Tue Aug 4 02:18:24 2020 (r363820) @@ -45,7 +45,7 @@ INTERNAL_CUSTOM_INCS+= gtest/internal/custom/gtest.h SRCS+= gtest-all.cc -LIBADD+= pthread +LIBADD+= pthread regex HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Aug 4 02:16:43 2020 (r363819) +++ head/share/mk/src.libnames.mk Tue Aug 4 02:18:24 2020 (r363820) @@ -320,7 +320,7 @@ _DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c -_DP_gtest= pthread +_DP_gtest= pthread regex _DP_gmock= gtest _DP_gmock_main= gmock _DP_gtest_main= gtest From owner-svn-src-head@freebsd.org Tue Aug 4 02:20: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 576533AE061; Tue, 4 Aug 2020 02:20:16 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJPX1fk9z3Rqc; Tue, 4 Aug 2020 02:20:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DB5F1E249; Tue, 4 Aug 2020 02:20:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0742KFNR056486; Tue, 4 Aug 2020 02:20:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742KFjf056485; Tue, 4 Aug 2020 02:20:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040220.0742KFjf056485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363821 - head/contrib/googletest/googletest/test X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/googletest/googletest/test X-SVN-Commit-Revision: 363821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:20:16 -0000 Author: kevans Date: Tue Aug 4 02:20:15 2020 New Revision: 363821 URL: https://svnweb.freebsd.org/changeset/base/363821 Log: Re-enable disabled googletest-port-test tests after r363820 gtest now links against libregex here, and the tests pass locally. PR: 248452 Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:18:24 2020 (r363820) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:20:15 2020 (r363821) @@ -403,8 +403,6 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -415,7 +413,6 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -864,8 +861,6 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -873,7 +868,6 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { From owner-svn-src-head@freebsd.org Tue Aug 4 02:47: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 5DABD3AEF09; Tue, 4 Aug 2020 02:47:25 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLK0s1pV8z3T4B; Tue, 4 Aug 2020 02:47:25 +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 222111E8B5; Tue, 4 Aug 2020 02:47:25 +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 0742lPT2074679; Tue, 4 Aug 2020 02:47:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742lO9a074677; Tue, 4 Aug 2020 02:47:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040247.0742lO9a074677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363823 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 363823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:47:25 -0000 Author: kevans Date: Tue Aug 4 02:47:24 2020 New Revision: 363823 URL: https://svnweb.freebsd.org/changeset/base/363823 Log: bsdgrep: switch to libregex for GNU_GREP_COMPAT libregex is incomplete, but it's a bit less buggy than the in-base libgnuregex and mostly OK. While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies that we're compatible with the GNU counterpart, not that we're including GNU anything. Modified: head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue Aug 4 02:31:52 2020 (r363822) +++ head/usr.bin/grep/Makefile Tue Aug 4 02:47:24 2020 (r363823) @@ -61,8 +61,8 @@ MLINKS+= grep.1 egrep.1 \ .endif .if ${MK_GNU_GREP_COMPAT} != "no" -CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU -LIBADD+= gnuregex +CFLAGS+= -DWITH_GNU_COMPAT +LIBADD+= regex .endif HAS_TESTS= Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Tue Aug 4 02:31:52 2020 (r363822) +++ head/usr.bin/grep/grep.c Tue Aug 4 02:47:24 2020 (r363823) @@ -555,7 +555,7 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': -#ifdef WITH_GNU +#ifdef WITH_GNU_COMPAT printf(errstr[9], getprogname(), VERSION); #else printf(errstr[8], getprogname(), VERSION); From owner-svn-src-head@freebsd.org Tue Aug 4 02:56: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 B0DFB3AF113 for ; Tue, 4 Aug 2020 02:56:18 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) (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 4BLKC42VJ9z3Tr2 for ; Tue, 4 Aug 2020 02:56:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: S3QU5sYVM1lpzJWX9QMPDnOCIwb6h6lPKUOVR0SBR56GnMxdXxTolFTAOAE3mqW fyBjN30TKEWbi_5J7jyZc7XD81wtBYlFp6MqNzGwH903RiWhU._Zh4wo3ByEgxNZo4V8y9DvPd3N hdicZw8vhWGSOnW03dt5oSL.hFPuHknEG7jdOrNauxyMhboHoo64sSeSaFDo30QKFb5njRcplxod .Zf5UZxa9GUpigP9rnkJOpJzd94yveCyNTv3YlT2e9YE7pidDmHgtlVbPSZ5e8IoWUekCkIOQNrS ctlh11s_mOZgJqwpUY_rVtgxQ62gXcRfRZOfsaTRVa..Pv.3etxBZ9_0oa3YwzAEDHmNiz2bALXc FRptH3wxg.Rr3WNewolHzi1ZAjoU8xE9_RFgI_6b821aB20Rne4s8jfc4aOK4aCo1IZcz_vHtsT5 OwWSx_coND1G_V9C38VA1rR9AwD114uhjX9c9rp9.4TROeSatBjF0VlT8HoIvxXcbbxIXEgl4u6q 59s8h4GEQ3LN15XqvnWQNbpN7vYgbyRxto4f930Ann5Sk4qq_SNCvLwwpeZNsFnQVA77Er77ws.V A6Ym1wRgE_V2j04mActJfSxqtKeEe_Ir_7rN9hxp1u4I97hsCr8pzPyCtGa1kn.FbMrnOu4qiS4_ jojDaTdS_6IOsMXjcWhsNEvk9bIBxXhmDfGBqQ3ZAJUuAeFISCdhXbIVe2MQjYB5u4dIEnkcW1tl 26VU7wNFp_ZnwsXOotPzR5HvZHqdt9vq0GvD.l1YGItaGxt5ilF4S_5mqDiYs9PEiw4YiAIfo..A vJgpLuPe4a9gFIf3Jd8o.E_Nu05yAyAvsmNiGD8qNoQg7PTaUo8rR44Be7A6bZc7XlnG9yrf_z_. 05jylu__dtzO3S2vu6Y0KfjAQ8Nbwnqx.6mGPyOVoHPPtKyejfQ0LEMlIC1AT3ZAgQ0XzkIattC4 q9qViItyR667RSLpIcdAOCyprfH6S4MO22AWacw2Z_9umf5ypo.IK4DqpBLahVfFnAU4azZv3wbw Eae0sOkt8DdsJWvaREHUIbeYtjxy68Z7IUeq.kPrUoQBpndRXPYkgvRqp9BwJzYLflQEsVeTbZRm _HOi1wYdpekEHW9lxERucvlEMbA1ZEuNDRVUlTyIiKjF.6JH81MWDn6PDC672VWcoME4YoKlvp_Q Heiw67SdrtMLfmVqs0xHGKOAJ7GbEIzT5uDJyGH5dUjommc5FQrV1_sz3X6oSe0wc0PW8GIxDLBH h2sftBjKP21bh.btOsgFlpjAWACZhXTAdK.097Gf4KsBy32YXmflWQ0PwNY.kXvzhir98aIA8dHu jfNOXCo6b1u.xfNFceH2Xxr72lnSWTj0h3o9E_L0VRTKE3PHabNZUFRxT43s- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 4 Aug 2020 02:56:14 +0000 Received: by smtp423.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID af87e93122c0f99c3f2089eb0a0470ed; Tue, 04 Aug 2020 02:56:12 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: Introduce WITH(OUT)_LTO? (was: Re: svn commit: r362987 - in head: contrib/bc usr.bin/gh-bc) (LLVMgold.so and gnu's ld.gold) From: Mark Millard In-Reply-To: <8B43A4F4-E44D-40C0-8984-FD0FD43198FE@yahoo.com> Date: Mon, 3 Aug 2020 19:56:11 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Toolchain , freebsd-ppc Content-Transfer-Encoding: quoted-printable Message-Id: <72B5174F-124F-4259-BDF2-32E4E850A1F8@yahoo.com> References: <64523602-7EFC-4A97-90EA-C776BF2A0AF7.ref@yahoo.com> <64523602-7EFC-4A97-90EA-C776BF2A0AF7@yahoo.com> <8B43A4F4-E44D-40C0-8984-FD0FD43198FE@yahoo.com> To: =?utf-8?Q?Stefan_E=C3=9Fer?= X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BLKC42VJ9z3Tr2 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.61 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.08)[-1.084]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(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)[]; SUBJECT_HAS_QUESTION(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.028]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.206:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.206:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 02:56:18 -0000 On 2020-Jul-25, at 13:59, Mark Millard wrote: > On 2020-Jul-8, at 01:28, Stefan E=C3=9Fer wrote: >=20 >> Am 08.07.20 um 09:01 schrieb Mark Millard: >>> The following is more informational than anything as far >>> as I'm concerned. But there may be implications that I'm >>> unaware of. (I sometimes experiment with toolchain use >>> to see what the current status is for such use.) >>>=20 >>> I attempted to build a system for 32-bit powerpc using clang >>> and binutils, building head -r363000 ( from -r363000 ). (This >>> was a cross build, amd64 -> powerpc.) It got a new type of >>> failure, compared to my past experience: >>=20 >> Hi Mark, >>=20 >> thank you for the report. I have tested with "make universe" (with >> default settings) that this version builds on all architectures, >> but Ed Maste has already disabled -flto for powerpc64, due to run >> time issues (floating point exception, IIRC). >>=20 >> I know that you are actively working on PowerPC and I'd appreciate, >> if you could provide me with information on which parameters cause >> breakage and which work for you. The combination of CLANG with LTO >> and GNU binutils cannot work - CLANG and GCC use incompatible file >> formats to represent the intermediate object files. >=20 > Hmm. It looks a little more complicated than that . . . >=20 > Looks like the devel/llvm80 devel/llvm90 and devel/llvm10 > options for powerpc64 include one for: >=20 > GOLD=3Don: Build the LLVM Gold plugin for LTO >=20 > That produces a plugin (LLVMgold.so) for use with gnu's > ld.gold ( from devel/binutils ). >=20 > . . . Ignore those notes. It looks like I greatly misinterpreted. For example doing some personal software builds with -flto in use resulted in (using devel/llvm11 as an example context): (powerpc64 context used) "/usr/local/llvm11/bin/ld" . . . -plugin = /usr/local/llvm11/bin/../lib/LLVMgold.so -plugin-opt=3Dmcpu=3Dppc64 = -plugin-opt=3DO3 . . . LLVMgold.so is for the llvm linker to use. I had built llvm10 with the gold option selected and there is: # ls -ldT /usr/local/llvm11/bin/../lib/LLVMgold.so -rwxr-xr-x 1 root wheel 94160 Jul 29 14:50:07 2020 = /usr/local/llvm11/bin/../lib/LLVMgold.so But, for the system clang 10 with -flto involved: "/usr/bin/ld" . . . -plugin /usr/bin/../lib/LLVMgold.so = -plugin-opt=3Dmcpu=3Dppc64 -plugin-opt=3DO3 . . . (yet there is no /usr/bin/../lib/LLVMgold.so present). And for even the likes of just: static volatile char big_area[67001] =3D "This is a test"; int main () { big_area[67000] =3D '9'; } commands like ( system clang and devel/llvm10 ): cc -flto main.c clang10 -flto main.c for powerpc64 produce invalid a.out files that do not even contain a main function when looked at with the likes of objdump -d --prefix-addresses and produce an a.out that does: # ./a.out Segmentation fault (core dumped) Or when run inside gdb such builds produce things like: Starting program: /root/c_tests/a.out=20 Program received signal SIGSEGV, Segmentation fault. (gdb) bt #0 0x00000000100412e8 in main () #1 0x0000000010010718 in _start (argc=3D, = argv=3D0xfffffbfffebb8, env=3D, obj=3D, = cleanup=3D, ps_strings=3D) at /usr/src/lib/csu/powerpc64/crt1_c.c:127 (gdb) disass Dump of assembler code for function main: =3D> 0x00000000100412e8 <+0>: .long 0x0 0x00000000100412ec <+4>: mullhwu r0,r1,r1 0x00000000100412f0 <+8>: .long 0x0 0x00000000100412f4 <+12>: vmsumshm v0,v2,v17,v19 0x00000000100412f8 <+16>: .long 0x0 0x00000000100412fc <+20>: .long 0x0 0x0000000010041300 <+0>: .long 0xfffff 0x0000000010041304 <+4>: stmw r31,-4128(r31) 0x0000000010041308 <+0>: .long 0xfffff 0x000000001004130c <+4>: stmw r31,-5176(r31) 0x0000000010041310 <+0>: .long 0x0 End of assembler dump. For reference: # uname -apKU FreeBSD FBSDG5L2 13.0-CURRENT FreeBSD 13.0-CURRENT #13 r363590M: Sun Jul = 26 20:14:08 PDT 2020 = root@FBSDFHUGE:/usr/obj/powerpc64vtsc_clang/powerpc.powerpc64/usr/src/powe= rpc.powerpc64/sys/GENERIC64vtsc-NODBG powerpc powerpc64 1300102 1300102 # svnlite info /usr/ports/ Path: /usr/ports Working Copy Root Path: /usr/ports URL: svn://svn.freebsd.org/ports/head Relative URL: ^/head Repository Root: svn://svn.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 543890 Node Kind: directory Schedule: normal Last Changed Author: gerald Last Changed Rev: 543890 Last Changed Date: 2020-07-31 22:52:17 -0700 (Fri, 31 Jul 2020) =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 Aug 4 03:43: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 470583AFEEA; Tue, 4 Aug 2020 03:43:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLLFY1BDkz3XXR; Tue, 4 Aug 2020 03:43:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BB361EFC3; Tue, 4 Aug 2020 03:43:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0743hSxh013230; Tue, 4 Aug 2020 03:43:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0743hSX3013228; Tue, 4 Aug 2020 03:43:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040343.0743hSX3013228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 03:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363824 - in head: . lib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . lib X-SVN-Commit-Revision: 363824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 03:43:29 -0000 Author: kevans Date: Tue Aug 4 03:43:28 2020 New Revision: 363824 URL: https://svnweb.freebsd.org/changeset/base/363824 Log: Ensure libregex is built in time for googletest In lib/Makefile, we document the dependency with SUBDIR_DEPEND For buildworld orchestration, just prebuild libregex if GOOGLETEST is enabled. googletest will get built in a later pass. Modified: head/Makefile.inc1 head/lib/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 4 02:47:24 2020 (r363823) +++ head/Makefile.inc1 Tue Aug 4 03:43:28 2020 (r363824) @@ -2741,6 +2741,10 @@ _prebuild_libs+= gnu/lib/libdialog gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .endif +.if ${MK_GOOGLETEST} != "no" +_prebuild_libs+= lib/libregex +.endif + .if ${MK_LIBCPLUSPLUS} != "no" _prebuild_libs+= lib/libc++ .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Aug 4 02:47:24 2020 (r363823) +++ head/lib/Makefile Tue Aug 4 03:43:28 2020 (r363824) @@ -107,6 +107,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_geom= libufs +SUBDIR_DEPEND_googletest= libregex SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} From owner-svn-src-head@freebsd.org Tue Aug 4 08:46: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 5CBFA3B53C3; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLSz91qKRz44Hr; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 093A122D8B; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0748kS4n096912; Tue, 4 Aug 2020 08:46:28 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0748kS7e096911; Tue, 4 Aug 2020 08:46:28 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008040846.0748kS7e096911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 4 Aug 2020 08:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363829 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 363829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 08:46:29 -0000 Author: gbe (doc committer) Date: Tue Aug 4 08:46:28 2020 New Revision: 363829 URL: https://svnweb.freebsd.org/changeset/base/363829 Log: directory(3): Add an ERRORS section - Add an ERRORS section for opendir(3) and closedir(3) - Document also the errors of readdir(3), readdir_r(3) and telldir(3) - Convert the code sample into an EXAMPLES section PR: 75711 Submitted by: abc Reviewed by: 0mp, bcr, jilles Approved by: 0mp, bcr, jilles Obtained from: partial from OpenBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25892 Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Tue Aug 4 06:39:49 2020 (r363828) +++ head/lib/libc/gen/directory.3 Tue Aug 4 08:46:28 2020 (r363829) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 30, 2019 +.Dd August 1, 2020 .Dt DIRECTORY 3 .Os .Sh NAME @@ -242,7 +242,7 @@ returns the integer file descriptor associated with th .Em directory stream , see .Xr open 2 . -.Pp +.Sh EXAMPLES Sample code which searches a directory for entry ``name'' is: .Bd -literal -offset indent dirp = opendir("."); @@ -258,6 +258,76 @@ while ((dp = readdir(dirp)) != NULL) { (void)closedir(dirp); return (NOT_FOUND); .Ed +.Sh ERRORS +The +.Fn opendir +function will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for the component of the path prefix of +.Fa filename +or read permission is denied for +.Fa filename . +.It Bq Er ELOOP +A loop exists in symbolic links encountered during resolution of the +.Fa filename +argument. +.It Bq Er ENAMETOOLONG +The length of the +.Fa filename +argument exceeds +.Brq Dv PATH_MAX +or +a pathname component is longer than +.Brq Dv NAME_MAX . +.It Bq Er ENOENT +A component of +.Fa filename +does not name an existing directory or +.Fa filename +is an empty string. +.It Bq Er ENOTDIR +A component of +.Fa filename +is not a directory. +.El +.Pp +The +.Fn fdopendir +function will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid file descriptor open for reading. +.It Bq Er ENOTDIR +The descriptor +.Fa fd +is not associated with a directory. +.El +.Pp +The +.Fn readdir +and +.Fn readdir_r +functions may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr getdents 2 . +.Pp +The +.Fn telldir +function may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr realloc 3 . +.Pp +The +.Fn closedir +function may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr close 2 . .Sh SEE ALSO .Xr close 2 , .Xr lseek 2 , From owner-svn-src-head@freebsd.org Tue Aug 4 11:13: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 C8FA237040F; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLXDT4zDQz4DQB; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5312489C; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074BDD9S089884; Tue, 4 Aug 2020 11:13:13 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074BDDMT089883; Tue, 4 Aug 2020 11:13:13 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008041113.074BDDMT089883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 4 Aug 2020 11:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363830 - head/usr.sbin/iovctl X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/iovctl X-SVN-Commit-Revision: 363830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 11:13:13 -0000 Author: gbe (doc committer) Date: Tue Aug 4 11:13:13 2020 New Revision: 363830 URL: https://svnweb.freebsd.org/changeset/base/363830 Log: iovctl.conf(5): Use Lk macro for the URL of the UCL website PR: 248334 Reported by: chuck at tuffli dot net Reviewed by: bcr, 0mp Approved by: bcr, 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25891 Modified: head/usr.sbin/iovctl/iovctl.conf.5 Modified: head/usr.sbin/iovctl/iovctl.conf.5 ============================================================================== --- head/usr.sbin/iovctl/iovctl.conf.5 Tue Aug 4 08:46:28 2020 (r363829) +++ head/usr.sbin/iovctl/iovctl.conf.5 Tue Aug 4 11:13:13 2020 (r363830) @@ -51,7 +51,7 @@ The .Nm file uses UCL format. UCL syntax is documented at the official UCL website: -http://github.com/vstakhov/libucl. +.Lk http://github.com/vstakhov/libucl . .Pp There are three types of sections in the .Nm From owner-svn-src-head@freebsd.org Tue Aug 4 13:58: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 B5D7A37467C; Tue, 4 Aug 2020 13:58:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLbvN4kWyz4N2h; Tue, 4 Aug 2020 13:58:40 +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 857AF26685; Tue, 4 Aug 2020 13:58:40 +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 074DweAJ088348; Tue, 4 Aug 2020 13:58:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074DwbEv088331; Tue, 4 Aug 2020 13:58:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041358.074DwbEv088331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 13:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363834 - in head: . share/man/man9 sys/dev/hwpmc sys/dev/ioat sys/dev/iommu sys/dev/nvme sys/kern sys/net sys/sys sys/vm sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . share/man/man9 sys/dev/hwpmc sys/dev/ioat sys/dev/iommu sys/dev/nvme sys/kern sys/net sys/sys sys/vm sys/x86/x86 X-SVN-Commit-Revision: 363834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 13:58:40 -0000 Author: markj Date: Tue Aug 4 13:58:36 2020 New Revision: 363834 URL: https://svnweb.freebsd.org/changeset/base/363834 Log: Remove free_domain() and uma_zfree_domain(). These functions were introduced before UMA started ensuring that freed memory gets placed in domain-local caches. They no longer serve any purpose since UMA now provides their functionality by default. Remove them to simplyify the kernel memory allocator interfaces a bit. Reviewed by: cem, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25937 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/malloc.9 head/share/man/man9/zone.9 head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/ioat/ioat.c head/sys/dev/iommu/busdma_iommu.c head/sys/dev/nvme/nvme_qpair.c head/sys/kern/kern_malloc.c head/sys/kern/subr_bus.c head/sys/net/if.c head/sys/sys/malloc.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/x86/x86/busdma_bounce.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Aug 4 12:44:47 2020 (r363833) +++ head/ObsoleteFiles.inc Tue Aug 4 13:58:36 2020 (r363834) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200803: remove free_domain(9) and uma_zfree_domain(9) +OLD_FILES+=usr/share/man/man9/free_domain.9.gz +OLD_FILES+=usr/share/man/man9/uma_zfree_domain.9.gz + # 20200729: remove long expired serial drivers OLD_FILES+=usr/share/man/man4/cy.4.gz OLD_FILES+=usr/share/man/man4/rc.4.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/Makefile Tue Aug 4 13:58:36 2020 (r363834) @@ -1378,7 +1378,6 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ malloc.9 malloc_domainset.9 \ - malloc.9 free_domain.9 \ malloc.9 mallocarray.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ @@ -2343,7 +2342,6 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zdestroy.9 \ zone.9 uma_zfree.9 \ zone.9 uma_zfree_arg.9 \ - zone.9 uma_zfree_domain.9 \ zone.9 uma_zfree_pcpu.9 \ zone.9 uma_zfree_pcpu_arg.9 \ zone.9 uma_zone_get_cur.9 \ Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/malloc.9 Tue Aug 4 13:58:36 2020 (r363834) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd August 3, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -64,8 +64,6 @@ .In sys/domainset.h .Ft void * .Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" -.Ft void -.Fn free_domain "void *addr" "struct malloc_type *type" .Sh DESCRIPTION The .Fn malloc @@ -81,8 +79,6 @@ domain using the specified domain selection policy. See .Xr domainset 9 for some example policies. -Memory allocated with this function should be returned with -.Fn free_domain . .Pp The .Fn mallocarray Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/zone.9 Tue Aug 4 13:58:36 2020 (r363834) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2020 +.Dd August 3, 2020 .Dt UMA 9 .Os .Sh NAME @@ -86,8 +86,6 @@ typedef void (*uma_free)(void *item, vm_size_t size, u .Ft void .Fn uma_zfree_arg "uma_zone_t zone" "void *item" "void *arg" .Ft void -.Fn uma_zfree_domain "uma_zone_t zone" "void *item" "void *arg" -.Ft void .Fn uma_zfree_pcpu "uma_zone_t zone" "void *item" .Ft void .Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" @@ -394,11 +392,6 @@ function allows callers to specify a fixed domain to allocate from. This uses a guaranteed but slow path in the allocator which reduces concurrency. -The -.Fn uma_zfree_domain -function should be used to return memory allocated in this fashion. -This function infers the domain from the pointer and does not require it as an -argument. .Pp The .Fn uma_zone_prealloc Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 13:58:36 2020 (r363834) @@ -5893,13 +5893,13 @@ pmc_cleanup(void) KASSERT(pmc_pcpu[cpu]->pc_sb[PMC_UR] != NULL, ("[pmc,%d] Null userret cpu sample buffer cpu=%d", __LINE__, cpu)); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR], M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR], M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR], M_PMC); - free_domain(pmc_pcpu[cpu], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_HR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_HR], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_SR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_SR], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_UR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_UR], M_PMC); + free(pmc_pcpu[cpu], M_PMC); } free(pmc_pcpu, M_PMC); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/ioat/ioat.c Tue Aug 4 13:58:36 2020 (r363834) @@ -1578,7 +1578,7 @@ ioat_free_ring(struct ioat_softc *ioat, uint32_t size, struct ioat_descriptor *ring) { - free_domain(ring, M_IOAT); + free(ring, M_IOAT); } static struct ioat_descriptor * Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/iommu/busdma_iommu.c Tue Aug 4 13:58:36 2020 (r363834) @@ -410,7 +410,7 @@ iommu_bus_dma_tag_destroy(bus_dma_tag_t dmat1) 1) { if (dmat == dmat->ctx->tag) iommu_free_ctx(dmat->ctx); - free_domain(dmat->segments, M_IOMMU_DMAMAP); + free(dmat->segments, M_IOMMU_DMAMAP); free(dmat, M_DEVBUF); dmat = parent; } else @@ -447,7 +447,7 @@ iommu_bus_dmamap_create(bus_dma_tag_t dmat, int flags, tag->common.nsegments, M_IOMMU_DMAMAP, DOMAINSET_PREF(tag->common.domain), M_NOWAIT); if (tag->segments == NULL) { - free_domain(map, M_IOMMU_DMAMAP); + free(map, M_IOMMU_DMAMAP); *mapp = NULL; return (ENOMEM); } @@ -479,7 +479,7 @@ iommu_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmama return (EBUSY); } IOMMU_DOMAIN_UNLOCK(domain); - free_domain(map, M_IOMMU_DMAMAP); + free(map, M_IOMMU_DMAMAP); } tag->map_count--; return (0); @@ -537,7 +537,7 @@ iommu_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, map = (struct bus_dmamap_iommu *)map1; if ((map->flags & BUS_DMAMAP_IOMMU_MALLOC) != 0) { - free_domain(vaddr, M_DEVBUF); + free(vaddr, M_DEVBUF); map->flags &= ~BUS_DMAMAP_IOMMU_MALLOC; } else { KASSERT((map->flags & BUS_DMAMAP_IOMMU_KMEM_ALLOC) != 0, Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/nvme/nvme_qpair.c Tue Aug 4 13:58:36 2020 (r363834) @@ -819,7 +819,7 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) } if (qpair->act_tr) { - free_domain(qpair->act_tr, M_NVME); + free(qpair->act_tr, M_NVME); qpair->act_tr = NULL; } @@ -828,7 +828,7 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) TAILQ_REMOVE(&qpair->free_tr, tr, tailq); bus_dmamap_destroy(qpair->dma_tag_payload, tr->payload_dma_map); - free_domain(tr, M_NVME); + free(tr, M_NVME); } if (qpair->cmd != NULL) { Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/kern/kern_malloc.c Tue Aug 4 13:58:36 2020 (r363834) @@ -862,40 +862,6 @@ zfree(void *addr, struct malloc_type *mtp) malloc_type_freed(mtp, size); } -void -free_domain(void *addr, struct malloc_type *mtp) -{ - uma_zone_t zone; - uma_slab_t slab; - u_long size; - -#ifdef MALLOC_DEBUG - if (free_dbg(&addr, mtp) != 0) - return; -#endif - - /* free(NULL, ...) does nothing */ - if (addr == NULL) - return; - - vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); - if (slab == NULL) - panic("free_domain: address %p(%p) has not been allocated.\n", - addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - - if (__predict_true(!malloc_large_slab(slab))) { - size = zone->uz_size; -#ifdef INVARIANTS - free_save_type(addr, mtp, size); -#endif - uma_zfree_domain(zone, addr, slab); - } else { - size = malloc_large_size(slab); - free_large(addr, size); - } - malloc_type_freed(mtp, size); -} - /* * realloc: change the size of a memory block */ Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/kern/subr_bus.c Tue Aug 4 13:58:36 2020 (r363834) @@ -2542,7 +2542,7 @@ void device_set_softc(device_t dev, void *softc) { if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) - free_domain(dev->softc, M_BUS_SC); + free(dev->softc, M_BUS_SC); dev->softc = softc; if (dev->softc) dev->flags |= DF_EXTERNALSOFTC; @@ -2559,7 +2559,7 @@ device_set_softc(device_t dev, void *softc) void device_free_softc(void *softc) { - free_domain(softc, M_BUS_SC); + free(softc, M_BUS_SC); } /** @@ -2826,7 +2826,7 @@ device_set_driver(device_t dev, driver_t *driver) return (0); if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) { - free_domain(dev->softc, M_BUS_SC); + free(dev->softc, M_BUS_SC); dev->softc = NULL; } device_set_desc(dev, NULL); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/net/if.c Tue Aug 4 13:58:36 2020 (r363834) @@ -629,10 +629,7 @@ if_free_internal(struct ifnet *ifp) free(ifp->if_description, M_IFDESCR); free(ifp->if_hw_addr, M_IFADDR); - if (ifp->if_numa_domain == IF_NODOM) - free(ifp, M_IFNET); - else - free_domain(ifp, M_IFNET); + free(ifp, M_IFNET); } static void Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/sys/malloc.h Tue Aug 4 13:58:36 2020 (r363834) @@ -180,7 +180,6 @@ void *contigmalloc_domainset(unsigned long size, struc __malloc_like __result_use_check __alloc_size(1) __alloc_align(7); void free(void *addr, struct malloc_type *type); void zfree(void *addr, struct malloc_type *type); -void free_domain(void *addr, struct malloc_type *type); void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1); /* Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/vm/uma.h Tue Aug 4 13:58:36 2020 (r363834) @@ -387,16 +387,6 @@ void uma_zfree_pcpu_arg(uma_zone_t zone, void *item, v void uma_zfree_smr(uma_zone_t zone, void *item); /* - * Frees an item back to the specified zone's domain specific pool. - * - * Arguments: - * zone The zone the item was originally allocated out of. - * item The memory to be freed. - * arg Argument passed to the destructor - */ -void uma_zfree_domain(uma_zone_t zone, void *item, void *arg); - -/* * Frees an item back to a zone without supplying an argument * * This is just a wrapper for uma_zfree_arg for convenience. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/vm/uma_core.c Tue Aug 4 13:58:36 2020 (r363834) @@ -4338,24 +4338,6 @@ cache_free(uma_zone_t zone, uma_cache_t cache, void *u return (true); } -void -uma_zfree_domain(uma_zone_t zone, void *item, void *udata) -{ - - /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ - random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); - - CTR2(KTR_UMA, "uma_zfree_domain zone %s(%p)", zone->uz_name, zone); - - KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), - ("uma_zfree_domain: called with spinlock or critical section held")); - - /* uma_zfree(..., NULL) does nothing, to match free(9). */ - if (item == NULL) - return; - zone_free_item(zone, item, udata, SKIP_NONE); -} - static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item) { Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/x86/x86/busdma_bounce.c Tue Aug 4 13:58:36 2020 (r363834) @@ -271,7 +271,7 @@ bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) atomic_subtract_int(&dmat->common.ref_count, 1); if (dmat->common.ref_count == 0) { if (dmat->segments != NULL) - free_domain(dmat->segments, M_DEVBUF); + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -387,7 +387,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmam } if (dmat->bounce_zone) dmat->bounce_zone->map_count--; - free_domain(map, M_DEVBUF); + free(map, M_DEVBUF); } dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); @@ -504,7 +504,7 @@ bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) - free_domain(vaddr, M_DEVBUF); + free(vaddr, M_DEVBUF); else kmem_free((vm_offset_t)vaddr, dmat->common.maxsize); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, @@ -1188,7 +1188,7 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT, 0ul, bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { - free_domain(bpage, M_DEVBUF); + free(bpage, M_DEVBUF); break; } bpage->busaddr = pmap_kextract(bpage->vaddr); From owner-svn-src-head@freebsd.org Tue Aug 4 14:42: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 6BEE2375EF0; Tue, 4 Aug 2020 14:42:39 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLct72K6fz4QV6; Tue, 4 Aug 2020 14:42:39 +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 32DE726CFD; Tue, 4 Aug 2020 14:42:39 +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 074EgdjO018829; Tue, 4 Aug 2020 14:42:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EgdsH018828; Tue, 4 Aug 2020 14:42:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041442.074EgdsH018828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363835 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:42:39 -0000 Author: manu Date: Tue Aug 4 14:42:38 2020 New Revision: 363835 URL: https://svnweb.freebsd.org/changeset/base/363835 Log: linuxkpi: Add linux/sizes.h This file contain some defines for common sizes. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25941 Added: head/sys/compat/linuxkpi/common/include/linux/sizes.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/sizes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/sizes.h Tue Aug 4 14:42:38 2020 (r363835) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_SIZES_H__ +#define __LINUX_SIZES_H__ + +#define SZ_1K (1024 * 1) +#define SZ_4K (1024 * 4) +#define SZ_8K (1024 * 8) +#define SZ_16K (1024 * 16) +#define SZ_32K (1024 * 32) +#define SZ_64K (1024 * 64) +#define SZ_128K (1024 * 128) +#define SZ_256K (1024 * 256) +#define SZ_512K (1024 * 512) + +#define SZ_1M (1024 * 1024 * 1) +#define SZ_2M (1024 * 1024 * 2) +#define SZ_8M (1024 * 1024 * 8) +#define SZ_16M (1024 * 1024 * 16) +#define SZ_32M (1024 * 1024 * 32) +#define SZ_64M (1024 * 1024 * 64) + +#endif From owner-svn-src-head@freebsd.org Tue Aug 4 14:44: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 AC946375D7C; Tue, 4 Aug 2020 14:44:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLcw04BmNz4Qjr; Tue, 4 Aug 2020 14:44:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 736DC26EA6; Tue, 4 Aug 2020 14:44:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074EiGWW018964; Tue, 4 Aug 2020 14:44:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EiGKo018963; Tue, 4 Aug 2020 14:44:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041444.074EiGKo018963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363836 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:44:16 -0000 Author: manu Date: Tue Aug 4 14:44:16 2020 New Revision: 363836 URL: https://svnweb.freebsd.org/changeset/base/363836 Log: linuxkpi: Add kref_put_lock Same as kref_put but in addition to calling the rel function it will acquire the lock first. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D25942 Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Tue Aug 4 14:42:38 2020 (r363835) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Tue Aug 4 14:44:16 2020 (r363836) @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -76,6 +77,20 @@ kref_put(struct kref *kref, void (*rel)(struct kref *k } return 0; } + +static inline int +kref_put_lock(struct kref *kref, void (*rel)(struct kref *kref), + spinlock_t *lock) +{ + + if (refcount_release(&kref->refcount.counter)) { + spin_lock(lock); + rel(kref); + return (1); + } + return (0); +} + static inline int kref_sub(struct kref *kref, unsigned int count, From owner-svn-src-head@freebsd.org Tue Aug 4 14:45: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 EFA3B37627C; Tue, 4 Aug 2020 14:45:22 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLcxG63FBz4QsG; Tue, 4 Aug 2020 14:45:22 +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 B371C26BC7; Tue, 4 Aug 2020 14:45:22 +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 074EjM44019077; Tue, 4 Aug 2020 14:45:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EjMqE019076; Tue, 4 Aug 2020 14:45:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041445.074EjMqE019076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363837 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:45:23 -0000 Author: manu Date: Tue Aug 4 14:45:22 2020 New Revision: 363837 URL: https://svnweb.freebsd.org/changeset/base/363837 Log: linuxkpi: Add nested variant of mutex_lock_interruptible We don't do anything with the _nesteds variant so just call mutex_lock_interruptible Sponsoredby: The FreeBSD Foundation Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25944 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Tue Aug 4 14:44:16 2020 (r363836) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Tue Aug 4 14:45:22 2020 (r363837) @@ -67,6 +67,8 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +#define mutex_lock_interruptible_nested(m, c) mutex_lock_interruptible(m) + /* * Reuse the interruptable method since the SX * lock handles both signals and interrupts: From owner-svn-src-head@freebsd.org Tue Aug 4 14:48: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 AB9D4376508; Tue, 4 Aug 2020 14:48:46 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLd1B46MVz4R8m; Tue, 4 Aug 2020 14:48:46 +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 7136C2701E; Tue, 4 Aug 2020 14:48:46 +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 074EmkhP019267; Tue, 4 Aug 2020 14:48:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Emjlm019264; Tue, 4 Aug 2020 14:48:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041448.074Emjlm019264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363838 - in head/share/examples: ipfilter smbfs smbfs/print X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/share/examples: ipfilter smbfs smbfs/print X-SVN-Commit-Revision: 363838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:48:46 -0000 Author: manu Date: Tue Aug 4 14:48:45 2020 New Revision: 363838 URL: https://svnweb.freebsd.org/changeset/base/363838 Log: pkgbase: Remove the last users of the FreeBSD-example package Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D24176 Modified: head/share/examples/ipfilter/Makefile head/share/examples/smbfs/Makefile head/share/examples/smbfs/print/Makefile Modified: head/share/examples/ipfilter/Makefile ============================================================================== --- head/share/examples/ipfilter/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/ipfilter/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=ipf FILES= README # dist sample files Modified: head/share/examples/smbfs/Makefile ============================================================================== --- head/share/examples/smbfs/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/smbfs/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=utilities FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc Modified: head/share/examples/smbfs/print/Makefile ============================================================================== --- head/share/examples/smbfs/print/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/smbfs/print/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=utilities FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj From owner-svn-src-head@freebsd.org Tue Aug 4 14:53: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 1D2803762E2; Tue, 4 Aug 2020 14:53:42 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLd6s71mQz4RR2; Tue, 4 Aug 2020 14:53:41 +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 D43A72723F; Tue, 4 Aug 2020 14:53:41 +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 074Erfrg025054; Tue, 4 Aug 2020 14:53:41 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Erfwx025053; Tue, 4 Aug 2020 14:53:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041453.074Erfwx025053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363839 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:53:42 -0000 Author: manu Date: Tue Aug 4 14:53:41 2020 New Revision: 363839 URL: https://svnweb.freebsd.org/changeset/base/363839 Log: Re-apply r363564. We now have linux/sizes.h in the tree. Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Tue Aug 4 14:48:45 2020 (r363838) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Tue Aug 4 14:53:41 2020 (r363839) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Tue Aug 4 14: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 C21A1376736; Tue, 4 Aug 2020 14:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdFr4jVXz4SKT; Tue, 4 Aug 2020 14:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85DF427047; Tue, 4 Aug 2020 14:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074ExigZ025388; Tue, 4 Aug 2020 14:59:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074ExhOY025384; Tue, 4 Aug 2020 14:59:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041459.074ExhOY025384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 14:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363840 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 14:59:44 -0000 Author: markj Date: Tue Aug 4 14:59:43 2020 New Revision: 363840 URL: https://svnweb.freebsd.org/changeset/base/363840 Log: Remove most lingering references to the page lock in comments. Finish updating comments to reflect new locking protocols introduced over the past year. In particular, vm_page_lock is now effectively unused. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25868 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_page.c Tue Aug 4 14:59:43 2020 (r363840) @@ -2675,7 +2675,7 @@ retry: * ascending order.) (2) It is not reserved, and it is * transitioning from free to allocated. (Conversely, * the transition from allocated to free for managed - * pages is blocked by the page lock.) (3) It is + * pages is blocked by the page busy lock.) (3) It is * allocated but not contained by an object and not * wired, e.g., allocated by Xen's balloon driver. */ @@ -3622,8 +3622,6 @@ vm_page_pqbatch_drain(void) * Request removal of the given page from its current page * queue. Physical removal from the queue may be deferred * indefinitely. - * - * The page must be locked. */ void vm_page_dequeue_deferred(vm_page_t m) @@ -3804,8 +3802,8 @@ vm_page_free_prep(vm_page_t m) * Returns the given page to the free list, disassociating it * from any VM object. * - * The object must be locked. The page must be locked if it is - * managed. + * The object must be locked. The page must be exclusively busied if it + * belongs to an object. */ static void vm_page_free_toq(vm_page_t m) @@ -3834,9 +3832,6 @@ vm_page_free_toq(vm_page_t m) * Returns a list of pages to the free list, disassociating it * from any VM object. In other words, this is equivalent to * calling vm_page_free_toq() for each page of a list of VM objects. - * - * The objects must be locked. The pages must be locked if it is - * managed. */ void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) @@ -3974,8 +3969,6 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bo * of wirings transitions to zero and the page is eligible for page out, then * the page is added to the specified paging queue. If the released wiring * represented the last reference to the page, the page is freed. - * - * A managed page must be locked. */ void vm_page_unwire(vm_page_t m, uint8_t nqueue) @@ -4022,8 +4015,6 @@ vm_page_unwire_noq(vm_page_t m) * Ensure that the page ends up in the specified page queue. If the page is * active or being moved to the active queue, ensure that its act_count is * at least ACT_INIT but do not otherwise mess with it. - * - * A managed page must be locked. */ static __always_inline void vm_page_mvqueue(vm_page_t m, const uint8_t nqueue, const uint16_t nflag) @@ -4269,14 +4260,14 @@ vm_page_try_remove_write(vm_page_t m) * vm_page_advise * * Apply the specified advice to the given page. - * - * The object and page must be locked. */ void vm_page_advise(vm_page_t m, int advice) { VM_OBJECT_ASSERT_WLOCKED(m->object); + vm_page_assert_xbusied(m); + if (advice == MADV_FREE) /* * Mark the page clean. This will allow the page to be freed Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_page.h Tue Aug 4 14:59:43 2020 (r363840) @@ -95,19 +95,17 @@ * synchronized using either one of or a combination of locks. If a * field is annotated with two of these locks then holding either is * sufficient for read access but both are required for write access. - * The physical address of a page is used to select its page lock from - * a pool. The queue lock for a page depends on the value of its queue - * field and is described in detail below. + * The queue lock for a page depends on the value of its queue field and is + * described in detail below. * * The following annotations are possible: * (A) the field must be accessed using atomic(9) and may require * additional synchronization. * (B) the page busy lock. * (C) the field is immutable. - * (F) the per-domain lock for the free queues + * (F) the per-domain lock for the free queues. * (M) Machine dependent, defined by pmap layer. * (O) the object that the page belongs to. - * (P) the page lock. * (Q) the page's queue lock. * * The busy lock is an embedded reader-writer lock that protects the @@ -270,7 +268,7 @@ struct vm_page { * cleared only when the corresponding object's write lock is held. * * VPRC_BLOCKED is used to atomically block wirings via pmap lookups while - * attempting to tear down all mappings of a given page. The page lock and + * attempting to tear down all mappings of a given page. The page busy lock and * object write lock must both be held in order to set or clear this bit. */ #define VPRC_BLOCKED 0x40000000u /* mappings are being removed */ @@ -411,27 +409,26 @@ extern struct mtx_padalign pa_lock[]; * * PGA_ENQUEUED is set and cleared when a page is inserted into or removed * from a page queue, respectively. It determines whether the plinks.q field - * of the page is valid. To set or clear this flag, the queue lock for the - * page must be held: the page queue lock corresponding to the page's "queue" - * field if its value is not PQ_NONE, and the page lock otherwise. + * of the page is valid. To set or clear this flag, page's "queue" field must + * be a valid queue index, and the corresponding page queue lock must be held. * * PGA_DEQUEUE is set when the page is scheduled to be dequeued from a page * queue, and cleared when the dequeue request is processed. A page may * have PGA_DEQUEUE set and PGA_ENQUEUED cleared, for instance if a dequeue * is requested after the page is scheduled to be enqueued but before it is - * actually inserted into the page queue. For allocated pages, the page lock - * must be held to set this flag, but it may be set by vm_page_free_prep() - * without the page lock held. The page queue lock must be held to clear the - * PGA_DEQUEUE flag. + * actually inserted into the page queue. * * PGA_REQUEUE is set when the page is scheduled to be enqueued or requeued - * in its page queue. The page lock must be held to set this flag, and the - * queue lock for the page must be held to clear it. + * in its page queue. * * PGA_REQUEUE_HEAD is a special flag for enqueuing pages near the head of - * the inactive queue, thus bypassing LRU. The page lock must be held to - * set this flag, and the queue lock for the page must be held to clear it. + * the inactive queue, thus bypassing LRU. * + * The PGA_DEQUEUE, PGA_REQUEUE and PGA_REQUEUE_HEAD flags must be set using an + * atomic RMW operation to ensure that the "queue" field is a valid queue index, + * and the corresponding page queue lock must be held when clearing any of the + * flags. + * * PGA_SWAP_FREE is used to defer freeing swap space to the pageout daemon * when the context that dirties the page does not have the object write lock * held. @@ -451,8 +448,8 @@ extern struct mtx_padalign pa_lock[]; #define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_QUEUE_OP_MASK) /* - * Page flags. If changed at any other time than page allocation or - * freeing, the modification must be protected by the vm_page lock. + * Page flags. Updates to these flags are not synchronized, and thus they must + * be set during page allocation or free to avoid races. * * The PG_PCPU_CACHE flag is set at allocation time if the page was * allocated from a per-CPU cache. It is cleared the next time that the Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_pageout.c Tue Aug 4 14:59:43 2020 (r363840) @@ -257,10 +257,9 @@ vm_pageout_end_scan(struct scan_state *ss) * physically dequeued if the caller so requests. Otherwise, the returned * batch may contain marker pages, and it is up to the caller to handle them. * - * When processing the batch queue, vm_page_queue() must be used to - * determine whether the page has been logically dequeued by another thread. - * Once this check is performed, the page lock guarantees that the page will - * not be disassociated from the queue. + * When processing the batch queue, vm_pageout_defer() must be used to + * determine whether the page has been logically dequeued since the batch was + * collected. */ static __always_inline void vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vnode_pager.c Tue Aug 4 14:59:43 2020 (r363840) @@ -1307,7 +1307,7 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page * the last page is partially invalid. In this case the filesystem * may not properly clear the dirty bits for the entire page (which * could be VM_PAGE_BITS_ALL due to the page having been mmap()d). - * With the page locked we are free to fix-up the dirty bits here. + * With the page busied we are free to fix up the dirty bits here. * * We do not under any circumstances truncate the valid bits, as * this will screw up bogus page replacement. From owner-svn-src-head@freebsd.org Tue Aug 4 15:00: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 E332C376798; Tue, 4 Aug 2020 15:00: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdGB5m9cz4SLR; Tue, 4 Aug 2020 15:00: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 A90B926FF1; Tue, 4 Aug 2020 15:00: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 074F02sK025516; Tue, 4 Aug 2020 15:00:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074F02bM025515; Tue, 4 Aug 2020 15:00:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041500.074F02bM025515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 15:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363841 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 363841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 15:00:03 -0000 Author: markj Date: Tue Aug 4 15:00:02 2020 New Revision: 363841 URL: https://svnweb.freebsd.org/changeset/base/363841 Log: Remove an incorrect assertion from in6p_lookup_mcast_ifp(). The socket may be bound to an IPv4-mapped IPv6 address. However, the inp address is not relevant to the JOIN_GROUP or LEAVE_GROUP operations. While here remove an unnecessary check for inp == NULL. Reported by: syzbot+d01ab3d5e6c1516a393c@syzkaller.appspotmail.com Reviewed by: hselasky MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25888 Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Tue Aug 4 14:59:43 2020 (r363840) +++ head/sys/netinet6/in6_mcast.c Tue Aug 4 15:00:02 2020 (r363841) @@ -1817,31 +1817,27 @@ ip6_getmoptions(struct inpcb *inp, struct sockopt *sop * * This routine exists to support legacy IPv6 multicast applications. * - * If inp is non-NULL, use this socket's current FIB number for any - * required FIB lookup. Look up the group address in the unicast FIB, - * and use its ifp; usually, this points to the default next-hop. - * If the FIB lookup fails, return NULL. + * Use the socket's current FIB number for any required FIB lookup. Look up the + * group address in the unicast FIB, and use its ifp; usually, this points to + * the default next-hop. If the FIB lookup fails, return NULL. * * FUTURE: Support multiple forwarding tables for IPv6. * * Returns NULL if no ifp could be found. */ static struct ifnet * -in6p_lookup_mcast_ifp(const struct inpcb *inp, - const struct sockaddr_in6 *gsin6) +in6p_lookup_mcast_ifp(const struct inpcb *inp, const struct sockaddr_in6 *gsin6) { struct nhop_object *nh; struct in6_addr dst; uint32_t scopeid; uint32_t fibnum; - KASSERT(inp->inp_vflag & INP_IPV6, - ("%s: not INP_IPV6 inpcb", __func__)); KASSERT(gsin6->sin6_family == AF_INET6, ("%s: not AF_INET6 group", __func__)); in6_splitscope(&gsin6->sin6_addr, &dst, &scopeid); - fibnum = inp ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + fibnum = inp->inp_inc.inc_fibnum; nh = fib6_lookup(fibnum, &dst, scopeid, 0, 0); return (nh ? nh->nh_ifp : NULL); From owner-svn-src-head@freebsd.org Tue Aug 4 15:25: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 B1B7A377429; Tue, 4 Aug 2020 15:25: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdqR4DnNz4Tvq; Tue, 4 Aug 2020 15:25: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 7073D27544; Tue, 4 Aug 2020 15:25: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 074FPNGc043750; Tue, 4 Aug 2020 15:25:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074FPNLh043749; Tue, 4 Aug 2020 15:25:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041525.074FPNLh043749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 15:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 15:25:23 -0000 Author: manu Date: Tue Aug 4 15:25:22 2020 New Revision: 363842 URL: https://svnweb.freebsd.org/changeset/base/363842 Log: linuxkpi: Add clear_bit_unlock This calls clear_bit and adds a memory barrier. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25943 Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:00:02 2020 (r363841) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:25:22 2020 (r363842) @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned #define test_bit(i, a) \ !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) +static inline void +clear_bit_unlock(long bit, volatile unsigned long *var) +{ + clear_bit(bit, var); + wmb(); +} + static inline int test_and_clear_bit(long bit, volatile unsigned long *var) { From owner-svn-src-head@freebsd.org Tue Aug 4 15:27: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 2EA20377444; Tue, 4 Aug 2020 15:27:33 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdsx0Rmdz4VCk; Tue, 4 Aug 2020 15:27:33 +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 E696727710; Tue, 4 Aug 2020 15:27:32 +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 074FRWjw043908; Tue, 4 Aug 2020 15:27:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074FRW6d043907; Tue, 4 Aug 2020 15:27:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041527.074FRW6d043907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 15:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363843 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 15:27:33 -0000 Author: manu Date: Tue Aug 4 15:27:32 2020 New Revision: 363843 URL: https://svnweb.freebsd.org/changeset/base/363843 Log: linuxkpi: Add time_after32 and time_before32 This compare two 32 bits times Sponsored by: The FreeBSD Foundation Reviewed by: kib, hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25700 Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Aug 4 15:25:22 2020 (r363842) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Aug 4 15:27:32 2020 (r363843) @@ -45,7 +45,9 @@ #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) #define time_after(a, b) ((int)((b) - (a)) < 0) +#define time_after32(a, b) ((int32_t)((uint32_t)(b) - (uint32_t)(a)) < 0) #define time_before(a, b) time_after(b,a) +#define time_before32(a, b) time_after32(b, a) #define time_after_eq(a, b) ((int)((a) - (b)) >= 0) #define time_before_eq(a, b) time_after_eq(b, a) #define time_in_range(a,b,c) \ From owner-svn-src-head@freebsd.org Tue Aug 4 18:11:06 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 2DBDA37B754; Tue, 4 Aug 2020 18:11:06 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjVd1QtNz4fkD; Tue, 4 Aug 2020 18:11:04 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102858.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 074HnfEN020473; Tue, 4 Aug 2020 13:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=r96/fbvc7txA5O/RlVDmOUs2K8dguw/4wF4NJKm3594=; b=KIXcxu3K1gA7HtimYvix2weDYMFqzdPrua+APywB7nqXlDq8i93e9LkmZbsREdIVAb7W d44MMJ5ElFcve9UO7oZ9jbaYmYFLi/Fvj1ZcHnnUhATWm9f5pVBV7M2q/oYlyh858mXl bauNRqjik6ZHZDtJKSQqccCey30CtNjCw2C9nzQEf04H/+QuasKa17lAvPrsFc9dyHcj UAJ6uTY+nZyEZ5EVpv8RaOo7DFun/uhns3mbfXWC270ESDJrWmJFFE5sgi7PUSaTqgWh +NWa5DBJry2hU/U7m3uH7u2u4L/cJE+WAn+iyVlyC2Euzh/9d3iXR+os/Dp3Y0KdiCad iA== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 32n60ckh3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 13:11:03 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 1C1EE460B9F; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 1AA5346099D; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id WbdwhqVRf7zr; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id C189D46067B; Tue, 4 Aug 2020 13:11:02 -0500 (CDT) Subject: Re: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008041525.074FPNLh043749@repo.freebsd.org> From: Alan Cox Message-ID: <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> Date: Tue, 4 Aug 2020 13:11:02 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202008041525.074FPNLh043749@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-04_04:2020-08-03, 2020-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1011 mlxscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=684 impostorscore=0 adultscore=0 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040131 X-Rspamd-Queue-Id: 4BLjVd1QtNz4fkD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rice.edu header.s=ricemail header.b=KIXcxu3K; dmarc=pass (policy=none) header.from=rice.edu; spf=pass (mx1.freebsd.org: domain of alc@rice.edu designates 148.163.153.244 as permitted sender) smtp.mailfrom=alc@rice.edu X-Spamd-Result: default: False [-5.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[rice.edu:s=ricemail]; NEURAL_HAM_MEDIUM(-1.00)[-1.005]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+a:a32.spf.rice.edu]; NEURAL_HAM_LONG(-0.98)[-0.983]; DWL_DNSWL_LOW(-1.00)[rice.edu:dkim]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[rice.edu:+]; DMARC_POLICY_ALLOW(-0.50)[rice.edu,none]; NEURAL_HAM_SHORT(-1.14)[-1.135]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22843, ipnet:148.163.152.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[148.163.153.244:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:11:06 -0000 On 8/4/20 10:25 AM, Emmanuel Vadot wrote: > Author: manu > Date: Tue Aug 4 15:25:22 2020 > New Revision: 363842 > URL: https://svnweb.freebsd.org/changeset/base/363842 > > Log: > linuxkpi: Add clear_bit_unlock > > This calls clear_bit and adds a memory barrier. > > Sponsored by: The FreeBSD Foundation > > Reviewed by: hselasky > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25943 > > Modified: > head/sys/compat/linuxkpi/common/include/linux/bitops.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:00:02 2020 (r363841) > +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:25:22 2020 (r363842) > @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned > #define test_bit(i, a) \ > !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) > > +static inline void > +clear_bit_unlock(long bit, volatile unsigned long *var) > +{ > + clear_bit(bit, var); > + wmb(); For an unlock operation, the memory barrier should come before the clear_bit() call, not after.  See, for example, the alpha implementation in Linux.  Also, the correct "spelling" for this memory barrier in FreeBSD would be atomic_thread_fence_rel(). See, for example, the comment at the top of sys/amd64/include/atomic.h. > +} > + > static inline int > test_and_clear_bit(long bit, volatile unsigned long *var) > { From owner-svn-src-head@freebsd.org Tue Aug 4 18:19: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 7ABCA37B870; Tue, 4 Aug 2020 18:19:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjhL2fwhz3RNG; Tue, 4 Aug 2020 18:19:30 +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 39A3C95B3; Tue, 4 Aug 2020 18:19:30 +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 074IJUSf047942; Tue, 4 Aug 2020 18:19:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IJU23047941; Tue, 4 Aug 2020 18:19:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041819.074IJU23047941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363846 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:19:30 -0000 Author: jhb Date: Tue Aug 4 18:19:29 2020 New Revision: 363846 URL: https://svnweb.freebsd.org/changeset/base/363846 Log: Turn off errors for -Wmaybe-uninitialized in GCC 6+. Recent changes to trigger this warning and seem like a false positive. Differential Revision: https://reviews.freebsd.org/D25726 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 16:06:58 2020 (r363845) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:19:29 2020 (r363846) @@ -150,7 +150,8 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=maybe-uninitialized \ + -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable From owner-svn-src-head@freebsd.org Tue Aug 4 18:20: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 F237E37B94D; Tue, 4 Aug 2020 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjjg6C4cz3RTH; Tue, 4 Aug 2020 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B866496E2; Tue, 4 Aug 2020 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074IKdAw050400; Tue, 4 Aug 2020 18:20:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IKdOE050399; Tue, 4 Aug 2020 18:20:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041820.074IKdOE050399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363847 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:20:40 -0000 Author: jhb Date: Tue Aug 4 18:20:39 2020 New Revision: 363847 URL: https://svnweb.freebsd.org/changeset/base/363847 Log: Disable errors for -Wredundant-decls for GCC 6+. GCC triggers warnings for this that clang does not for duplicate declarations of yylex(). Differential Revision: https://reviews.freebsd.org/D25727 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 18:19:29 2020 (r363846) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:20:39 2020 (r363847) @@ -152,6 +152,7 @@ CWARNFLAGS+= -Wno-error=address \ .if ${COMPILER_VERSION} >= 60100 CWARNFLAGS+= -Wno-error=maybe-uninitialized \ -Wno-error=nonnull-compare \ + -Wno-error=redundant-decls \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable From owner-svn-src-head@freebsd.org Tue Aug 4 18:23: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 9C8DB37B7D7; Tue, 4 Aug 2020 18:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjn13fHVz3RwN; Tue, 4 Aug 2020 18:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C9196F6; Tue, 4 Aug 2020 18:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074INXxc054019; Tue, 4 Aug 2020 18:23:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074INXHM054018; Tue, 4 Aug 2020 18:23:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041823.074INXHM054018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363848 - head/lib/csu/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/csu/mips X-SVN-Commit-Revision: 363848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:23:33 -0000 Author: jhb Date: Tue Aug 4 18:23:32 2020 New Revision: 363848 URL: https://svnweb.freebsd.org/changeset/base/363848 Log: ld.bfd requires an explicit emulation for MIPS for ld -r. Unlike lld, ld.bfd doesn't infer the emulation from the first object file, but assumes its compiled in default for ld -r. Differential Revision: https://reviews.freebsd.org/D25728 Modified: head/lib/csu/mips/Makefile Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Tue Aug 4 18:20:39 2020 (r363847) +++ head/lib/csu/mips/Makefile Tue Aug 4 18:23:32 2020 (r363848) @@ -2,6 +2,27 @@ .PATH: ${.CURDIR:H}/common +.include + CFLAGS+= -DCRT_IRELOC_SUPPRESS + +.if ${MACHINE_ARCH:Mmips64} +ELFCLASS= 64 +.else +ELFCLASS= 32 +.endif +.if ${MACHINE_ARCH:Mmips*el} +ENDIAN= l +.else +ENDIAN= b +.endif +.if ${MACHINE_ARCH:Mmipsn32*} +SUFFIX= n32 +.else +SUFFIX= +.endif + +# binutils requires an explicit emulation for ld -r +LDFLAGS.bfd+= -Wl,-m -Wl,elf${ELFCLASS}${ENDIAN}tsmip${SUFFIX}_fbsd .include From owner-svn-src-head@freebsd.org Tue Aug 4 18:24: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 1CD3137BF0E; Tue, 4 Aug 2020 18:24:47 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjpQ62mQz3S6G; Tue, 4 Aug 2020 18:24:46 +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 B3E3999AA; Tue, 4 Aug 2020 18:24:46 +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 074IOkgn054129; Tue, 4 Aug 2020 18:24:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IOkWS054128; Tue, 4 Aug 2020 18:24:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041824.074IOkWS054128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363849 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:24:47 -0000 Author: jhb Date: Tue Aug 4 18:24:46 2020 New Revision: 363849 URL: https://svnweb.freebsd.org/changeset/base/363849 Log: Disable errors for -Wsystem-headers for GCC on aarch64. GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and GCC 9. Differential Revision: https://reviews.freebsd.org/D25729 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 18:23:32 2020 (r363848) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:24:46 2020 (r363849) @@ -184,6 +184,11 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations -Wno-error=sizeof-pointer-memaccess \ -Wno-error=stringop-truncation .endif + +# GCC's own arm_neon.h triggers various warnings +.if ${MACHINE_ARCH} == "aarch64" +CWARNFLAGS+= -Wno-system-headers +.endif .endif # gcc # How to handle FreeBSD custom printf format specifiers. From owner-svn-src-head@freebsd.org Tue Aug 4 18:25: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 2EFF937C017; Tue, 4 Aug 2020 18:25:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjqd5z0fz3SGh; Tue, 4 Aug 2020 18:25:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1596565541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ds1YB/MuO1zBd8vtCqHp6X9LDxGQCsV7+OMeavWI0q8=; b=pV2IFv7A/q9LV26l1Bt+9SpVlhBiqMXCQIaojrEwuFyjb9G52d3WUiHlkm4HLDkq9GwMHA tC5kQb9GR0ZgAThDub+b5LXgoUSEFIzz7hul6hA8BH6FEUko6xmJY1+ycF6COeNVka5/x2 mMfFam/spyrOr79gYrSQg3NGOiqgnCc= Received: from skull.home.blih.net (lfbn-idf2-1-1138-237.w90-92.abo.wanadoo.fr [90.92.20.237]) by mx.blih.net (OpenSMTPD) with ESMTPSA id ef8f1af6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 4 Aug 2020 18:25:41 +0000 (UTC) Date: Tue, 4 Aug 2020 20:25:41 +0200 From: Emmanuel Vadot To: Alan Cox Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux Message-Id: <20200804202541.0b6b3eb6ce26522ee12a796c@bidouilliste.com> In-Reply-To: <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> References: <202008041525.074FPNLh043749@repo.freebsd.org> <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4BLjqd5z0fz3SGh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=pV2IFv7A; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.05 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.02)[-1.024]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.50)[-0.497]; NEURAL_HAM_MEDIUM(-1.02)[-1.023]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:25:51 -0000 On Tue, 4 Aug 2020 13:11:02 -0500 Alan Cox wrote: >=20 > On 8/4/20 10:25 AM, Emmanuel Vadot wrote: > > Author: manu > > Date: Tue Aug 4 15:25:22 2020 > > New Revision: 363842 > > URL: https://svnweb.freebsd.org/changeset/base/363842 > > > > Log: > > linuxkpi: Add clear_bit_unlock > > =20 > > This calls clear_bit and adds a memory barrier. > > =20 > > Sponsored by: The FreeBSD Foundation > > =20 > > Reviewed by: hselasky > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D25943 > > > > Modified: > > head/sys/compat/linuxkpi/common/include/linux/bitops.h > > > > Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 1= 5:00:02 2020 (r363841) > > +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 1= 5:25:22 2020 (r363842) > > @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsi= gned > > #define test_bit(i, a) \ > > !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) = & BIT_MASK(i)) > > =20 > > +static inline void > > +clear_bit_unlock(long bit, volatile unsigned long *var) > > +{ > > + clear_bit(bit, var); > > + wmb(); >=20 >=20 > For an unlock operation, the memory barrier should come before the=20 > clear_bit() call, not after.=A0 See, for example, the alpha implementatio= n=20 > in Linux.=A0 Also, the correct "spelling" for this memory barrier in=20 > FreeBSD would be atomic_thread_fence_rel(). See, for example, the=20 > comment at the top of sys/amd64/include/atomic.h. Ah yes, thanks. I probably got lost looking for the linux implem but that does make sense, I'll fix that probably tomorow. Thanks. >=20 > > +} > > + > > static inline int > > test_and_clear_bit(long bit, volatile unsigned long *var) > > { --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Tue Aug 4 18:30: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 1A02A37BEF7; Tue, 4 Aug 2020 18:30:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BLjwm731kz3ShT; Tue, 4 Aug 2020 18:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:f048:ff6b:240e:4c18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2C83916647; Tue, 4 Aug 2020 18:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r363849 - head/share/mk From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008041824.074IOkWS054128@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <33146746-fc65-8eea-7235-2677e38d282d@FreeBSD.org> Date: Tue, 4 Aug 2020 11:30:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202008041824.074IOkWS054128@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 18:30:17 -0000 On 8/4/20 11:24 AM, John Baldwin wrote: > Author: jhb > Date: Tue Aug 4 18:24:46 2020 > New Revision: 363849 > URL: https://svnweb.freebsd.org/changeset/base/363849 > > Log: > Disable errors for -Wsystem-headers for GCC on aarch64. > > GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and > GCC 9. > > Differential Revision: https://reviews.freebsd.org/D25729 This (and the previous fixes) was found by a knob I have in review to switch 'make tinderbox' to using GCC toolchains when possible. It lets you do 'make tinderbox USE_GCC_TOOLCHAINS=yes' and it uses GCC instead of LLVM for architectures with a GCC package. The current patch in review at the URL below uses GCC 6 packages. I have a WIP branch to move to GCC9 which adds riscv and 32-bit powerpc leaving 32-bit arm as the only architecture without a GCC toolchain. https://reviews.freebsd.org/D25732 -- John Baldwin From owner-svn-src-head@freebsd.org Tue Aug 4 19:27: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 5886337D0ED; Tue, 4 Aug 2020 19:27:04 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlBJ1f7Vz3WG4; Tue, 4 Aug 2020 19:27:04 +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 1B3A7A655; Tue, 4 Aug 2020 19:27:04 +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 074JR3GE091268; Tue, 4 Aug 2020 19:27:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JR3NV091267; Tue, 4 Aug 2020 19:27:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008041927.074JR3NV091267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Aug 2020 19:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363852 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 363852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:27:04 -0000 Author: mav Date: Tue Aug 4 19:27:03 2020 New Revision: 363852 URL: https://svnweb.freebsd.org/changeset/base/363852 Log: Remove extra memset() left after r342388. This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(), that broke target reset on device removal, making later re-insertion into the same slot impossible, since firmware was still waiting for the driver to finish with the removed device. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Tue Aug 4 19:06:25 2020 (r363851) +++ head/sys/dev/mpr/mpr_sas.c Tue Aug 4 19:27:03 2020 (r363852) @@ -515,7 +515,6 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint mprsas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; - memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Aug 4 19:06:25 2020 (r363851) +++ head/sys/dev/mps/mps_sas.c Tue Aug 4 19:27:03 2020 (r363852) @@ -515,7 +515,6 @@ mpssas_prepare_remove(struct mpssas_softc *sassc, uint mpssas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; - memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; From owner-svn-src-head@freebsd.org Tue Aug 4 19:44: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 4B15137D5F0; Tue, 4 Aug 2020 19:44:49 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlZn1Y01z3X6L; Tue, 4 Aug 2020 19:44:49 +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 14760A4E2; Tue, 4 Aug 2020 19:44:49 +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 074JinDq003568; Tue, 4 Aug 2020 19:44:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Jii4l003541; Tue, 4 Aug 2020 19:44:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041944.074Jii4l003541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 19:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363853 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/freescale arm64/hisilicon arm64/intel arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom ... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/freescale arm64/hisilicon arm64/intel arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom arm64/realtek arm64/renes... X-SVN-Commit-Revision: 363853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:44:49 -0000 Author: manu Date: Tue Aug 4 19:44:43 2020 New Revision: 363853 URL: https://svnweb.freebsd.org/changeset/base/363853 Log: Import DTS files for arm, arm64, riscv from Linux 5.8 MFC after: 2 months Added: head/sys/gnu/dts/arm/am5729-beagleboneai.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-yosemitev2.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yosemitev2.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-nicole.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-nicole.dts head/sys/gnu/dts/arm/at91-sama5d2_icp.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/at91-sama5d2_icp.dts head/sys/gnu/dts/arm/bcm2835-rpi-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/bcm2835-rpi-common.dtsi head/sys/gnu/dts/arm/dra7-ipu-dsp-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/dra7-ipu-dsp-common.dtsi head/sys/gnu/dts/arm/dra74-ipu-dsp-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/dra74-ipu-dsp-common.dtsi head/sys/gnu/dts/arm/exynos4210-i9100.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/exynos4210-i9100.dts head/sys/gnu/dts/arm/imx6dl-colibri-v1_1-eval-v3.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/imx6dl-colibri-v1_1-eval-v3.dts head/sys/gnu/dts/arm/imx6qdl-colibri-v1_1-uhs.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/imx6qdl-colibri-v1_1-uhs.dtsi head/sys/gnu/dts/arm/integratorap-im-pd1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/integratorap-im-pd1.dts head/sys/gnu/dts/arm/kirkwood-l-50.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/kirkwood-l-50.dts head/sys/gnu/dts/arm/r8a7742-iwg21d-q7.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742-iwg21d-q7.dts head/sys/gnu/dts/arm/r8a7742-iwg21m.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742-iwg21m.dtsi head/sys/gnu/dts/arm/r8a7742.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742.dtsi head/sys/gnu/dts/arm/rtd1195-horseradish.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195-horseradish.dts head/sys/gnu/dts/arm/rtd1195-mele-x1000.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195-mele-x1000.dts head/sys/gnu/dts/arm/rtd1195.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195.dtsi head/sys/gnu/dts/arm/stm32mp157a-dhcor-avenger96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-dhcor-avenger96.dts head/sys/gnu/dts/arm/stm32mp157a-iot-box.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-iot-box.dts head/sys/gnu/dts/arm/stm32mp157a-stinger96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dts head/sys/gnu/dts/arm/stm32mp157a-stinger96.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dtsi head/sys/gnu/dts/arm/stm32mp157c-lxa-mc1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157c-lxa-mc1.dts head/sys/gnu/dts/arm/stm32mp15xx-dhcom-pdk2.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-pdk2.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcom-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-som.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-avenger96.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-avenger96.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-io1v8.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-io1v8.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-som.dtsi head/sys/gnu/dts/arm/stm32mp15xx-osd32.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-osd32.dtsi head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime-emmc.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime-emmc.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-cpu-opp.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-cpu-opp.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-gtking-pro.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-gtking.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-w400.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-w400.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s805x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1-odroid-c4.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-odroid-c4.dts head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-baseboard.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-baseboard.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-kit.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-kit.dts head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-som.dtsi head/sys/gnu/dts/arm64/mediatek/mt6358.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt6358.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana-rev7.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana-rev7.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173-elm.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dtsi head/sys/gnu/dts/arm64/qcom/sdm660-xiaomi-lavender.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/qcom/sdm660-xiaomi-lavender.dts head/sys/gnu/dts/arm64/qcom/sdm660.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/qcom/sdm660.dtsi head/sys/gnu/dts/arm64/realtek/rtd1295-xnano-x5.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1295-xnano-x5.dts head/sys/gnu/dts/arm64/realtek/rtd1395-bpi-m4.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395-bpi-m4.dts head/sys/gnu/dts/arm64/realtek/rtd1395-lionskin.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395-lionskin.dts head/sys/gnu/dts/arm64/realtek/rtd1395.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395.dtsi head/sys/gnu/dts/arm64/realtek/rtd139x.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd139x.dtsi head/sys/gnu/dts/arm64/realtek/rtd1619-mjolnir.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1619-mjolnir.dts head/sys/gnu/dts/arm64/realtek/rtd1619.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1619.dtsi head/sys/gnu/dts/arm64/realtek/rtd16xx.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd16xx.dtsi head/sys/gnu/dts/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts head/sys/gnu/dts/arm64/rockchip/rk3326-odroid-go2.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/rockchip/rk3326-odroid-go2.dts head/sys/gnu/dts/arm64/rockchip/rk3326.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/rockchip/rk3326.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld20-akebi96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-akebi96.dts head/sys/gnu/dts/arm64/ti/k3-am654-industrial-thermal.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/ti/k3-am654-industrial-thermal.dtsi head/sys/gnu/dts/include/dt-bindings/clock/agilex-clock.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/agilex-clock.h head/sys/gnu/dts/include/dt-bindings/clock/bt1-ccu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/bt1-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/intel,lgm-clk.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/intel,lgm-clk.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2-audio.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2-audio.h head/sys/gnu/dts/include/dt-bindings/clock/mt6765-clk.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/mt6765-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8939.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8939.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7742-cpg-mssr.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/r8a7742-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/x1830-cgu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/x1830-cgu.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mm.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mm.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mn.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mn.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mq.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mq.h head/sys/gnu/dts/include/dt-bindings/mailbox/qcom-ipcc.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/mailbox/qcom-ipcc.h head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8dxl.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/pinctrl/pads-imx8dxl.h head/sys/gnu/dts/include/dt-bindings/power/marvell,mmp2.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/power/meson-gxbb-power.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/meson-gxbb-power.h head/sys/gnu/dts/include/dt-bindings/power/meson8-power.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/meson8-power.h head/sys/gnu/dts/include/dt-bindings/power/r8a7742-sysc.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/r8a7742-sysc.h head/sys/gnu/dts/include/dt-bindings/reset/bt1-ccu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/bt1-ccu.h head/sys/gnu/dts/include/dt-bindings/reset/imx8mp-reset.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/imx8mp-reset.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8939.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/qcom,gcc-msm8939.h head/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1195.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/realtek,rtd1195.h Deleted: head/sys/gnu/dts/arm/stm32mp157c-dhcom-som.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc-soc-pins.dtsi Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am335x-guardian.dts head/sys/gnu/dts/arm/am335x-lxm.dts head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-pocketbeagle.dts head/sys/gnu/dts/arm/am33xx-l4.dtsi head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am3517-evm.dts head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-l4.dtsi head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk-common.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/armada-370-xp.dtsi head/sys/gnu/dts/arm/armada-375.dtsi head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-39x.dtsi head/sys/gnu/dts/arm/aspeed-ast2600-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts head/sys/gnu/dts/arm/aspeed-bmc-ibm-rainier.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-mihawk.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-tacoma.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/aspeed-g6.dtsi head/sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi head/sys/gnu/dts/arm/at91-kizbox3-hs.dts head/sys/gnu/dts/arm/at91-kizbox3_common.dtsi head/sys/gnu/dts/arm/at91-sam9x60ek.dts head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts head/sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi head/sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-wb50n.dtsi head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2711-rpi-4-b.dts head/sys/gnu/dts/arm/bcm2835-common.dtsi head/sys/gnu/dts/arm/bcm2835.dtsi head/sys/gnu/dts/arm/bcm2836.dtsi head/sys/gnu/dts/arm/bcm2837.dtsi head/sys/gnu/dts/arm/bcm47094-luxul-xwc-2000.dts head/sys/gnu/dts/arm/bcm958522er.dts head/sys/gnu/dts/arm/bcm958525er.dts head/sys/gnu/dts/arm/bcm958525xmc.dts head/sys/gnu/dts/arm/bcm958622hr.dts head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/bcm958625k.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/dm814x.dtsi head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dove.dtsi head/sys/gnu/dts/arm/dra7-evm-common.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7-l4.dtsi head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra72-evm-revc.dts head/sys/gnu/dts/arm/dra72-evm.dts head/sys/gnu/dts/arm/dra72x.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/e60k02.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi head/sys/gnu/dts/arm/exynos4412-midas.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-cx9020.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5910.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-s.dtsi head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-som-common.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-tqma7.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d-tqma7.dtsi head/sys/gnu/dts/arm/imx7d-zii-rmu2.dts head/sys/gnu/dts/arm/imx7d-zii-rpu2.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/integratorap.dts head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts head/sys/gnu/dts/arm/meson8m2.dtsi head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/mmp3.dtsi head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/mt7623n-rfb-emmc.dts head/sys/gnu/dts/arm/omap2.dtsi head/sys/gnu/dts/arm/omap2420.dtsi head/sys/gnu/dts/arm/omap2430.dtsi head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-devkit8000.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap4-duovero-parlor.dts head/sys/gnu/dts/arm/omap4-l4.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap5-l4.dtsi head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-ipq4019.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7744.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3066a-mk808.dts head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3229-xms6.dts head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-firefly.dtsi head/sys/gnu/dts/arm/rk3288-miqi.dts head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-tinker.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/s5pv210-aries.dtsi head/sys/gnu/dts/arm/s5pv210-fascinate4g.dts head/sys/gnu/dts/arm/s5pv210-galaxys.dts head/sys/gnu/dts/arm/s5pv210-pinctrl.dtsi head/sys/gnu/dts/arm/s5pv210.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3_can.dtsi head/sys/gnu/dts/arm/sama5d3_emac.dtsi head/sys/gnu/dts/arm/sama5d3_gmac.dtsi head/sys/gnu/dts/arm/sama5d3_lcd.dtsi head/sys/gnu/dts/arm/sama5d3_mci2.dtsi head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi head/sys/gnu/dts/arm/sama5d3_uart.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/ste-ux500-samsung-golden.dts head/sys/gnu/dts/arm/ste-ux500-samsung-skomer.dts head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32mp15-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp151.dtsi head/sys/gnu/dts/arm/stm32mp157.dtsi head/sys/gnu/dts/arm/stm32mp157a-avenger96.dts head/sys/gnu/dts/arm/stm32mp157c-dhcom-pdk2.dts head/sys/gnu/dts/arm/stm32mp157c-dk2.dts head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c-ev1.dts head/sys/gnu/dts/arm/stm32mp15xx-dkx.dtsi head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/tegra114-dalmore.dts head/sys/gnu/dts/arm/tegra124-venice2.dts head/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts head/sys/gnu/dts/arm/tegra20-colibri-iris.dts head/sys/gnu/dts/arm/tegra20-harmony.dts head/sys/gnu/dts/arm/tegra20-medcom-wide.dts head/sys/gnu/dts/arm/tegra20-paz00.dts head/sys/gnu/dts/arm/tegra20-seaboard.dts head/sys/gnu/dts/arm/tegra20-ventana.dts head/sys/gnu/dts/arm/tegra30-apalis-eval.dts head/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts head/sys/gnu/dts/arm/tegra30-beaver.dts head/sys/gnu/dts/arm/tegra30-cardhu.dtsi head/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-ace.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-tanix-tx6.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk_nand.dts head/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12-common.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-ugoos-am6.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx-libretech-pc.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-kii-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi head/sys/gnu/dts/arm64/amlogic/meson-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-sm1-sei610.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8-gicv2.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8.dtsi head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts head/sys/gnu/dts/arm64/arm/juno-base.dtsi head/sys/gnu/dts/arm64/arm/juno-motherboard.dtsi head/sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi head/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frdm.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28-var2.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mm.dtsi head/sys/gnu/dts/arm64/freescale/imx8mn-ddr4-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mn.dtsi head/sys/gnu/dts/arm64/freescale/imx8mp.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0.dtsi head/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi head/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi head/sys/gnu/dts/arm64/hisilicon/hikey960-pinctrl.dtsi head/sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi head/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk.dts head/sys/gnu/dts/arm64/marvell/armada-3720-db.dts head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dtsi head/sys/gnu/dts/arm64/marvell/armada-3720-turris-mox.dts head/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts head/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts head/sys/gnu/dts/arm64/marvell/armada-ap80x.dtsi head/sys/gnu/dts/arm64/mediatek/mt2712-evb.dts head/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi head/sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts head/sys/gnu/dts/arm64/mediatek/mt6797.dtsi head/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts head/sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts head/sys/gnu/dts/arm64/mediatek/mt7622.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173.dtsi head/sys/gnu/dts/arm64/mediatek/mt8183-evb.dts head/sys/gnu/dts/arm64/mediatek/mt8183.dtsi head/sys/gnu/dts/arm64/mediatek/mt8516.dtsi head/sys/gnu/dts/arm64/mediatek/pumpkin-common.dtsi head/sys/gnu/dts/arm64/nvidia/tegra132-norrin.dts head/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra210.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi head/sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts head/sys/gnu/dts/arm64/qcom/ipq8074.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-longcheer-l8150.dts head/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a2015-common.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a3u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a5u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8916.dtsi head/sys/gnu/dts/arm64/qcom/msm8996.dtsi head/sys/gnu/dts/arm64/qcom/msm8998.dtsi head/sys/gnu/dts/arm64/qcom/pm8150.dtsi head/sys/gnu/dts/arm64/qcom/pm8150b.dtsi head/sys/gnu/dts/arm64/qcom/pm8150l.dtsi head/sys/gnu/dts/arm64/qcom/pmi8994.dtsi head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi head/sys/gnu/dts/arm64/qcom/qcs404.dtsi head/sys/gnu/dts/arm64/qcom/sc7180-idp.dts head/sys/gnu/dts/arm64/qcom/sc7180.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-db845c.dts head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts head/sys/gnu/dts/arm64/qcom/sdm845.dtsi head/sys/gnu/dts/arm64/qcom/sdm850-lenovo-yoga-c630.dts head/sys/gnu/dts/arm64/qcom/sm8250-mtp.dts head/sys/gnu/dts/arm64/qcom/sm8250.dtsi head/sys/gnu/dts/arm64/realtek/rtd1293-ds418j.dts head/sys/gnu/dts/arm64/realtek/rtd1293.dtsi head/sys/gnu/dts/arm64/realtek/rtd1295-mele-v9.dts head/sys/gnu/dts/arm64/realtek/rtd1295-probox2-ava.dts head/sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts head/sys/gnu/dts/arm64/realtek/rtd1295.dtsi head/sys/gnu/dts/arm64/realtek/rtd1296-ds418.dts head/sys/gnu/dts/arm64/realtek/rtd1296.dtsi head/sys/gnu/dts/arm64/realtek/rtd129x.dtsi head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774b1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi head/sys/gnu/dts/arm64/renesas/r8a77950.dtsi head/sys/gnu/dts/arm64/renesas/r8a77951.dtsi head/sys/gnu/dts/arm64/renesas/r8a77960.dtsi head/sys/gnu/dts/arm64/renesas/r8a77961.dtsi head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi head/sys/gnu/dts/arm64/renesas/r8a77970.dtsi head/sys/gnu/dts/arm64/renesas/r8a77980.dtsi head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi head/sys/gnu/dts/arm64/renesas/r8a77995.dtsi head/sys/gnu/dts/arm64/rockchip/px30.dtsi head/sys/gnu/dts/arm64/rockchip/rk3308-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328-a1.dts head/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi head/sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts head/sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts head/sys/gnu/dts/arm64/rockchip/rk3368-r88.dts head/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts head/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts head/sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-orangepi.dts head/sys/gnu/dts/arm64/rockchip/rk3399-pinebook-pro.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld11-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi head/sys/gnu/dts/arm64/sprd/sc9863a.dtsi head/sys/gnu/dts/arm64/sprd/sharkl3.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts head/sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi head/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi head/sys/gnu/dts/include/dt-bindings/clock/at91.h head/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx8mp-clock.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sc7180.h head/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9863a-clk.h head/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h head/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h head/sys/gnu/dts/include/dt-bindings/clock/x1000-cgu.h head/sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/phy/phy.h head/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h head/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1295.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/riscv/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-baltos.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -369,7 +369,7 @@ &mmc2 { status = "okay"; vmmc-supply = <&wl12xx_vmmc>; - ti,non-removable; + non-removable; bus-width = <4>; cap-power-off-card; pinctrl-names = "default"; Modified: head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -22,6 +22,7 @@ pinctrl-0 = <&emmc_pins>; bus-width = <8>; status = "okay"; + non-removable; }; &am33xx_pinmux { Modified: head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -75,7 +75,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -367,7 +367,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -75,7 +75,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -743,8 +743,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wlan_pins>; - ti,non-removable; - ti,needs-special-hs-handling; + non-removable; cap-power-off-card; keep-power-in-suspend; Modified: head/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evmsk.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-evmsk.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -655,7 +655,7 @@ &mmc2 { status = "okay"; vmmc-supply = <&wl12xx_vmmc>; - ti,non-removable; + non-removable; bus-width = <4>; cap-power-off-card; keep-power-in-suspend; Modified: head/sys/gnu/dts/arm/am335x-guardian.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-guardian.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-guardian.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -105,6 +105,7 @@ ti,timers = <&timer7>; pinctrl-names = "default"; pinctrl-0 = <&dmtimer7_pins>; + ti,clock-source = <0x01>; }; vmmcsd_fixed: regulator-3v3 { Modified: head/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-lxm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-lxm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -339,7 +339,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -159,7 +159,7 @@ vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; pinctrl-0 = <&mmc1_pins_default>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -451,7 +451,7 @@ vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; pinctrl-0 = <&mmc2_pins_default>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-pepper.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pepper.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-pepper.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -341,7 +341,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&ldo3_reg>; bus-width = <8>; - ti,non-removable; + non-removable; }; &mmc3 { @@ -351,7 +351,7 @@ pinctrl-0 = <&wireless_pins>; vmmmc-supply = <&v3v3c_reg>; bus-width = <4>; - ti,non-removable; + non-removable; dmas = <&edma_xbar 12 0 1 &edma_xbar 13 0 2>; dma-names = "tx", "rx"; Modified: head/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -69,7 +69,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmc_reg>; bus-width = <8>; - ti,non-removable; + non-removable; status = "disabled"; }; Modified: head/sys/gnu/dts/arm/am335x-pocketbeagle.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pocketbeagle.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-pocketbeagle.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -88,7 +88,6 @@ AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0) AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0) AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0) - AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT, MUX_MODE4) /* (B12) mcasp0_aclkr.mmc0_sdwp */ >; }; Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -330,9 +330,8 @@ }; }; - target-module@31000 { /* 0x44e31000, ap 25 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 25 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>; @@ -1117,9 +1116,8 @@ }; }; - target-module@40000 { /* 0x48040000, ap 22 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 22 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>; @@ -1347,10 +1345,8 @@ ranges = <0x0 0x60000 0x1000>; mmc1: mmc@0 { - compatible = "ti,omap4-hsmmc"; - ti,dual-volt; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; - ti,needs-special-hs-handling; dmas = <&edma_xbar 24 0 0 &edma_xbar 25 0 0>; dma-names = "tx", "rx"; @@ -1828,7 +1824,7 @@ ranges = <0x0 0xd8000 0x1000>; mmc2: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; dmas = <&edma 2 0 &edma 3 0>; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am33xx.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -322,7 +322,7 @@ ranges = <0x0 0x47810000 0x1000>; mmc3: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; interrupts = <29>; reg = <0x0 0x1000>; @@ -618,5 +618,25 @@ compatible = "ti,am3-prm-inst", "ti,omap-prm-inst"; reg = <0x1100 0x100>; #reset-cells = <1>; + }; +}; + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; }; }; Modified: head/sys/gnu/dts/arm/am3517-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am3517-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am3517-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -156,6 +156,7 @@ pinctrl-0 = <&pwm_pins>; ti,timers = <&timer11>; #pwm-cells = <3>; + ti,clock-source = <0x01>; }; /* HS USB Host PHY on PORT 1 */ Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am3517.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -169,5 +169,25 @@ status = "disabled"; }; -/include/ "am35xx-clocks.dtsi" -/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" +#include "am35xx-clocks.dtsi" +#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&gpt1_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am4372.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -316,10 +316,11 @@ ranges = <0x0 0x47810000 0x1000>; mmc3: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; ti,needs-special-reset; interrupts = ; reg = <0x0 0x1000>; + status = "disabled"; }; }; @@ -551,5 +552,25 @@ compatible = "ti,am4-prm-inst", "ti,omap-prm-inst"; reg = <0x4000 0x100>; #reset-cells = <1>; + }; +}; + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; }; }; Modified: head/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-cm-t43.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-cm-t43.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -291,7 +291,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmc_3v3>; bus-width = <8>; - ti,non-removable; + non-removable; }; &spi0 { Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -91,22 +91,6 @@ backlight = <&lcd_bl>; - panel-timing { - clock-frequency = <33000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <210>; - hback-porch = <16>; - hsync-len = <30>; - vback-porch = <10>; - vfront-porch = <22>; - vsync-len = <13>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; @@ -869,7 +853,7 @@ pinctrl-names = "default", "sleep"; pinctrl-0 = <&emmc_pins_default>; pinctrl-1 = <&emmc_pins_sleep>; - ti,non-removable; + non-removable; }; &mmc3 { @@ -886,7 +870,7 @@ pinctrl-1 = <&mmc3_pins_sleep>; cap-power-off-card; keep-power-in-suspend; - ti,non-removable; + non-removable; #address-cells = <1>; #size-cells = <0>; Modified: head/sys/gnu/dts/arm/am437x-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am437x-l4.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-l4.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -328,9 +328,8 @@ }; }; - target-module@31000 { /* 0x44e31000, ap 24 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 24 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>; @@ -450,7 +449,6 @@ target-module@86000 { /* 0x44e86000, ap 40 70.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x86000 0x4>, <0x86004 0x4>; reg-names = "rev", "sysc"; @@ -868,9 +866,8 @@ }; }; - target-module@40000 { /* 0x48040000, ap 18 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 18 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>; @@ -1086,9 +1083,8 @@ ranges = <0x0 0x60000 0x1000>; mmc1: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; reg = <0x0 0x1000>; - ti,dual-volt; ti,needs-special-reset; dmas = <&edma 24 0>, <&edma 25 0>; @@ -1544,8 +1540,9 @@ reg = <0xcc020 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>; - clock-names = "fck"; + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>, + <&dcan0_fck>; + clock-names = "fck", "osc"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0xcc000 0x2000>; @@ -1553,6 +1550,8 @@ dcan0: can@0 { compatible = "ti,am4372-d_can", "ti,am3352-d_can"; reg = <0x0 0x2000>; + clocks = <&dcan0_fck>; + clock-names = "fck"; syscon-raminit = <&scm_conf 0x644 0>; interrupts = ; status = "disabled"; @@ -1564,8 +1563,9 @@ reg = <0xd0020 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>; - clock-names = "fck"; + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>, + <&dcan1_fck>; + clock-names = "fck", "osc"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0xd0000 0x2000>; @@ -1573,6 +1573,8 @@ dcan1: can@0 { compatible = "ti,am4372-d_can", "ti,am3352-d_can"; reg = <0x0 0x2000>; + clocks = <&dcan1_fck>; + clock-name = "fck"; syscon-raminit = <&scm_conf 0x644 1>; interrupts = ; status = "disabled"; @@ -1601,7 +1603,7 @@ ranges = <0x0 0xd8000 0x1000>; mmc2: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; reg = <0x0 0x1000>; ti,needs-special-reset; dmas = <&edma 2 0>, Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -134,22 +134,6 @@ enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; - panel-timing { - clock-frequency = <9000000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <2>; - hback-porch = <2>; - hsync-len = <41>; - vfront-porch = <2>; - vback-porch = <2>; - vsync-len = <10>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; @@ -719,7 +703,7 @@ pinctrl-1 = <&mmc3_pins_sleep>; cap-power-off-card; keep-power-in-suspend; - ti,non-removable; + non-removable; #address-cells = <1>; #size-cells = <0>; Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -47,22 +47,6 @@ backlight = <&lcd_bl>; - panel-timing { - clock-frequency = <33000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <210>; - hback-porch = <16>; - hsync-len = <30>; - vback-porch = <10>; - vfront-porch = <22>; - vsync-len = <13>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am571x-idk.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -10,6 +10,7 @@ #include "dra7-mmc-iodelay.dtsi" #include "dra72x-mmc-iodelay.dtsi" #include "am57xx-idk-common.dtsi" +#include "dra7-ipu-dsp-common.dtsi" / { model = "TI AM5718 IDK"; @@ -20,6 +21,33 @@ reg = <0x0 0x80000000 0x0 0x40000000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ipu2_memory_region: ipu2-memory@95800000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x95800000 0x0 0x3800000>; + reusable; + status = "okay"; + }; + + dsp1_memory_region: dsp1-memory@99000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x99000000 0x0 0x4000000>; + reusable; + status = "okay"; + }; + + ipu1_memory_region: ipu1-memory@9d000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9d000000 0x0 0x2000000>; + reusable; + status = "okay"; + }; + }; + leds { compatible = "gpio-leds"; cpu0-led { @@ -148,21 +176,19 @@ load-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; }; -&mailbox5 { +&ipu2 { status = "okay"; - mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { - status = "okay"; - }; - mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { - status = "okay"; - }; + memory-region = <&ipu2_memory_region>; }; -&mailbox6 { +&ipu1 { status = "okay"; - mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { - status = "okay"; - }; + memory-region = <&ipu1_memory_region>; +}; + +&dsp1 { + status = "okay"; + memory-region = <&dsp1_memory_region>; }; &pcie1_rc { Copied: head/sys/gnu/dts/arm/am5729-beagleboneai.dts (from r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am5729-beagleboneai.dts Tue Aug 4 19:44:43 2020 (r363853, copy of r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts) @@ -0,0 +1,731 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2014-2019 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/dts-v1/; + +#include "dra74x.dtsi" +#include "am57xx-commercial-grade.dtsi" +#include "dra74x-mmc-iodelay.dtsi" +#include +#include +#include + +/ { + model = "BeagleBoard.org BeagleBone AI"; + compatible = "beagle,am5729-beagleboneai", "ti,am5728", + "ti,dra742", "ti,dra74", "ti,dra7"; + + aliases { + rtc0 = &tps659038_rtc; + rtc1 = &rtc; + display0 = &hdmi_conn; + }; + + chosen { + stdout-path = &uart1; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x80000000 0x0 0x40000000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ipu2_memory_region: ipu2-memory@95800000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x95800000 0x0 0x3800000>; + reusable; + status = "okay"; + }; + + dsp1_memory_region: dsp1-memory@99000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x99000000 0x0 0x4000000>; + reusable; + status = "okay"; + }; + + ipu1_memory_region: ipu1-memory@9d000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9d000000 0x0 0x2000000>; + reusable; + status = "okay"; + }; + + dsp2_memory_region: dsp2-memory@9f000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9f000000 0x0 0x800000>; + reusable; + status = "okay"; + }; + + }; + + vdd_adc: gpioregulator-vdd_adc { + compatible = "regulator-gpio"; + regulator-name = "vdd_adc"; + vin-supply = <&vdd_5v>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; + states = <1800000 0 + 3300000 1>; + }; + + vdd_5v: fixedregulator-vdd_5v { + compatible = "regulator-fixed"; + regulator-name = "vdd_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + }; + + vtt_fixed: fixedregulator-vtt { + /* TPS51200 */ + compatible = "regulator-fixed"; + regulator-name = "vtt_fixed"; + vin-supply = <&vdd_ddr>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + leds { + compatible = "gpio-leds"; + + led0 { + label = "beaglebone:green:usr0"; + gpios = <&gpio3 17 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + led1 { + label = "beaglebone:green:usr1"; + gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + + led2 { + label = "beaglebone:green:usr2"; + gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "cpu"; + default-state = "off"; + }; + + led3 { + label = "beaglebone:green:usr3"; + gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc1"; + default-state = "off"; + }; + + led4 { + label = "beaglebone:green:usr4"; + gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "netdev"; + default-state = "off"; + }; + }; + + hdmi_conn: connector@0 { + compatible = "hdmi-connector"; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_encoder_out>; + }; + }; + }; + + hdmi_enc: encoder@0 { + /* "ti,tpd12s016" software compatible with "ti,tpd12s015" + * no need for individual driver + */ + compatible = "ti,tpd12s015"; + gpios = <0>, + <0>, + <&gpio7 12 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <0x1>; + #size-cells = <0x0>; + + port@0 { + reg = <0x0>; + + hdmi_encoder_in: endpoint@0 { + remote-endpoint = <&hdmi_out>; + }; + }; + + port@1 { + reg = <0x1>; + + hdmi_encoder_out: endpoint@0 { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + + emmc_pwrseq: emmc_pwrseq { + compatible = "mmc-pwrseq-emmc"; + reset-gpios = <&gpio5 7 GPIO_ACTIVE_LOW>; + }; + + brcmf_pwrseq: brcmf_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>, /* BT-REG-ON */ + <&gpio3 18 GPIO_ACTIVE_LOW>; /* WL-REG-ON */ + }; + + extcon_usb1: extcon_usb1 { + compatible = "linux,extcon-usb-gpio"; + ti,enable-id-detection; + id-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>; + }; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; + + tps659038: tps659038@58 { + compatible = "ti,tps659038"; + reg = <0x58>; + interrupt-parent = <&gpio6>; + interrupts = <16 IRQ_TYPE_LEVEL_LOW>; + + #interrupt-cells = <2>; + interrupt-controller; + + ti,system-power-controller; + ti,palmas-override-powerhold; + + tps659038_pmic { + compatible = "ti,tps659038-pmic"; + + smps12-in-supply = <&vdd_5v>; + smps3-in-supply = <&vdd_5v>; + smps45-in-supply = <&vdd_5v>; + smps6-in-supply = <&vdd_5v>; + smps7-in-supply = <&vdd_5v>; + mps3-in-supply = <&vdd_5v>; + smps8-in-supply = <&vdd_5v>; + smps9-in-supply = <&vdd_5v>; + ldo1-in-supply = <&vdd_5v>; + ldo2-in-supply = <&vdd_5v>; + ldo3-in-supply = <&vdd_5v>; + ldo4-in-supply = <&vdd_5v>; + ldo9-in-supply = <&vdd_5v>; + ldoln-in-supply = <&vdd_5v>; + ldousb-in-supply = <&vdd_5v>; + ldortc-in-supply = <&vdd_5v>; + + regulators { + vdd_mpu: smps12 { + /* VDD_MPU */ + regulator-name = "smps12"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_ddr: smps3 { + /* VDD_DDR EMIF1 EMIF2 */ + regulator-name = "smps3"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_dspeve: smps45 { + /* VDD_DSPEVE on AM572 */ + regulator-name = "smps45"; + regulator-min-microvolt = < 850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_gpu: smps6 { + /* VDD_GPU */ + regulator-name = "smps6"; + regulator-min-microvolt = < 850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_core: smps7 { + /* VDD_CORE */ + regulator-name = "smps7"; + regulator-min-microvolt = < 850000>; /*** 1.15V */ + regulator-max-microvolt = <1150000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_iva: smps8 { + /* VDD_IVAHD */ /*** 1.06V */ + regulator-name = "smps8"; + }; + + vdd_3v3: smps9 { + /* VDD_3V3 */ + regulator-name = "smps9"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_sd: ldo1 { + /* VDDSHV8 - VSDMMC */ + regulator-name = "ldo1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd_1v8: ldo2 { + /* VDDSH18V */ + regulator-name = "ldo2"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_phy_ldo3: ldo3 { + /* R1.3a 572x V1_8PHY_LDO3: USB, SATA */ + regulator-name = "ldo3"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_phy_ldo4: ldo4 { + /* R1.3a 572x V1_8PHY_LDO4: PCIE, HDMI*/ + regulator-name = "ldo4"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + /* LDO5-8 unused */ + + vdd_rtc: ldo9 { + /* VDD_RTC */ + regulator-name = "ldo9"; + regulator-min-microvolt = < 840000>; + regulator-max-microvolt = <1160000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_pll: ldoln { + /* VDDA_1V8_PLL */ + regulator-name = "ldoln"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + ldousb_reg: ldousb { + /* VDDA_3V_USB: VDDA_USBHS33 */ + regulator-name = "ldousb"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + ldortc_reg: ldortc { + /* VDDA_RTC */ + regulator-name = "ldortc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + regen1: regen1 { + /* VDD_3V3_ON */ + regulator-name = "regen1"; + regulator-boot-on; + regulator-always-on; + }; + + regen2: regen2 { + /* Needed for PMIC internal resource */ + regulator-name = "regen2"; + regulator-boot-on; + regulator-always-on; + }; + }; + }; + + tps659038_rtc: tps659038_rtc { + compatible = "ti,palmas-rtc"; + interrupt-parent = <&tps659038>; + interrupts = <8 IRQ_TYPE_EDGE_FALLING>; + wakeup-source; + }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 4 19:52: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 A75A637DA15; Tue, 4 Aug 2020 19:52: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLllP3shwz3XV6; Tue, 4 Aug 2020 19:52: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 68383AC05; Tue, 4 Aug 2020 19:52: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 074JqHs0009592; Tue, 4 Aug 2020 19:52:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JqHt5009591; Tue, 4 Aug 2020 19:52:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041952.074JqHt5009591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363854 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:52:17 -0000 Author: mjg Date: Tue Aug 4 19:52:16 2020 New Revision: 363854 URL: https://svnweb.freebsd.org/changeset/base/363854 Log: rms: add a comment explaining performance deficiencies of write locking Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Aug 4 19:44:43 2020 (r363853) +++ head/sys/kern/kern_rmlock.c Tue Aug 4 19:52:16 2020 (r363854) @@ -872,6 +872,10 @@ db_show_rm(const struct lock_object *lock) * Neither rms_rlock nor rms_runlock use fences. Instead compiler barriers are * inserted to prevert reordering of generated code. Execution ordering is * provided with the use of an IPI handler. + * + * No attempt is made to track which CPUs read locked at least once, + * consequently write locking sends IPIs to all of them. This will become a + * problem at some point. The easiest way to lessen it is to provide a bitmamp. */ void From owner-svn-src-head@freebsd.org Tue Aug 4 19:52: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 C0F4337D770; Tue, 4 Aug 2020 19:52:52 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlm44gnnz3XMg; Tue, 4 Aug 2020 19:52:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 851B4AC0C; Tue, 4 Aug 2020 19:52:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074JqqaB009660; Tue, 4 Aug 2020 19:52:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JqqEe009659; Tue, 4 Aug 2020 19:52:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041952.074JqqEe009659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363855 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:52:52 -0000 Author: mjg Date: Tue Aug 4 19:52:52 2020 New Revision: 363855 URL: https://svnweb.freebsd.org/changeset/base/363855 Log: cache: add missing numcache detrement on insertion failure Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:52:16 2020 (r363854) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:52:52 2020 (r363855) @@ -2001,6 +2001,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, return; out_unlock_free: cache_enter_unlock(&cel); + atomic_add_long(&numcache, -1); cache_free(ncp); return; } From owner-svn-src-head@freebsd.org Tue Aug 4 19:54: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 C6EC537DC90; Tue, 4 Aug 2020 19:54:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlnb4yFsz3Xr9; Tue, 4 Aug 2020 19:54:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D4E4A7D3; Tue, 4 Aug 2020 19:54:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074JsBg3009764; Tue, 4 Aug 2020 19:54:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JsBEP009762; Tue, 4 Aug 2020 19:54:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041954.074JsBEP009762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363856 - 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: 363856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:54:11 -0000 Author: mjg Date: Tue Aug 4 19:54:10 2020 New Revision: 363856 URL: https://svnweb.freebsd.org/changeset/base/363856 Log: vfs: add vfs_op_thread_enter/exit _crit variants and employ them in the namecache. Eliminates all spurious checks for preemption. Modified: head/sys/kern/vfs_cache.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:52:52 2020 (r363855) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:54:10 2020 (r363856) @@ -3484,29 +3484,29 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) prev_mp = NULL; for (;;) { - if (!vfs_op_thread_enter(mp)) { + if (!vfs_op_thread_enter_crit(mp)) { if (prev_mp != NULL) - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); return (cache_fpl_partial(fpl)); } if (prev_mp != NULL) - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); if (!vn_seqc_consistent(vp, vp_seqc)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } if (!cache_fplookup_mp_supported(mp)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } vp = atomic_load_ptr(&mp->mnt_rootvnode); if (vp == NULL || VN_IS_DOOMED(vp)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } vp_seqc = vn_seqc_read_any(vp); if (seqc_in_modify(vp_seqc)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } prev_mp = mp; @@ -3515,7 +3515,7 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) break; } - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); fpl->tvp = vp; fpl->tvp_seqc = vp_seqc; return (0); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Aug 4 19:52:52 2020 (r363855) +++ head/sys/sys/mount.h Tue Aug 4 19:54:10 2020 (r363856) @@ -1023,23 +1023,36 @@ int vfs_mount_fetch_counter(struct mount *, enum mount *zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ }) -#define vfs_op_thread_enter(mp) ({ \ - bool _retval = true; \ - critical_enter(); \ +#define vfs_op_thread_enter_crit(mp) ({ \ + bool _retval_crit = true; \ + MPASS(curthread->td_critnest > 0); \ MPASS(!vfs_op_thread_entered(mp)); \ zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 1); \ __compiler_membar(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ - vfs_op_thread_exit(mp); \ - _retval = false; \ + vfs_op_thread_exit_crit(mp); \ + _retval_crit = false; \ } \ + _retval_crit; \ +}) + +#define vfs_op_thread_enter(mp) ({ \ + bool _retval; \ + critical_enter(); \ + _retval = vfs_op_thread_enter_crit(mp); \ + if (__predict_false(!_retval)) \ + critical_exit(); \ _retval; \ }) -#define vfs_op_thread_exit(mp) do { \ +#define vfs_op_thread_exit_crit(mp) do { \ MPASS(vfs_op_thread_entered(mp)); \ __compiler_membar(); \ zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 0); \ +} while (0) + +#define vfs_op_thread_exit(mp) do { \ + vfs_op_thread_exit_crit(mp); \ critical_exit(); \ } while (0) From owner-svn-src-head@freebsd.org Tue Aug 4 19:54: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 965FF37DD1B; Tue, 4 Aug 2020 19:54:38 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlp63Tt6z3Y2Q; Tue, 4 Aug 2020 19:54:38 +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 5A8C4AC86; Tue, 4 Aug 2020 19:54:38 +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 074JsccW009831; Tue, 4 Aug 2020 19:54:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JscfS009830; Tue, 4 Aug 2020 19:54:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041954.074JscfS009830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363857 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:54:38 -0000 Author: mjg Date: Tue Aug 4 19:54:37 2020 New Revision: 363857 URL: https://svnweb.freebsd.org/changeset/base/363857 Log: cache: factor away lockless dot lookup and add missing stat + sdt probe Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:54:10 2020 (r363856) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:54:37 2020 (r363857) @@ -3356,6 +3356,25 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_child(fpl, tvs)); } +static int __noinline +cache_fplookup_dot(struct cache_fpl *fpl) +{ + struct vnode *dvp; + + dvp = fpl->dvp; + + fpl->tvp = dvp; + fpl->tvp_seqc = vn_seqc_read_any(dvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + + counter_u64_add(dothits, 1); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", dvp); + + return (0); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { @@ -3371,12 +3390,7 @@ cache_fplookup_next(struct cache_fpl *fpl) dvp = fpl->dvp; if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')) { - fpl->tvp = dvp; - fpl->tvp_seqc = vn_seqc_read_any(dvp); - if (seqc_in_modify(fpl->tvp_seqc)) { - return (cache_fpl_aborted(fpl)); - } - return (0); + return (cache_fplookup_dot(fpl)); } hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); From owner-svn-src-head@freebsd.org Tue Aug 4 19:55:01 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 3FBEF37D948; Tue, 4 Aug 2020 19:55:01 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlpY0rS6z3Y3B; Tue, 4 Aug 2020 19:55:01 +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 DA75EAD02; Tue, 4 Aug 2020 19:55:00 +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 074Jt0Co009932; Tue, 4 Aug 2020 19:55:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Jt0tD009931; Tue, 4 Aug 2020 19:55:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041955.074Jt0tD009931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363858 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:55:01 -0000 Author: mjg Date: Tue Aug 4 19:55:00 2020 New Revision: 363858 URL: https://svnweb.freebsd.org/changeset/base/363858 Log: cache: assorted tidy ups Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:54:37 2020 (r363857) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:55:00 2020 (r363858) @@ -1513,7 +1513,7 @@ success: } vs = vget_prep_smr(*vpp); vfs_smr_exit(); - if (vs == VGET_NONE) { + if (__predict_false(vs == VGET_NONE)) { *vpp = NULL; goto retry; } @@ -3199,7 +3199,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) dvp_seqc = fpl->dvp_seqc; dvs = vget_prep_smr(dvp); - if (dvs == VGET_NONE) { + if (__predict_false(dvs == VGET_NONE)) { cache_fpl_smr_exit(fpl); return (cache_fpl_aborted(fpl)); } @@ -3220,6 +3220,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) } fpl->ndp->ni_startdir = dvp; + return (0); } @@ -3258,8 +3259,8 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum static int __noinline cache_fplookup_final_withparent(struct cache_fpl *fpl) { - enum vgetstate dvs, tvs; struct componentname *cnp; + enum vgetstate dvs, tvs; struct vnode *dvp, *tvp; seqc_t dvp_seqc, tvp_seqc; int error; @@ -3276,11 +3277,11 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) * This is less efficient than it can be for simplicity. */ dvs = vget_prep_smr(dvp); - if (dvs == VGET_NONE) { + if (__predict_false(dvs == VGET_NONE)) { return (cache_fpl_aborted(fpl)); } tvs = vget_prep_smr(tvp); - if (tvs == VGET_NONE) { + if (__predict_false(tvs == VGET_NONE)) { cache_fpl_smr_exit(fpl); vget_abort(dvp, dvs); return (cache_fpl_aborted(fpl)); @@ -3342,7 +3343,7 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_withparent(fpl)); tvs = vget_prep_smr(tvp); - if (tvs == VGET_NONE) { + if (__predict_false(tvs == VGET_NONE)) { return (cache_fpl_partial(fpl)); } @@ -3586,7 +3587,7 @@ cache_fplookup_parse(struct cache_fpl *fpl) for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++) continue; cnp->cn_namelen = cp - cnp->cn_nameptr; - if (cnp->cn_namelen > NAME_MAX) { + if (__predict_false(cnp->cn_namelen > NAME_MAX)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled(fpl, ENAMETOOLONG)); } @@ -3779,6 +3780,7 @@ out: cache_fpl_smr_exit(fpl); return (CACHE_FPL_FAILED); case CACHE_FPL_STATUS_HANDLED: + MPASS(error != CACHE_FPL_FAILED); cache_fpl_smr_assert_not_entered(fpl); if (__predict_false(error != 0)) { ndp->ni_dvp = NULL; From owner-svn-src-head@freebsd.org Tue Aug 4 19:55: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 089A537DE32; Tue, 4 Aug 2020 19:55: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlq26XTzz3YMl; Tue, 4 Aug 2020 19:55: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 C4C42A7D5; Tue, 4 Aug 2020 19:55: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 074JtQlD009999; Tue, 4 Aug 2020 19:55:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JtQkk009998; Tue, 4 Aug 2020 19:55:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041955.074JtQkk009998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363859 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 19:55:27 -0000 Author: mjg Date: Tue Aug 4 19:55:26 2020 New Revision: 363859 URL: https://svnweb.freebsd.org/changeset/base/363859 Log: cache: factor away failed vexec handling Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:55:00 2020 (r363858) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:55:26 2020 (r363859) @@ -3668,6 +3668,33 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) } } +static int __noinline +cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) +{ + + switch (error) { + case EAGAIN: + /* + * Can happen when racing against vgone. + * */ + case EOPNOTSUPP: + cache_fpl_partial(fpl); + break; + default: + /* + * See the API contract for VOP_FPLOOKUP_VEXEC. + */ + if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + error = cache_fpl_aborted(fpl); + } else { + cache_fpl_smr_exit(fpl); + cache_fpl_handled(fpl, error); + } + break; + } + return (error); +} + static int cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) { @@ -3715,23 +3742,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred, cnp->cn_thread); if (__predict_false(error != 0)) { - switch (error) { - case EAGAIN: - case EOPNOTSUPP: /* can happen when racing against vgone */ - cache_fpl_partial(fpl); - break; - default: - /* - * See the API contract for VOP_FPLOOKUP_VEXEC. - */ - if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { - error = cache_fpl_aborted(fpl); - } else { - cache_fpl_smr_exit(fpl); - cache_fpl_handled(fpl, error); - } - break; - } + error = cache_fplookup_failed_vexec(fpl, error); break; } From owner-svn-src-head@freebsd.org Tue Aug 4 20:00: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 CB8BF37DCEB; Tue, 4 Aug 2020 20:00:21 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlwj53mgz3YTZ; Tue, 4 Aug 2020 20:00:21 +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 911D9AA22; Tue, 4 Aug 2020 20:00:21 +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 074K0LRw010323; Tue, 4 Aug 2020 20:00:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K0L43010322; Tue, 4 Aug 2020 20:00:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042000.074K0L43010322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363860 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:00:21 -0000 Author: manu Date: Tue Aug 4 20:00:21 2020 New Revision: 363860 URL: https://svnweb.freebsd.org/changeset/base/363860 Log: mmccam: mmc_xpt: We're only interested about losing the device Remove all the uneeded printfs Reviewed by: imp, kibab Differential Revision: https://reviews.freebsd.org/D25948 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 19:55:26 2020 (r363859) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:00:21 2020 (r363860) @@ -199,11 +199,6 @@ mmc_dev_async(u_int32_t async_code, struct cam_eb *bus struct cam_ed *device, void *async_arg) { - printf("mmc_dev_async(async_code=0x%x, path_id=%d, target_id=%x, lun_id=%" SCNx64 "\n", - async_code, - bus->path_id, - target->target_id, - device->lun_id); /* * We only need to handle events for real devices. */ @@ -211,24 +206,11 @@ mmc_dev_async(u_int32_t async_code, struct cam_eb *bus || device->lun_id == CAM_LUN_WILDCARD) return; - if (async_code == AC_LOST_DEVICE) { - if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { - printf("AC_LOST_DEVICE -> set to unconfigured\n"); - device->flags |= CAM_DEV_UNCONFIGURED; - xpt_release_device(device); - } else { - printf("AC_LOST_DEVICE on unconfigured device\n"); - } - } else if (async_code == AC_FOUND_DEVICE) { - printf("Got AC_FOUND_DEVICE -- whatever...\n"); - } else if (async_code == AC_PATH_REGISTERED) { - printf("Got AC_PATH_REGISTERED -- whatever...\n"); - } else if (async_code == AC_PATH_DEREGISTERED ) { - printf("Got AC_PATH_DEREGISTERED -- whatever...\n"); - } else if (async_code == AC_UNIT_ATTENTION) { - printf("Got interrupt generated by the card and ignored it\n"); - } else - panic("Unknown async code\n"); + if (async_code == AC_LOST_DEVICE && + (device->flags & CAM_DEV_UNCONFIGURED) == 0) { + device->flags |= CAM_DEV_UNCONFIGURED; + xpt_release_device(device); + } } /* Taken from nvme_scan_lun, thanks to bsdimp@ */ From owner-svn-src-head@freebsd.org Tue Aug 4 20:02: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 2417E37E118; Tue, 4 Aug 2020 20:02:24 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlz40DY2z3Z1R; Tue, 4 Aug 2020 20:02:24 +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 C892DAB3A; Tue, 4 Aug 2020 20:02: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 074K2NUD016075; Tue, 4 Aug 2020 20:02:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K2NOu016073; Tue, 4 Aug 2020 20:02:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042002.074K2NOu016073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363861 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:02:24 -0000 Author: manu Date: Tue Aug 4 20:02:23 2020 New Revision: 363861 URL: https://svnweb.freebsd.org/changeset/base/363861 Log: mmcam: Use a static length sbuf buffer We cannot sleep during cam proto_announce and sbuf sleeps so use a static length buffer like nvme(4) Reviewed by: kibab Differential Revision: https://reviews.freebsd.org/D25949 Modified: head/sys/cam/mmc/mmc_all.h head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_all.h ============================================================================== --- head/sys/cam/mmc/mmc_all.h Tue Aug 4 20:00:21 2020 (r363860) +++ head/sys/cam/mmc/mmc_all.h Tue Aug 4 20:02:23 2020 (r363861) @@ -68,7 +68,6 @@ #include #include -void mmc_print_ident(struct mmc_params *ident_data); struct ccb_pathinq; struct cam_sim; void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:00:21 2020 (r363860) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:02:23 2020 (r363861) @@ -411,13 +411,11 @@ mmccam_start_discovery(struct cam_sim *sim) { } /* This func is called per attached device :-( */ -void -mmc_print_ident(struct mmc_params *ident_data) +static void +mmc_print_ident(struct mmc_params *ident_data, struct sbuf *sb) { - struct sbuf *sb; bool space = false; - sb = sbuf_new_auto(); sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca); sbuf_printf(sb, "Card features: <"); if (ident_data->card_features & CARD_FEATURE_MMC) { @@ -463,13 +461,20 @@ mmc_print_ident(struct mmc_params *ident_data) static void mmc_proto_announce(struct cam_ed *device) { - mmc_print_ident(&device->mmc_ident_data); + struct sbuf sb; + char buffer[256]; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + mmc_print_ident(&device->mmc_ident_data, &sb); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void mmc_proto_denounce(struct cam_ed *device) { - mmc_print_ident(&device->mmc_ident_data); + + mmc_proto_announce(device); } static void From owner-svn-src-head@freebsd.org Tue Aug 4 20:04: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 DF7D337DF5E; Tue, 4 Aug 2020 20:04:00 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLm0w5ZkXz3Z98; Tue, 4 Aug 2020 20:04:00 +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 A2AD7AE1B; Tue, 4 Aug 2020 20:04:00 +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 074K40Om016194; Tue, 4 Aug 2020 20:04:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K40ls016193; Tue, 4 Aug 2020 20:04:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042004.074K40ls016193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363862 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:04:00 -0000 Author: manu Date: Tue Aug 4 20:04:00 2020 New Revision: 363862 URL: https://svnweb.freebsd.org/changeset/base/363862 Log: mmccam: Hold the periph during init We need to sleep during this routine so acquire the cam hold too. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D25946 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:02:23 2020 (r363861) +++ head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:04:00 2020 (r363862) @@ -1109,7 +1109,9 @@ sdda_start_init_task(void *context, int pending) { CAM_PRIORITY_NONE); cam_periph_lock(periph); + cam_periph_hold(periph, PRIBIO|PCATCH); sdda_start_init(context, new_ccb); + cam_periph_unhold(periph); cam_periph_unlock(periph); xpt_free_ccb(new_ccb); } From owner-svn-src-head@freebsd.org Tue Aug 4 20:31: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 CF84237E66C; Tue, 4 Aug 2020 20:31:03 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLmc75F7Hz3b12; Tue, 4 Aug 2020 20:31:03 +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 98EDAB197; Tue, 4 Aug 2020 20:31:03 +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 074KV37b029582; Tue, 4 Aug 2020 20:31:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074KV3kW029581; Tue, 4 Aug 2020 20:31:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042031.074KV3kW029581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 20:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363863 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:31:03 -0000 Author: mjg Date: Tue Aug 4 20:31:03 2020 New Revision: 363863 URL: https://svnweb.freebsd.org/changeset/base/363863 Log: rms: fix typo: bitmamp -> bitmap Reported by: kib Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Aug 4 20:04:00 2020 (r363862) +++ head/sys/kern/kern_rmlock.c Tue Aug 4 20:31:03 2020 (r363863) @@ -875,7 +875,7 @@ db_show_rm(const struct lock_object *lock) * * No attempt is made to track which CPUs read locked at least once, * consequently write locking sends IPIs to all of them. This will become a - * problem at some point. The easiest way to lessen it is to provide a bitmamp. + * problem at some point. The easiest way to lessen it is to provide a bitmap. */ void From owner-svn-src-head@freebsd.org Tue Aug 4 20:51: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 066E637EDC4; Tue, 4 Aug 2020 20:51:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLn3G6Jmjz3cBG; Tue, 4 Aug 2020 20:51:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A373BB60D; Tue, 4 Aug 2020 20:51:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074Kp6kL041364; Tue, 4 Aug 2020 20:51:06 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Kp5Sw041359; Tue, 4 Aug 2020 20:51:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008042051.074Kp5Sw041359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Aug 2020 20:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363864 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 363864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:51:07 -0000 Author: br Date: Tue Aug 4 20:51:05 2020 New Revision: 363864 URL: https://svnweb.freebsd.org/changeset/base/363864 Log: Add a few macroses for conversion between DMAR unit, domain, ctx and IOMMU unit, domain, ctx. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D25926 Modified: head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_quirks.c Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_ctx.c Tue Aug 4 20:51:05 2020 (r363864) @@ -117,7 +117,7 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, struct sf_buf struct dmar_unit *dmar; dmar_ctx_entry_t *ctxp; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + dmar = CTX2DMAR(ctx); ctxp = dmar_map_pgtbl(dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), IOMMU_PGF_NOALLOC | IOMMU_PGF_WAITOK, sfp); @@ -131,7 +131,7 @@ device_tag_init(struct dmar_ctx *ctx, device_t dev) struct dmar_domain *domain; bus_addr_t maxaddr; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); maxaddr = MIN(domain->iodom.end, BUS_SPACE_MAXADDR); ctx->context.tag->common.ref_count = 1; /* Prevent free */ ctx->context.tag->common.impl = &bus_dma_iommu_impl; @@ -141,7 +141,7 @@ device_tag_init(struct dmar_ctx *ctx, device_t dev) ctx->context.tag->common.maxsize = maxaddr; ctx->context.tag->common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->context.tag->common.maxsegsz = maxaddr; - ctx->context.tag->ctx = (struct iommu_ctx *)ctx; + ctx->context.tag->ctx = CTX2IOCTX(ctx); ctx->context.tag->owner = dev; } @@ -178,8 +178,8 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry vm_page_t ctx_root; int i; - domain = (struct dmar_domain *)ctx->context.domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + domain = CTX2DOM(ctx); + unit = DOM2DMAR(domain); KASSERT(move || (ctxp->ctx1 == 0 && ctxp->ctx2 == 0), ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", unit->iommu.unit, busno, pci_get_slot(ctx->context.tag->owner), @@ -196,7 +196,7 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry IOMMU_PGF_NOALLOC); } - if (iommu_is_buswide_ctx((struct iommu_unit *)unit, busno)) { + if (iommu_is_buswide_ctx(DMAR2IOMMU(unit), busno)) { MPASS(!move); for (i = 0; i <= PCI_BUSMAX; i++) { ctx_id_entry_init_one(&ctxp[i], domain, ctx_root); @@ -283,8 +283,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, VM_MEMATTR_DEFAULT); } - error1 = iommu_gas_map_region((struct iommu_domain *)domain, - entry, + error1 = iommu_gas_map_region(DOM2IODOM(domain), entry, IOMMU_MAP_ENTRY_READ | IOMMU_MAP_ENTRY_WRITE, IOMMU_MF_CANWAIT | IOMMU_MF_RMRR, ma); /* @@ -310,8 +309,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t error = error1; } TAILQ_REMOVE(&rmrr_entries, entry, unroll_link); - iommu_gas_free_entry((struct iommu_domain *)domain, - entry); + iommu_gas_free_entry(DOM2IODOM(domain), entry); } for (i = 0; i < size; i++) vm_page_putfake(ma[i]); @@ -331,7 +329,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp if (id == -1) return (NULL); domain = malloc(sizeof(*domain), M_DMAR_DOMAIN, M_WAITOK | M_ZERO); - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); domain->domain = id; LIST_INIT(&domain->contexts); RB_INIT(&domain->iodom.rb_root); @@ -358,7 +356,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp /* Use all supported address space for remapping. */ domain->iodom.end = 1ULL << (domain->agaw - 1); - iommu_gas_init_domain((struct iommu_domain *)domain); + iommu_gas_init_domain(DOM2IODOM(domain)); if (id_mapped) { if ((dmar->hw_ecap & DMAR_ECAP_PT) == 0) { @@ -389,7 +387,7 @@ dmar_ctx_alloc(struct dmar_domain *domain, uint16_t ri struct dmar_ctx *ctx; ctx = malloc(sizeof(*ctx), M_DMAR_CTX, M_WAITOK | M_ZERO); - ctx->context.domain = (struct iommu_domain *)domain; + ctx->context.domain = DOM2IODOM(domain); ctx->context.tag = malloc(sizeof(struct bus_dma_tag_iommu), M_DMAR_CTX, M_WAITOK | M_ZERO); ctx->rid = rid; @@ -402,7 +400,7 @@ dmar_ctx_link(struct dmar_ctx *ctx) { struct dmar_domain *domain; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); IOMMU_ASSERT_LOCKED(domain->iodom.iommu); KASSERT(domain->refs >= domain->ctx_cnt, ("dom %p ref underflow %d %d", domain, domain->refs, @@ -417,7 +415,7 @@ dmar_ctx_unlink(struct dmar_ctx *ctx) { struct dmar_domain *domain; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); IOMMU_ASSERT_LOCKED(domain->iodom.iommu); KASSERT(domain->refs > 0, ("domain %p ctx dtr refs %d", domain, domain->refs)); @@ -444,7 +442,7 @@ dmar_domain_destroy(struct dmar_domain *domain) ("destroying dom %p with refs %d", domain, domain->refs)); if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) { DMAR_DOMAIN_LOCK(domain); - iommu_gas_fini_domain((struct iommu_domain *)domain); + iommu_gas_fini_domain(DOM2IODOM(domain)); DMAR_DOMAIN_UNLOCK(domain); } if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { @@ -453,7 +451,7 @@ dmar_domain_destroy(struct dmar_domain *domain) domain_free_pgtbl(domain); } mtx_destroy(&domain->iodom.lock); - dmar = (struct dmar_unit *)domain->iodom.iommu; + dmar = DOM2DMAR(domain); free_unr(dmar->domids, domain->domain); free(domain, M_DMAR_DOMAIN); } @@ -482,7 +480,7 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t } enable = false; TD_PREP_PINNED_ASSERT; - unit = (struct iommu_unit *)dmar; + unit = DMAR2IOMMU(dmar); DMAR_LOCK(dmar); KASSERT(!iommu_is_buswide_ctx(unit, bus) || (slot == 0 && func == 0), ("iommu%d pci%d:%d:%d get_ctx for buswide", dmar->iommu.unit, bus, @@ -550,11 +548,11 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dmar_domain_destroy(domain1); /* Nothing needs to be done to destroy ctx1. */ free(ctx1, M_DMAR_CTX); - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); ctx->refs++; /* tag referenced us */ } } else { - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); if (ctx->context.tag->owner == NULL) ctx->context.tag->owner = dev; ctx->refs++; /* tag referenced us */ @@ -627,7 +625,7 @@ dmar_move_ctx_to_domain(struct dmar_domain *domain, st int error; dmar = domain->dmar; - old_domain = (struct dmar_domain *)ctx->context.domain; + old_domain = CTX2DOM(ctx); if (domain == old_domain) return (0); KASSERT(old_domain->iodom.iommu == domain->iodom.iommu, @@ -748,7 +746,7 @@ dmar_free_ctx_locked(struct dmar_unit *dmar, struct dm dmar_inv_iotlb_glob(dmar); } dmar_unmap_pgtbl(sf); - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); dmar_ctx_unlink(ctx); free(ctx->context.tag, M_DMAR_CTX); free(ctx, M_DMAR_CTX); @@ -761,7 +759,7 @@ dmar_free_ctx(struct dmar_ctx *ctx) { struct dmar_unit *dmar; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + dmar = CTX2DMAR(ctx); DMAR_LOCK(dmar); dmar_free_ctx_locked(dmar, ctx); } @@ -810,11 +808,11 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry struct dmar_domain *domain; struct dmar_unit *unit; - domain = (struct dmar_domain *)entry->domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + domain = IODOM2DOM(entry->domain); + unit = DOM2DMAR(domain); if (unit->qi_enabled) { DMAR_LOCK(unit); - dmar_qi_invalidate_locked((struct dmar_domain *)entry->domain, + dmar_qi_invalidate_locked(IODOM2DOM(entry->domain), entry->start, entry->end - entry->start, &entry->gseq, true); if (!free) @@ -822,7 +820,7 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); DMAR_UNLOCK(unit); } else { - domain_flush_iotlb_sync((struct dmar_domain *)entry->domain, + domain_flush_iotlb_sync(IODOM2DOM(entry->domain), entry->start, entry->end - entry->start); dmar_domain_free_entry(entry, free); } @@ -847,8 +845,8 @@ dmar_domain_unload(struct dmar_domain *domain, struct iommu_map_entry *entry, *entry1; int error; - iodom = (struct iommu_domain *)domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + iodom = DOM2IODOM(domain); + unit = DOM2DMAR(domain); TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, @@ -904,11 +902,11 @@ iommu_get_ctx(struct iommu_unit *iommu, device_t dev, struct dmar_unit *dmar; struct dmar_ctx *ret; - dmar = (struct dmar_unit *)iommu; + dmar = IOMMU2DMAR(iommu); ret = dmar_get_ctx_for_dev(dmar, dev, rid, id_mapped, rmrr_init); - return ((struct iommu_ctx *)ret); + return (CTX2IOCTX(ret)); } void @@ -917,8 +915,8 @@ iommu_free_ctx_locked(struct iommu_unit *iommu, struct struct dmar_unit *dmar; struct dmar_ctx *ctx; - dmar = (struct dmar_unit *)iommu; - ctx = (struct dmar_ctx *)context; + dmar = IOMMU2DMAR(iommu); + ctx = IOCTX2CTX(context); dmar_free_ctx_locked(dmar, ctx); } @@ -926,11 +924,9 @@ iommu_free_ctx_locked(struct iommu_unit *iommu, struct void iommu_free_ctx(struct iommu_ctx *context) { - struct dmar_unit *dmar; struct dmar_ctx *ctx; - ctx = (struct dmar_ctx *)context; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + ctx = IOCTX2CTX(context); dmar_free_ctx(ctx); } @@ -948,7 +944,7 @@ iommu_domain_unload(struct iommu_domain *iodom, { struct dmar_domain *domain; - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); dmar_domain_unload(domain, entries, cansleep); } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_dmar.h Tue Aug 4 20:51:05 2020 (r363864) @@ -91,6 +91,22 @@ struct dmar_ctx { #define DMAR_DOMAIN_UNLOCK(dom) mtx_unlock(&(dom)->iodom.lock) #define DMAR_DOMAIN_ASSERT_LOCKED(dom) mtx_assert(&(dom)->iodom.lock, MA_OWNED) +#define DMAR2IOMMU(dmar) &((dmar)->iommu) +#define IOMMU2DMAR(dmar) \ + __containerof((dmar), struct dmar_unit, iommu) + +#define DOM2IODOM(domain) &((domain)->iodom) +#define IODOM2DOM(domain) \ + __containerof((domain), struct dmar_domain, iodom) + +#define CTX2IOCTX(ctx) &((ctx)->context) +#define IOCTX2CTX(ctx) \ + __containerof((ctx), struct dmar_ctx, context) + +#define CTX2DOM(ctx) IODOM2DOM((ctx)->context.domain) +#define CTX2DMAR(ctx) (CTX2DOM(ctx)->dmar) +#define DOM2DMAR(domain) ((domain)->dmar) + struct dmar_msi_data { int irq; int irq_rid; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_drv.c Tue Aug 4 20:51:05 2020 (r363864) @@ -919,8 +919,7 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) match = dmar_match_devscope(devscope, ria->dev_busno, ria->dev_path, ria->dev_path_len); if (match == 1) { - entry = iommu_gas_alloc_entry( - (struct iommu_domain *)ria->domain, + entry = iommu_gas_alloc_entry(DOM2IODOM(ria->domain), IOMMU_PGF_WAITOK); entry->start = resmem->BaseAddress; /* The RMRR entry end address is inclusive. */ @@ -1056,7 +1055,7 @@ dmar_instantiate_rmrr_ctxs(struct iommu_unit *unit) struct inst_rmrr_iter_args iria; int error; - dmar = (struct dmar_unit *)unit; + dmar = IOMMU2DMAR(unit); if (!dmar_barrier_enter(dmar, DMAR_BARRIER_RMRR)) return (0); @@ -1131,7 +1130,7 @@ dmar_print_domain(struct dmar_domain *domain, bool sho struct iommu_map_entry *entry; struct dmar_ctx *ctx; - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); db_printf( " @%p dom %d mgaw %d agaw %d pglvl %d end %jx refs %d\n" Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_idpgtbl.c Tue Aug 4 20:51:05 2020 (r363864) @@ -512,7 +512,7 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr ((eflags & IOMMU_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | ((eflags & IOMMU_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0); - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); unit = domain->dmar; KASSERT((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) == 0, @@ -691,7 +691,7 @@ domain_unmap_buf(struct iommu_domain *iodom, iommu_gad struct dmar_domain *domain; int error; - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); DMAR_DOMAIN_PGLOCK(domain); error = domain_unmap_buf_locked(domain, base, size, flags); @@ -823,6 +823,6 @@ domain_pgtbl_init(struct dmar_domain *domain) { struct iommu_domain *iodom; - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); iodom->ops = &dmar_domain_map_ops; } Modified: head/sys/x86/iommu/intel_quirks.c ============================================================================== --- head/sys/x86/iommu/intel_quirks.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_quirks.c Tue Aug 4 20:51:05 2020 (r363864) @@ -226,7 +226,7 @@ dmar_quirks_pre_use(struct iommu_unit *unit) { struct dmar_unit *dmar; - dmar = (struct dmar_unit *)unit; + dmar = IOMMU2DMAR(unit); if (!dmar_barrier_enter(dmar, DMAR_BARRIER_USEQ)) return; From owner-svn-src-head@freebsd.org Tue Aug 4 20:54: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 1C55637F21E; Tue, 4 Aug 2020 20:54:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLn6r62pMz3cJM; Tue, 4 Aug 2020 20:54:12 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2A64B371; Tue, 4 Aug 2020 20:54:12 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074KsC2I047094; Tue, 4 Aug 2020 20:54:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074KsCLL047093; Tue, 4 Aug 2020 20:54:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008042054.074KsCLL047093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Aug 2020 20:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363865 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 363865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 20:54:13 -0000 Author: br Date: Tue Aug 4 20:54:12 2020 New Revision: 363865 URL: https://svnweb.freebsd.org/changeset/base/363865 Log: Remove unneeded cast to struct iommu_domain *. Sponsored by: DARPA, AFRL Modified: head/sys/dev/iommu/iommu_gas.c Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Tue Aug 4 20:51:05 2020 (r363864) +++ head/sys/dev/iommu/iommu_gas.c Tue Aug 4 20:54:12 2020 (r363865) @@ -111,7 +111,7 @@ void iommu_gas_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) { - KASSERT(domain == (struct iommu_domain *)entry->domain, + KASSERT(domain == entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); atomic_subtract_int(&domain->entries_cnt, 1); @@ -174,7 +174,7 @@ iommu_gas_check_free(struct iommu_domain *domain) iommu_gaddr_t v; RB_FOREACH(entry, iommu_gas_entries_tree, &domain->rb_root) { - KASSERT(domain == (struct iommu_domain *)entry->domain, + KASSERT(domain == entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); l = RB_LEFT(entry, rb_entry); From owner-svn-src-head@freebsd.org Tue Aug 4 21:05: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 B33A737F176; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLnNK4HTRz3d40; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 765EFB53F; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074L5rcb053401; Tue, 4 Aug 2020 21:05:53 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074L5rIh053400; Tue, 4 Aug 2020 21:05:53 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008042105.074L5rIh053400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 4 Aug 2020 21:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363866 - head/lib/libdevinfo X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libdevinfo X-SVN-Commit-Revision: 363866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 21:05:53 -0000 Author: vangyzen Date: Tue Aug 4 21:05:53 2020 New Revision: 363866 URL: https://svnweb.freebsd.org/changeset/base/363866 Log: devinfo: fix memory leak on error paths Refactor to create devinfo_free_dev(). Call it to plug a memory leak on two error paths in devinfo_init_devices(). Reported by: Coverity MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdevinfo/devinfo.c Modified: head/lib/libdevinfo/devinfo.c ============================================================================== --- head/lib/libdevinfo/devinfo.c Tue Aug 4 20:54:12 2020 (r363865) +++ head/lib/libdevinfo/devinfo.c Tue Aug 4 21:05:53 2020 (r363866) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); static int devinfo_init_devices(int generation); static int devinfo_init_resources(int generation); +static void devinfo_free_dev(struct devinfo_i_dev *dd); TAILQ_HEAD(,devinfo_i_dev) devinfo_dev; TAILQ_HEAD(,devinfo_i_rman) devinfo_rman; @@ -225,7 +226,7 @@ devinfo_init_devices(int generation) rlen, sizeof(udev)); return (EINVAL); } - if ((dd = malloc(sizeof(*dd))) == NULL) + if ((dd = calloc(1, sizeof(*dd))) == NULL) return(ENOMEM); dd->dd_dev.dd_handle = udev.dv_handle; dd->dd_dev.dd_parent = udev.dv_parent; @@ -242,10 +243,14 @@ devinfo_init_devices(int generation) dd->dd_location = NULL; #define UNPACK(x) \ dd->dd_dev.x = dd->x = strdup(walker); \ - if (dd->x == NULL) \ + if (dd->x == NULL) { \ + devinfo_free_dev(dd); \ return(ENOMEM); \ - if (walker + strnlen(walker, ep - walker) >= ep) \ + } \ + if (walker + strnlen(walker, ep - walker) >= ep) { \ + devinfo_free_dev(dd); \ return(EINVAL); \ + } \ walker += strlen(walker) + 1; UNPACK(dd_name); @@ -365,6 +370,20 @@ devinfo_init_resources(int generation) } /* + * Free an individual dev. + */ +static void +devinfo_free_dev(struct devinfo_i_dev *dd) +{ + free(dd->dd_name); + free(dd->dd_desc); + free(dd->dd_drivername); + free(dd->dd_pnpinfo); + free(dd->dd_location); + free(dd); +} + +/* * Free the list contents. */ void @@ -376,12 +395,7 @@ devinfo_free(void) while ((dd = TAILQ_FIRST(&devinfo_dev)) != NULL) { TAILQ_REMOVE(&devinfo_dev, dd, dd_link); - free(dd->dd_name); - free(dd->dd_desc); - free(dd->dd_drivername); - free(dd->dd_pnpinfo); - free(dd->dd_location); - free(dd); + devinfo_free_dev(dd); } while ((dm = TAILQ_FIRST(&devinfo_rman)) != NULL) { TAILQ_REMOVE(&devinfo_rman, dm, dm_link); From owner-svn-src-head@freebsd.org Tue Aug 4 21:09: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 AF5A437F569; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLnSc4Bbkz3dPm; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7350EB541; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074L9aLu053637; Tue, 4 Aug 2020 21:09:36 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074L9adU053636; Tue, 4 Aug 2020 21:09:36 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008042109.074L9adU053636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 4 Aug 2020 21:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363867 - head/lib/libdevinfo X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libdevinfo X-SVN-Commit-Revision: 363867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 21:09:36 -0000 Author: vangyzen Date: Tue Aug 4 21:09:36 2020 New Revision: 363867 URL: https://svnweb.freebsd.org/changeset/base/363867 Log: devinfo: add man page links Add man page links for all functions in devinfo(3). Reported by: vim MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdevinfo/Makefile Modified: head/lib/libdevinfo/Makefile ============================================================================== --- head/lib/libdevinfo/Makefile Tue Aug 4 21:05:53 2020 (r363866) +++ head/lib/libdevinfo/Makefile Tue Aug 4 21:09:36 2020 (r363867) @@ -5,6 +5,16 @@ SRCS= devinfo.c INCS= devinfo.h MAN= devinfo.3 +MLINKS+=devinfo.3 devinfo_init.3 +MLINKS+=devinfo.3 devinfo_free.3 +MLINKS+=devinfo.3 devinfo_handle_to_device.3 +MLINKS+=devinfo.3 devinfo_handle_to_resource.3 +MLINKS+=devinfo.3 devinfo_handle_to_rman.3 +MLINKS+=devinfo.3 devinfo_foreach_device_child.3 +MLINKS+=devinfo.3 devinfo_foreach_device_resource.3 +MLINKS+=devinfo.3 devinfo_foreach_rman_resource.3 +MLINKS+=devinfo.3 devinfo_foreach_rman.3 + SHLIB_MAJOR= 6 WARNS?= 3 From owner-svn-src-head@freebsd.org Tue Aug 4 21:34: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 B8E1F3A110D; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLp114WT7z3fYs; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E651BB43; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LYDDp071798; Tue, 4 Aug 2020 21:34:13 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074LYDkj071797; Tue, 4 Aug 2020 21:34:13 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <202008042134.074LYDkj071797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 4 Aug 2020 21:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363868 - head/sbin/route/tests X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/sbin/route/tests X-SVN-Commit-Revision: 363868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 21:34:13 -0000 Author: olivier (ports committer) Date: Tue Aug 4 21:34:13 2020 New Revision: 363868 URL: https://svnweb.freebsd.org/changeset/base/363868 Log: Skip sbin/route tests if jail not installed (WITHOUT_JAIL). Approved by: kp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25935 Modified: head/sbin/route/tests/basic.sh Modified: head/sbin/route/tests/basic.sh ============================================================================== --- head/sbin/route/tests/basic.sh Tue Aug 4 21:09:36 2020 (r363867) +++ head/sbin/route/tests/basic.sh Tue Aug 4 21:34:13 2020 (r363868) @@ -34,7 +34,7 @@ basic_v4_head() { atf_set descr 'add/change/delete route test for v4' atf_set require.user root - atf_set require.progs jq + atf_set require.progs jail jq } basic_v4_body() @@ -79,7 +79,7 @@ basic_v6_head() { atf_set descr 'add/change/delete route test for v6' atf_set require.user root - atf_set require.progs jq + atf_set require.progs jail jq } basic_v6_body() From owner-svn-src-head@freebsd.org Tue Aug 4 21:49: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 74AC33A16AC; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLpLL2BzWz3gWD; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EC34BBCF; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LnE4p078306; Tue, 4 Aug 2020 21:49:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074LnESw078305; Tue, 4 Aug 2020 21:49:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008042149.074LnESw078305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 21:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363869 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 363869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 21:49:14 -0000 Author: kevans Date: Tue Aug 4 21:49:13 2020 New Revision: 363869 URL: https://svnweb.freebsd.org/changeset/base/363869 Log: makesyscalls.lua: improve syscall ordering validation There were two separate issues here: 1.) #if/#else wasn't taken into account at all for maxsyscall figures, but 2.) We didn't validate contiguous syscall numbers anyways... This kind of inconsistency is bad as we don't currently ensure explicit indexing of, e.g., the sysent array if one syscall is unimplemented/missing. This could be fixed and might be more robust, but it's also good to have the "documentation" that comes from being explicit as to what the missing syscalls are. The new version looks much like the awk version; stash off the current 'last highest syscall seen' if we hit an #if, restore to that if we hit an #else, and make sure that we're explicitly always defining the next syscall. The logic at the tail end of process_syscall_def that moves maxsyscall has been 'cleaned up' a little since we're now ensuring that it's monotonically increasing earlier in the function. At the moment I think it's unlikely we'd see range-definitions that are not UNIMPL, but there's no reason to specifically handle that case for bumping maxsyscall there. This change was provoked by reading the commit message for r363832 and realizing that this validation hadn't been included in the initial rewrite to lua. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D25945 Modified: head/sys/tools/makesyscalls.lua Modified: head/sys/tools/makesyscalls.lua ============================================================================== --- head/sys/tools/makesyscalls.lua Tue Aug 4 21:34:13 2020 (r363868) +++ head/sys/tools/makesyscalls.lua Tue Aug 4 21:49:13 2020 (r363869) @@ -35,7 +35,8 @@ local lfs = require("lfs") local unistd = require("posix.unistd") -local maxsyscall = 0 +local savesyscall = -1 +local maxsyscall = -1 local generated_tag = "@" .. "generated" -- Default configuration; any of these may get replaced by a configuration file @@ -442,6 +443,11 @@ local pattern_table = { dump_prevline = true, pattern = "^#", process = function(line) + if line:find("^#%s*if") then + savesyscall = maxsyscall + elseif line:find("^#%s*else") then + maxsyscall = savesyscall + end line = line .. "\n" write_line('sysent', line) write_line('sysdcl', line) @@ -916,6 +922,16 @@ process_syscall_def = function(line) sysnum = nil sysstart = tonumber(sysstart) sysend = tonumber(sysend) + if sysstart ~= maxsyscall + 1 then + abort(1, "syscall number out of sync, missing " .. + maxsyscall + 1) + end + else + sysnum = tonumber(sysnum) + if sysnum ~= maxsyscall + 1 then + abort(1, "syscall number out of sync, missing " .. + maxsyscall + 1) + end end -- Split flags @@ -1093,15 +1109,14 @@ process_syscall_def = function(line) handle_obsol(sysnum, funcname, funcomment) elseif flags & known_flags["UNIMPL"] ~= 0 then handle_unimpl(sysnum, sysstart, sysend, funcomment) - if sysend ~= nil and sysend > maxsyscall then - maxsyscall = sysend - end else abort(1, "Bad flags? " .. line) end - if sysnum ~= nil and tonumber(sysnum) > maxsyscall then - maxsyscall = tonumber(sysnum) + if sysend ~= nil then + maxsyscall = sysend + elseif sysnum ~= nil then + maxsyscall = sysnum end end From owner-svn-src-head@freebsd.org Tue Aug 4 21:58: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 CF01A3A1BBE; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLpYH4zRPz3gh0; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A924C04C; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LwhZd084278; Tue, 4 Aug 2020 21:58:43 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Lwhqm084277; Tue, 4 Aug 2020 21:58:43 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <202008042158.074Lwhqm084277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 4 Aug 2020 21:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363870 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 21:58:43 -0000 Author: kibab Date: Tue Aug 4 21:58:43 2020 New Revision: 363870 URL: https://svnweb.freebsd.org/changeset/base/363870 Log: Minor cleanups in mmc_xpt.c * Downgrade some CAM debug messages from _INFO to _DEBUG level; * Add KASSERT for the case when we suspect incorrect CAM SIM initialization (using cam_sim_alloc() instead of cam_sim_alloc_dev()); * Use waiting version of xpt_alloc_ccb(), we are not in hurry; * With the waiting version we cannot get NULL return, so remove the NULL check; * In some csses, the name of mmcprobe_done has been written as mmc_probedone(); * Send AC_LOST_DEVICE if we, well, lost the device; * Misc style(9) fixes. Reviewed by: manu Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D25843 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 21:49:13 2020 (r363869) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 21:58:43 2020 (r363870) @@ -374,8 +374,7 @@ mmc_announce_periph(struct cam_periph *periph) cam_periph_assert(periph, MA_OWNED); - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("mmc_announce_periph: called\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmc_announce_periph")); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -388,15 +387,15 @@ mmc_announce_periph(struct cam_periph *periph) } void -mmccam_start_discovery(struct cam_sim *sim) { +mmccam_start_discovery(struct cam_sim *sim) +{ union ccb *ccb; uint32_t pathid; + KASSERT(sim->sim_dev != NULL, ("mmccam_start_discovery(%s): sim_dev is not initialized," + " has cam_sim_alloc_dev() been used?", cam_sim_name(sim))); pathid = cam_sim_path(sim); - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - return; - } + ccb = xpt_alloc_ccb(); /* * We create a rescan request for BUS:0:0, since the card @@ -806,7 +805,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do struct ccb_mmcio *mmcio; u_int32_t priority; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_done\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mmcprobe_done\n")); softc = (mmcprobe_softc *)periph->softc; path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; @@ -827,6 +826,9 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do /* There was a device there, but now it's gone... */ if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Device lost!\n")); + xpt_async(AC_LOST_DEVICE, path, NULL); } PROBE_SET_ACTION(softc, PROBE_INVALID); @@ -896,7 +898,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do ("SDIO card: %d functions\n", mmcp->sdio_func_count)); if (io_ocr == 0) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR invalid?!\n")); + ("SDIO OCR invalid, retrying\n")); break; /* Retry */ } @@ -1120,22 +1122,21 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do } default: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("mmc_probedone: invalid action state 0x%x\n", softc->action)); + ("mmcprobe_done: invalid action state 0x%x\n", softc->action)); panic("default: case in mmc_probe_done()"); } - if (softc->action == PROBE_INVALID && - (path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("mmc_probedone: Should send AC_LOST_DEVICE but won't for now\n")); - //xpt_async(AC_LOST_DEVICE, path, NULL); - } + if (softc->action == PROBE_INVALID && + (path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + xpt_async(AC_LOST_DEVICE, path, NULL); + } - if (softc->action != PROBE_INVALID) - xpt_schedule(periph, priority); + if (softc->action != PROBE_INVALID) + xpt_schedule(periph, priority); /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ int frozen = cam_release_devq(path, 0, 0, 0, FALSE); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmc_probedone: remaining freezecnt %d\n", frozen)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("mmcprobe_done: remaining freeze count %d\n", frozen)); if (softc->action == PROBE_DONE) { /* Notify the system that the device is found! */ @@ -1148,10 +1149,10 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do } } xpt_release_ccb(done_ccb); - if (softc->action == PROBE_DONE || softc->action == PROBE_INVALID) { - cam_periph_invalidate(periph); - cam_periph_release_locked(periph); - } + if (softc->action == PROBE_DONE || softc->action == PROBE_INVALID) { + cam_periph_invalidate(periph); + cam_periph_release_locked(periph); + } } void From owner-svn-src-head@freebsd.org Tue Aug 4 23:00:01 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 1A0093A29DD; Tue, 4 Aug 2020 23:00:01 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLqw06q9zz411c; Tue, 4 Aug 2020 23:00:00 +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 CE82BCAFC; Tue, 4 Aug 2020 23:00:00 +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 074N00nd021198; Tue, 4 Aug 2020 23:00:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N00Do021197; Tue, 4 Aug 2020 23:00:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042300.074N00Do021197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363871 - 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: 363871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 23:00:01 -0000 Author: mjg Date: Tue Aug 4 23:00:00 2020 New Revision: 363871 URL: https://svnweb.freebsd.org/changeset/base/363871 Log: mtx: add mtx_wait_unlocked Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Aug 4 21:58:43 2020 (r363870) +++ head/sys/kern/kern_mutex.c Tue Aug 4 23:00:00 2020 (r363871) @@ -1275,6 +1275,35 @@ mtx_spin_wait_unlocked(struct mtx *m) } } +void +mtx_wait_unlocked(struct mtx *m) +{ + struct thread *owner; + uintptr_t v; + + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("%s() of destroyed mutex %p", __func__, m)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep, + ("%s() not a sleep mutex %p (%s)", __func__, m, + m->lock_object.lo_name)); + KASSERT(!mtx_owned(m), ("%s() waiting on myself on lock %p (%s)", __func__, m, + m->lock_object.lo_name)); + + for (;;) { + v = atomic_load_acq_ptr(&m->mtx_lock); + if (v == MTX_UNOWNED) { + break; + } + owner = lv_mtx_owner(v); + if (!TD_IS_RUNNING(owner)) { + mtx_lock(m); + mtx_unlock(m); + break; + } + cpu_spinwait(); + } +} + #ifdef DDB void db_show_mtx(const struct lock_object *lock) Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Tue Aug 4 21:58:43 2020 (r363870) +++ head/sys/sys/mutex.h Tue Aug 4 23:00:00 2020 (r363871) @@ -106,6 +106,7 @@ void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v); void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v); #endif +void mtx_wait_unlocked(struct mtx *m); #ifdef SMP #if LOCK_DEBUG > 0 From owner-svn-src-head@freebsd.org Tue Aug 4 23:04: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 C90C73A2FAD; Tue, 4 Aug 2020 23:04: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr1B4xhvz41D0; Tue, 4 Aug 2020 23:04: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 8DE9DCB50; Tue, 4 Aug 2020 23:04: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 074N4Upm026726; Tue, 4 Aug 2020 23:04:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N4UN0026724; Tue, 4 Aug 2020 23:04:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042304.074N4UN0026724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363872 - 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: 363872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 23:04:30 -0000 Author: mjg Date: Tue Aug 4 23:04:29 2020 New Revision: 363872 URL: https://svnweb.freebsd.org/changeset/base/363872 Log: cache: add cache_purge_vgone cache_purge locklessly checks whether the vnode at hand has any namecache entries. This can race with a concurrent purge which managed to remove the last entry, but may not be done touching the vnode. Make sure we observe the relevant vnode lock as not taken before proceeding with vgone. Paired with the fact that doomed vnodes cannnot receive entries this restores the invariant that there are no namecache-related writing users past cache_purge in vgone. Reported by: pho Modified: head/sys/kern/vfs_cache.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 Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:04:29 2020 (r363872) @@ -2138,22 +2138,17 @@ cache_changesize(u_long newmaxvnodes) /* * Invalidate all entries from and to a particular vnode. */ -void -cache_purge(struct vnode *vp) +static void +cache_purge_impl(struct vnode *vp) { TAILQ_HEAD(, namecache) ncps; struct namecache *ncp, *nnp; struct mtx *vlp, *vlp2; - CTR1(KTR_VFS, "cache_purge(%p)", vp); - SDT_PROBE1(vfs, namecache, purge, done, vp); - if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL) - return; TAILQ_INIT(&ncps); vlp = VP2VNODELOCK(vp); vlp2 = NULL; - mtx_lock(vlp); + mtx_assert(vlp, MA_OWNED); retry: while (!LIST_EMPTY(&vp->v_cache_src)) { ncp = LIST_FIRST(&vp->v_cache_src); @@ -2182,6 +2177,53 @@ retry: TAILQ_FOREACH_SAFE(ncp, &ncps, nc_dst, nnp) { cache_free(ncp); } +} + +void +cache_purge(struct vnode *vp) +{ + struct mtx *vlp; + + SDT_PROBE1(vfs, namecache, purge, done, vp); + if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL) + return; + vlp = VP2VNODELOCK(vp); + mtx_lock(vlp); + cache_purge_impl(vp); +} + +/* + * Only to be used by vgone. + */ +void +cache_purge_vgone(struct vnode *vp) +{ + struct mtx *vlp; + + VNPASS(VN_IS_DOOMED(vp), vp); + vlp = VP2VNODELOCK(vp); + if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL)) { + mtx_lock(vlp); + cache_purge_impl(vp); + mtx_assert(vlp, MA_NOTOWNED); + return; + } + + /* + * All the NULL pointer state we found above may be transient. + * Serialize against a possible thread doing cache_purge. + */ + mtx_wait_unlocked(vlp); + if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL)) { + mtx_lock(vlp); + cache_purge_impl(vp); + mtx_assert(vlp, MA_NOTOWNED); + return; + } + return; } /* Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/kern/vfs_subr.c Tue Aug 4 23:04:29 2020 (r363872) @@ -4146,7 +4146,7 @@ vgonel(struct vnode *vp) * Delete from old mount point vnode list. */ delmntque(vp); - cache_purge(vp); + cache_purge_vgone(vp); /* * Done with purge, reset to the standard lock and invalidate * the vnode. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/sys/vnode.h Tue Aug 4 23:04:29 2020 (r363872) @@ -638,6 +638,7 @@ int cache_lookup(struct vnode *dvp, struct vnode **vpp struct componentname *cnp, struct timespec *tsp, int *ticksp); void cache_vnode_init(struct vnode *vp); void cache_purge(struct vnode *vp); +void cache_purge_vgone(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp, bool force); int change_dir(struct vnode *vp, struct thread *td); From owner-svn-src-head@freebsd.org Tue Aug 4 23:07:01 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 490F83A2FBA; Tue, 4 Aug 2020 23:07:01 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr451Fy0z41SB; Tue, 4 Aug 2020 23:07:01 +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 084B1CF99; Tue, 4 Aug 2020 23:07:01 +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 074N70vG026905; Tue, 4 Aug 2020 23:07:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N70r0026904; Tue, 4 Aug 2020 23:07:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042307.074N70r0026904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363873 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 23:07:01 -0000 Author: mjg Date: Tue Aug 4 23:07:00 2020 New Revision: 363873 URL: https://svnweb.freebsd.org/changeset/base/363873 Log: cache: add NCF_WIP flag This allows making half-constructed entries visible to the lockless lookup, which now can check for either "not yet fully constructed" and "no longer valid" state. This will be used for .. lookup. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 23:04:29 2020 (r363872) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:07:00 2020 (r363873) @@ -162,6 +162,7 @@ struct namecache_ts { #define NCF_DVDROP 0x10 #define NCF_NEGATIVE 0x20 #define NCF_INVALID 0x40 +#define NCF_WIP 0x80 /* * Flags in negstate.neg_flag @@ -179,22 +180,22 @@ cache_ncp_invalidate(struct namecache *ncp) KASSERT((ncp->nc_flag & NCF_INVALID) == 0, ("%s: entry %p already invalid", __func__, ncp)); - ncp->nc_flag |= NCF_INVALID; + atomic_store_char(&ncp->nc_flag, ncp->nc_flag | NCF_INVALID); atomic_thread_fence_rel(); } /* - * Verify validity of an entry. + * Check whether the entry can be safely used. * * All places which elide locks are supposed to call this after they are * done with reading from an entry. */ static bool -cache_ncp_invalid(struct namecache *ncp) +cache_ncp_canuse(struct namecache *ncp) { atomic_thread_fence_acq(); - return ((ncp->nc_flag & NCF_INVALID) != 0); + return ((atomic_load_char(&ncp->nc_flag) & (NCF_INVALID | NCF_WIP)) == 0); } /* @@ -1506,7 +1507,7 @@ success: VOP_UNLOCK(dvp); } if (doing_smr) { - if (cache_ncp_invalid(ncp)) { + if (!cache_ncp_canuse(ncp)) { vfs_smr_exit(); *vpp = NULL; goto retry; @@ -1560,7 +1561,7 @@ negative_success: */ negstate = NCP2NEGSTATE(ncp); if ((negstate->neg_flag & NEG_HOT) == 0 || - cache_ncp_invalid(ncp)) { + !cache_ncp_canuse(ncp)) { vfs_smr_exit(); doing_smr = false; goto retry_hashed; @@ -1884,7 +1885,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * namecache entry as possible before acquiring the lock. */ ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); - ncp->nc_flag = flag; + ncp->nc_flag = flag | NCF_WIP; ncp->nc_vp = vp; if (vp == NULL) cache_negative_init(ncp); @@ -1987,13 +1988,19 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_name); } - atomic_thread_fence_rel(); /* * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ CK_LIST_INSERT_HEAD(ncpp, ncp, nc_hash); + atomic_thread_fence_rel(); + /* + * Mark the entry as fully constructed. + * It is immutable past this point until its removal. + */ + atomic_store_char(&ncp->nc_flag, ncp->nc_flag & ~NCF_WIP); + cache_enter_unlock(&cel); if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); @@ -3197,7 +3204,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, goto out_abort; } - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { goto out_abort; } @@ -3458,7 +3465,7 @@ cache_fplookup_next(struct cache_fpl *fpl) if ((nc_flag & NCF_NEGATIVE) != 0) { negstate = NCP2NEGSTATE(ncp); neg_hot = ((negstate->neg_flag & NEG_HOT) != 0); - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { return (cache_fpl_partial(fpl)); } if (__predict_false((nc_flag & NCF_WHITE) != 0)) { @@ -3474,7 +3481,7 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fpl_handled(fpl, ENOENT)); } - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { return (cache_fpl_partial(fpl)); } From owner-svn-src-head@freebsd.org Tue Aug 4 23: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 9FE8B3A3103; Tue, 4 Aug 2020 23:07:43 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr4v3l69z41Sx; Tue, 4 Aug 2020 23:07:43 +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 636B4CDA5; Tue, 4 Aug 2020 23:07:43 +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 074N7h3Z026988; Tue, 4 Aug 2020 23:07:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N7gdI026985; Tue, 4 Aug 2020 23:07:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042307.074N7gdI026985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363874 - 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: 363874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 23:07:43 -0000 Author: mjg Date: Tue Aug 4 23:07:42 2020 New Revision: 363874 URL: https://svnweb.freebsd.org/changeset/base/363874 Log: vfs: support lockless dotdot lookup Tested by: pho Modified: head/sys/kern/vfs_cache.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 Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:07:42 2020 (r363874) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -957,16 +958,22 @@ cache_zap_locked(struct namecache *ncp) SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - if (ncp == ncp->nc_vp->v_cache_dd) + if (ncp == ncp->nc_vp->v_cache_dd) { + vn_seqc_write_begin_unheld(ncp->nc_vp); ncp->nc_vp->v_cache_dd = NULL; + vn_seqc_write_end(ncp->nc_vp); + } } else { SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, ncp->nc_name); cache_negative_remove(ncp); } if (ncp->nc_flag & NCF_ISDOTDOT) { - if (ncp == ncp->nc_dvp->v_cache_dd) + if (ncp == ncp->nc_dvp->v_cache_dd) { + vn_seqc_write_begin_unheld(ncp->nc_dvp); ncp->nc_dvp->v_cache_dd = NULL; + vn_seqc_write_end(ncp->nc_dvp); + } } else { LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { @@ -1306,7 +1313,9 @@ retry_dotdot: mtx_unlock(dvlp2); cache_free(ncp); } else { + vn_seqc_write_begin(dvp); dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) mtx_unlock(dvlp2); @@ -1817,6 +1826,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnod cache_celockstate_init(&cel); hash = cache_get_hash(cnp->cn_nameptr, len, dvp); cache_enter_lock_dd(&cel, dvp, vp, hash); + vn_seqc_write_begin(dvp); ncp = dvp->v_cache_dd; if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); @@ -1825,6 +1835,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnod ncp = NULL; } dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); cache_enter_unlock(&cel); cache_free(ncp); } @@ -1939,7 +1950,9 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, goto out_unlock_free; KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); + vn_seqc_write_begin(dvp); dvp->v_cache_dd = ncp; + vn_seqc_write_end(dvp); } if (vp != NULL) { @@ -1950,6 +1963,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * directory name in it and the name ".." for the * directory's parent. */ + vn_seqc_write_begin(vp); if ((ndd = vp->v_cache_dd) != NULL) { if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) cache_zap_locked(ndd); @@ -1957,9 +1971,14 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ndd = NULL; } vp->v_cache_dd = ncp; + vn_seqc_write_end(vp); } } else { - vp->v_cache_dd = NULL; + if (vp->v_cache_dd != NULL) { + vn_seqc_write_begin(vp); + vp->v_cache_dd = NULL; + vn_seqc_write_end(vp); + } } } @@ -3425,6 +3444,75 @@ cache_fplookup_dot(struct cache_fpl *fpl) return (0); } +static int __noinline +cache_fplookup_dotdot(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + struct namecache *ncp; + struct vnode *dvp; + struct prison *pr; + u_char nc_flag; + + ndp = fpl->ndp; + cnp = fpl->cnp; + dvp = fpl->dvp; + + /* + * XXX this is racy the same way regular lookup is + */ + for (pr = cnp->cn_cred->cr_prison; pr != NULL; + pr = pr->pr_parent) + if (dvp == pr->pr_root) + break; + + if (dvp == ndp->ni_rootdir || + dvp == ndp->ni_topdir || + dvp == rootvnode || + pr != NULL) { + fpl->tvp = dvp; + fpl->tvp_seqc = vn_seqc_read_any(dvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + return (0); + } + + if ((dvp->v_vflag & VV_ROOT) != 0) { + /* + * TODO + * The opposite of climb mount is needed here. + */ + return (cache_fpl_aborted(fpl)); + } + + ncp = atomic_load_ptr(&dvp->v_cache_dd); + if (ncp == NULL) { + return (cache_fpl_aborted(fpl)); + } + + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) != 0) { + if ((nc_flag & NCF_NEGATIVE) != 0) + return (cache_fpl_aborted(fpl)); + fpl->tvp = ncp->nc_vp; + } else { + fpl->tvp = ncp->nc_dvp; + } + + if (__predict_false(!cache_ncp_canuse(ncp))) { + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp_seqc = vn_seqc_read_any(fpl->tvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_partial(fpl)); + } + + counter_u64_add(dotdothits, 1); + return (0); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { @@ -3782,11 +3870,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - if (cnp->cn_flags & ISDOTDOT) { - error = cache_fpl_partial(fpl); - break; - } - VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred, cnp->cn_thread); @@ -3795,17 +3878,24 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - error = cache_fplookup_next(fpl); - if (__predict_false(error != 0)) { - break; - } - - VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - - if (cache_fplookup_need_climb_mount(fpl)) { - error = cache_fplookup_climb_mount(fpl); + if (__predict_false(cnp->cn_flags & ISDOTDOT)) { + error = cache_fplookup_dotdot(fpl); if (__predict_false(error != 0)) { break; + } + } else { + error = cache_fplookup_next(fpl); + if (__predict_false(error != 0)) { + break; + } + + VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); + + if (cache_fplookup_need_climb_mount(fpl)) { + error = cache_fplookup_climb_mount(fpl); + if (__predict_false(error != 0)) { + break; + } } } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/kern/vfs_subr.c Tue Aug 4 23:07:42 2020 (r363874) @@ -6881,12 +6881,15 @@ vn_dir_check_exec(struct vnode *vp, struct componentna return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, cnp->cn_thread)); } +/* + * Do not use this variant unless you have means other than the hold count + * to prevent the vnode from getting freed. + */ void -vn_seqc_write_begin_locked(struct vnode *vp) +vn_seqc_write_begin_unheld_locked(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); - VNPASS(vp->v_holdcnt > 0, vp); VNPASS(vp->v_seqc_users >= 0, vp); vp->v_seqc_users++; if (vp->v_seqc_users == 1) @@ -6894,11 +6897,29 @@ vn_seqc_write_begin_locked(struct vnode *vp) } void +vn_seqc_write_begin_locked(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(vp->v_holdcnt > 0, vp); + vn_seqc_write_begin_unheld_locked(vp); +} + +void vn_seqc_write_begin(struct vnode *vp) { VI_LOCK(vp); vn_seqc_write_begin_locked(vp); + VI_UNLOCK(vp); +} + +void +vn_seqc_write_begin_unheld(struct vnode *vp) +{ + + VI_LOCK(vp); + vn_seqc_write_begin_unheld_locked(vp); VI_UNLOCK(vp); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/sys/vnode.h Tue Aug 4 23:07:42 2020 (r363874) @@ -764,6 +764,8 @@ int vn_io_fault_uiomove(char *data, int xfersize, stru int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, struct uio *uio); +void vn_seqc_write_begin_unheld_locked(struct vnode *vp); +void vn_seqc_write_begin_unheld(struct vnode *vp); void vn_seqc_write_begin_locked(struct vnode *vp); void vn_seqc_write_begin(struct vnode *vp); void vn_seqc_write_end_locked(struct vnode *vp); From owner-svn-src-head@freebsd.org Tue Aug 4 23:09: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 6A6CB3A2CFD; Tue, 4 Aug 2020 23:09: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr6h29myz41g4; Tue, 4 Aug 2020 23:09: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 2E105CDA6; Tue, 4 Aug 2020 23:09: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 074N9Gcx027103; Tue, 4 Aug 2020 23:09:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N9Gao027102; Tue, 4 Aug 2020 23:09:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042309.074N9Gao027102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363875 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 363875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 04 Aug 2020 23:09:16 -0000 Author: mjg Date: Tue Aug 4 23:09:15 2020 New Revision: 363875 URL: https://svnweb.freebsd.org/changeset/base/363875 Log: ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set This restores the pre-adaptive spinning state for SU which livelocks otherwise. Note this is a bug in SU. Reported by: pho Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Tue Aug 4 23:07:42 2020 (r363874) +++ head/sys/ufs/ffs/ffs_vnops.c Tue Aug 4 23:09:15 2020 (r363875) @@ -445,7 +445,13 @@ ffs_lock(ap) struct lock *lkp; int result; - ap->a_flags |= LK_ADAPTIVE; + /* + * Adaptive spinning mixed with SU leads to trouble. use a giant hammer + * and only use it when LK_NODDLKTREAT is set. Currently this means it + * is only used during path lookup. + */ + if ((ap->a_flags & LK_NODDLKTREAT) != 0) + ap->a_flags |= LK_ADAPTIVE; switch (ap->a_flags & LK_TYPE_MASK) { case LK_SHARED: case LK_UPGRADE: @@ -483,7 +489,11 @@ ffs_lock(ap) } return (result); #else - ap->a_flags |= LK_ADAPTIVE; + /* + * See above for an explanation. + */ + if ((ap->a_flags & LK_NODDLKTREAT) != 0) + ap->a_flags |= LK_ADAPTIVE; return (VOP_LOCK1_APV(&ufs_vnodeops, ap)); #endif } From owner-svn-src-head@freebsd.org Wed Aug 5 05:58: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 39FA03AB522; Wed, 5 Aug 2020 05:58:26 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM1Bp0D40z4Ml8; Wed, 5 Aug 2020 05:58:26 +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 DF585112F0; Wed, 5 Aug 2020 05:58:25 +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 0755wP2H080570; Wed, 5 Aug 2020 05:58:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0755wPJ6080569; Wed, 5 Aug 2020 05:58:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202008050558.0755wPJ6080569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Aug 2020 05:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363880 - head/sys/dev/safexcel X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/safexcel X-SVN-Commit-Revision: 363880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 05:58:26 -0000 Author: lwhsu Date: Wed Aug 5 05:58:25 2020 New Revision: 363880 URL: https://svnweb.freebsd.org/changeset/base/363880 Log: Appease gcc's -Wparentheses (and -Werror) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/safexcel/safexcel.c Modified: head/sys/dev/safexcel/safexcel.c ============================================================================== --- head/sys/dev/safexcel/safexcel.c Wed Aug 5 03:53:57 2020 (r363879) +++ head/sys/dev/safexcel/safexcel.c Wed Aug 5 05:58:25 2020 (r363880) @@ -1635,7 +1635,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struc b0 = (uint8_t *)instr; memset(b0, 0, blen); b0[0] = - L - 1 | /* payload length size */ + (L - 1) | /* payload length size */ ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ | (crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */; memcpy(&b0[1], req->iv, AES_CCM_IV_LEN); From owner-svn-src-head@freebsd.org Wed Aug 5 07:28: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 68EF23ACD32; Wed, 5 Aug 2020 07:28:52 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3C81cXpz4RxF; Wed, 5 Aug 2020 07:28:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A82312A98; Wed, 5 Aug 2020 07:28:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757Sp3u037449; Wed, 5 Aug 2020 07:28:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Spr9037448; Wed, 5 Aug 2020 07:28:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050728.0757Spr9037448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363881 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:28:52 -0000 Author: mjg Date: Wed Aug 5 07:28:51 2020 New Revision: 363881 URL: https://svnweb.freebsd.org/changeset/base/363881 Log: vfs: prefill nameidata with garbage on debug kernels Modified: head/sys/sys/namei.h Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Wed Aug 5 05:58:25 2020 (r363880) +++ head/sys/sys/namei.h Wed Aug 5 07:28:51 2020 (r363881) @@ -196,11 +196,21 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, &cap_no_rights, td) +/* + * Note the constant pattern may *hide* bugs. + */ +#ifdef INVARIANTS +#define NDINIT_PREFILL(arg) memset(arg, 0xff, sizeof(*arg)) +#else +#define NDINIT_PREFILL(arg) do { } while (0) +#endif + #define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp, td) \ do { \ struct nameidata *_ndp = (ndp); \ cap_rights_t *_rightsp = (rightsp); \ MPASS(_rightsp != NULL); \ + NDINIT_PREFILL(_ndp); \ _ndp->ni_cnd.cn_nameiop = op; \ _ndp->ni_cnd.cn_flags = flags; \ _ndp->ni_segflg = segflg; \ From owner-svn-src-head@freebsd.org Wed Aug 5 07:30: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 DE0F93ACDF1; Wed, 5 Aug 2020 07:30: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Dn5cmGz4S1Z; Wed, 5 Aug 2020 07:30: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 A42A8127DD; Wed, 5 Aug 2020 07:30: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 0757UHpZ037606; Wed, 5 Aug 2020 07:30:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757UHIh037605; Wed, 5 Aug 2020 07:30:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050730.0757UHIh037605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363882 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:30:17 -0000 Author: mjg Date: Wed Aug 5 07:30:17 2020 New Revision: 363882 URL: https://svnweb.freebsd.org/changeset/base/363882 Log: cache: stop messing with cn_flags This removes flag setting/unsetting carried over from regular lookup. Flags still get for compatibility when falling back. Note .. and . handling can get partially folded together. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:28:51 2020 (r363881) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:30:17 2020 (r363882) @@ -3098,7 +3098,30 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro (LOCKLEAF | LOCKPARENT | WANTPARENT | FOLLOW | LOCKSHARED | SAVENAME | \ ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2) +#define CACHE_FPL_INTERNAL_CN_FLAGS \ + (ISDOTDOT | MAKEENTRY | ISLASTCN) + +_Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, + "supported and internal flags overlap"); + static bool +cache_fpl_islastcn(struct nameidata *ndp) +{ + + return (*ndp->ni_next == 0); +} + +static bool +cache_fpl_isdotdot(struct componentname *cnp) +{ + + if (cnp->cn_namelen == 2 && + cnp->cn_nameptr[1] == '.' && cnp->cn_nameptr[0] == '.') + return (true); + return (false); +} + +static bool cache_can_fplookup(struct cache_fpl *fpl) { struct nameidata *ndp; @@ -3253,15 +3276,17 @@ out_abort: /* * The target vnode is not supported, prepare for the slow path to take over. */ -static int +static int __noinline cache_fplookup_partial_setup(struct cache_fpl *fpl) { + struct nameidata *ndp; struct componentname *cnp; enum vgetstate dvs; struct vnode *dvp; struct pwd *pwd; seqc_t dvp_seqc; + ndp = fpl->ndp; cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; @@ -3287,8 +3312,15 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - fpl->ndp->ni_startdir = dvp; + cache_fpl_restore(fpl, &fpl->snd); + ndp->ni_startdir = dvp; + cnp->cn_flags |= MAKEENTRY; + if (cache_fpl_islastcn(ndp)) + cnp->cn_flags |= ISLASTCN; + if (cache_fpl_isdotdot(cnp)) + cnp->cn_flags |= ISDOTDOT; + return (0); } @@ -3763,18 +3795,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) } ndp->ni_next = cp; - cnp->cn_flags |= MAKEENTRY; - - if (cnp->cn_namelen == 2 && - cnp->cn_nameptr[1] == '.' && cnp->cn_nameptr[0] == '.') - cnp->cn_flags |= ISDOTDOT; - else - cnp->cn_flags &= ~ISDOTDOT; - if (*ndp->ni_next == 0) - cnp->cn_flags |= ISLASTCN; - else - cnp->cn_flags &= ~ISLASTCN; - /* * Check for degenerate name (e.g. / or "") * which is a way of talking about a directory, @@ -3878,7 +3898,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - if (__predict_false(cnp->cn_flags & ISDOTDOT)) { + if (__predict_false(cache_fpl_isdotdot(cnp))) { error = cache_fplookup_dotdot(fpl); if (__predict_false(error != 0)) { break; @@ -3901,7 +3921,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - if (cnp->cn_flags & ISLASTCN) { + if (cache_fpl_islastcn(ndp)) { error = cache_fplookup_final(fpl); break; } @@ -4082,7 +4102,9 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s break; case CACHE_FPL_STATUS_PARTIAL: *pwdp = fpl.pwd; - cache_fpl_restore(&fpl, &fpl.snd); + /* + * Status restored by cache_fplookup_partial_setup. + */ break; case CACHE_FPL_STATUS_ABORTED: cache_fpl_restore(&fpl, &orig); From owner-svn-src-head@freebsd.org Wed Aug 5 07:30: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 C88713ACCFC; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3FY51xWz4SFM; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 912B912A9D; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757UvWq038415; Wed, 5 Aug 2020 07:30:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757UvPf038414; Wed, 5 Aug 2020 07:30:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050730.0757UvPf038414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363883 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:30:57 -0000 Author: mjg Date: Wed Aug 5 07:30:57 2020 New Revision: 363883 URL: https://svnweb.freebsd.org/changeset/base/363883 Log: cache: stop messing with cn_lkflags See r363882. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:30:17 2020 (r363882) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:30:57 2020 (r363883) @@ -3330,14 +3330,17 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum struct componentname *cnp; struct vnode *tvp; seqc_t tvp_seqc; - int error; + int error, lkflags; cnp = fpl->cnp; tvp = fpl->tvp; tvp_seqc = fpl->tvp_seqc; if ((cnp->cn_flags & LOCKLEAF) != 0) { - error = vget_finish(tvp, cnp->cn_lkflags, tvs); + lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) + lkflags = LK_EXCLUSIVE; + error = vget_finish(tvp, lkflags, tvs); if (error != 0) { return (cache_fpl_aborted(fpl)); } @@ -3864,9 +3867,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp ndp = fpl->ndp; ndp->ni_lcf = 0; cnp = fpl->cnp; - cnp->cn_lkflags = LK_SHARED; - if ((cnp->cn_flags & LOCKSHARED) == 0) - cnp->cn_lkflags = LK_EXCLUSIVE; cache_fpl_checkpoint(fpl, &fpl->snd); From owner-svn-src-head@freebsd.org Wed Aug 5 07:32: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 022AE3ACFEB; Wed, 5 Aug 2020 07:32: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3HG6MBXz4SfK; Wed, 5 Aug 2020 07:32: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 BD7D112ABD; Wed, 5 Aug 2020 07:32: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 0757WQbh043211; Wed, 5 Aug 2020 07:32:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757WQsS043210; Wed, 5 Aug 2020 07:32:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050732.0757WQsS043210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363884 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:32:27 -0000 Author: mjg Date: Wed Aug 5 07:32:26 2020 New Revision: 363884 URL: https://svnweb.freebsd.org/changeset/base/363884 Log: cache: cleanup lockless entry point - remove spurious bzero - assert ni_lcf, it has to be set by namei by this point Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:30:57 2020 (r363883) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:32:26 2020 (r363884) @@ -3033,6 +3033,12 @@ cache_fpl_restore(struct cache_fpl *fpl, struct nameid #define cache_fpl_smr_assert_not_entered(fpl) do { } while (0) #endif +#define cache_fpl_smr_enter_initial(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + vfs_smr_enter(); \ + _fpl->in_smr = true; \ +}) + #define cache_fpl_smr_enter(fpl) ({ \ struct cache_fpl *_fpl = (fpl); \ MPASS(_fpl->in_smr == false); \ @@ -3865,7 +3871,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp error = CACHE_FPL_FAILED; ndp = fpl->ndp; - ndp->ni_lcf = 0; cnp = fpl->cnp; cache_fpl_checkpoint(fpl, &fpl->snd); @@ -4055,8 +4060,8 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s struct nameidata_saved orig; int error; - *status = CACHE_FPL_STATUS_UNSET; - bzero(&fpl, sizeof(fpl)); + MPASS(ndp->ni_lcf == 0); + fpl.status = CACHE_FPL_STATUS_UNSET; fpl.ndp = ndp; fpl.cnp = &ndp->ni_cnd; @@ -4070,7 +4075,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s cache_fpl_checkpoint(&fpl, &orig); - cache_fpl_smr_enter(&fpl); + cache_fpl_smr_enter_initial(&fpl); pwd = pwd_get_smr(); fpl.pwd = pwd; ndp->ni_rootdir = pwd->pwd_rdir; From owner-svn-src-head@freebsd.org Wed Aug 5 07:33: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 7B5423AD25B; Wed, 5 Aug 2020 07:33:40 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Jh2dhRz4Spr; Wed, 5 Aug 2020 07:33:40 +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 3E7CF12D06; Wed, 5 Aug 2020 07:33:40 +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 0757XeVS043344; Wed, 5 Aug 2020 07:33:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Xem6043343; Wed, 5 Aug 2020 07:33:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050733.0757Xem6043343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363885 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:33:40 -0000 Author: mjg Date: Wed Aug 5 07:33:39 2020 New Revision: 363885 URL: https://svnweb.freebsd.org/changeset/base/363885 Log: vfs: tidy up namei entry point - predict for string copy errors - reshuffle inititalistion of vars which are not needed Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Aug 5 07:32:26 2020 (r363884) +++ head/sys/kern/vfs_lookup.c Wed Aug 5 07:33:39 2020 (r363885) @@ -297,6 +297,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, startdir_used = false; *pwdp = NULL; + *dpp = NULL; #ifdef CAPABILITY_MODE /* @@ -470,7 +471,6 @@ namei(struct nameidata *ndp) struct iovec aiov; /* uio for reading symbolic links */ struct componentname *cnp; struct thread *td; - struct proc *p; struct pwd *pwd; struct uio auio; int error, linklen; @@ -478,23 +478,19 @@ namei(struct nameidata *ndp) cnp = &ndp->ni_cnd; td = cnp->cn_thread; - p = td->td_proc; ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; - KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); + KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, ("namei: nameiop contaminated with flags")); KASSERT((cnp->cn_flags & OPMASK) == 0, ("namei: flags contaminated with nameiops")); MPASS(ndp->ni_startdir == NULL || ndp->ni_startdir->v_type == VDIR || ndp->ni_startdir->v_type == VBAD); - TAILQ_INIT(&ndp->ni_cap_tracker); - ndp->ni_lcf = 0; - ndp->ni_loopcnt = 0; - dp = NULL; /* We will set this ourselves if we need it. */ cnp->cn_flags &= ~TRAILINGSLASH; + ndp->ni_lcf = 0; ndp->ni_vp = NULL; /* @@ -510,17 +506,15 @@ namei(struct nameidata *ndp) error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, &ndp->ni_pathlen); - if (error != 0) { + if (__predict_false(error != 0)) { namei_cleanup_cnp(cnp); return (error); } - cnp->cn_nameptr = cnp->cn_pnbuf; - /* * Don't allow empty pathnames. */ - if (*cnp->cn_pnbuf == '\0') { + if (__predict_false(*cnp->cn_pnbuf == '\0')) { namei_cleanup_cnp(cnp); return (ENOENT); } @@ -533,6 +527,8 @@ namei(struct nameidata *ndp) } #endif + cnp->cn_nameptr = cnp->cn_pnbuf; + /* * First try looking up the target without locking any vnodes. * @@ -546,9 +542,11 @@ namei(struct nameidata *ndp) case CACHE_FPL_STATUS_HANDLED: return (error); case CACHE_FPL_STATUS_PARTIAL: + TAILQ_INIT(&ndp->ni_cap_tracker); dp = ndp->ni_startdir; break; case CACHE_FPL_STATUS_ABORTED: + TAILQ_INIT(&ndp->ni_cap_tracker); error = namei_setup(ndp, &dp, &pwd); if (error != 0) { namei_cleanup_cnp(cnp); @@ -556,6 +554,8 @@ namei(struct nameidata *ndp) } break; } + + ndp->ni_loopcnt = 0; /* * Locked lookup. From owner-svn-src-head@freebsd.org Wed Aug 5 07:34: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 38BF23AD2C2; Wed, 5 Aug 2020 07:34:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Ky0qpVz4SpM; Wed, 5 Aug 2020 07:34:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E9912D07; Wed, 5 Aug 2020 07:34:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757YjfR043439; Wed, 5 Aug 2020 07:34:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Yjl9043437; Wed, 5 Aug 2020 07:34:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050734.0757Yjl9043437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363886 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 363886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 07:34:46 -0000 Author: mjg Date: Wed Aug 5 07:34:45 2020 New Revision: 363886 URL: https://svnweb.freebsd.org/changeset/base/363886 Log: vfs: add a cheaper entry for mac_vnode_check_access Modified: head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_framework.h head/sys/security/mac/mac_vfs.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_framework.c Wed Aug 5 07:34:45 2020 (r363886) @@ -140,6 +140,7 @@ FPFLAG(vnode_check_write); FPFLAG(vnode_check_mmap); FPFLAG_RARE(vnode_check_poll); FPFLAG_RARE(vnode_check_rename_from); +FPFLAG_RARE(vnode_check_access); #undef FPFLAG #undef FPFLAG_RARE @@ -430,6 +431,8 @@ struct mac_policy_fastpath_elem mac_policy_fastpath_ar .flag = &mac_vnode_check_poll_fp_flag }, { .offset = FPO(vnode_check_rename_from), .flag = &mac_vnode_check_rename_from_fp_flag }, + { .offset = FPO(vnode_check_access), + .flag = &mac_vnode_check_access_fp_flag }, }; static void Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_framework.h Wed Aug 5 07:34:45 2020 (r363886) @@ -406,8 +406,20 @@ void mac_vnode_assert_locked(struct vnode *vp, const c int mac_vnode_associate_extattr(struct mount *mp, struct vnode *vp); void mac_vnode_associate_singlelabel(struct mount *mp, struct vnode *vp); -int mac_vnode_check_access(struct ucred *cred, struct vnode *vp, +int mac_vnode_check_access_impl(struct ucred *cred, struct vnode *dvp, accmode_t accmode); +extern bool mac_vnode_check_access_fp_flag; +#define mac_vnode_check_access_enabled() __predict_false(mac_vnode_check_access_fp_flag) +static inline int +mac_vnode_check_access(struct ucred *cred, struct vnode *dvp, + accmode_t accmode) +{ + + mac_vnode_assert_locked(dvp, "mac_vnode_check_access"); + if (mac_vnode_check_access_enabled()) + return (mac_vnode_check_access_impl(cred, dvp, accmode)); + return (0); +} int mac_vnode_check_chdir(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_chroot(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_create(struct ucred *cred, struct vnode *dvp, Modified: head/sys/security/mac/mac_vfs.c ============================================================================== --- head/sys/security/mac/mac_vfs.c Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_vfs.c Wed Aug 5 07:34:45 2020 (r363886) @@ -372,7 +372,7 @@ MAC_CHECK_PROBE_DEFINE3(vnode_check_access, "struct uc "struct vnode *", "accmode_t"); int -mac_vnode_check_access(struct ucred *cred, struct vnode *vp, accmode_t accmode) +mac_vnode_check_access_impl(struct ucred *cred, struct vnode *vp, accmode_t accmode) { int error; From owner-svn-src-head@freebsd.org Wed Aug 5 08:31: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 6A2173AE44F; Wed, 5 Aug 2020 08:31:27 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM4bM20X3z4WVB; Wed, 5 Aug 2020 08:31:27 +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 1401813621; Wed, 5 Aug 2020 08:31:27 +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 0758VQIg078931; Wed, 5 Aug 2020 08:31:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0758VQae078930; Wed, 5 Aug 2020 08:31:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008050831.0758VQae078930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 5 Aug 2020 08:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363887 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 363887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 08:31:27 -0000 Author: manu Date: Wed Aug 5 08:31:26 2020 New Revision: 363887 URL: https://svnweb.freebsd.org/changeset/base/363887 Log: allwinner: clk: Fix nm clock calculation Use the right factor when finding the best frequency and compare the absolute value of the result. Submitted by: kibab MFC after: 3 days Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Wed Aug 5 07:34:45 2020 (r363886) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Wed Aug 5 08:31:26 2020 (r363887) @@ -151,7 +151,7 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t min_n = aw_clk_factor_get_min(&sc->n); for (m = min_m; m <= max_m; ) { - for (n = min_m; n <= max_n; ) { + for (n = min_n; n <= max_n; ) { cur = fparent / n / m; if (abs(*fout - cur) < abs(*fout - best)) { best = cur; @@ -196,7 +196,7 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare clknode_get_freq(p_clk, &fparent); cur = aw_clk_nm_find_best(sc, fparent, fout, &n, &m); - if ((*fout - cur) < (*fout - best)) { + if (abs((*fout - cur)) < abs((*fout - best))) { best = cur; best_parent = p_idx; best_n = n; From owner-svn-src-head@freebsd.org Wed Aug 5 09:16: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 3C4C63AF341; Wed, 5 Aug 2020 09:16:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5bS0wLvz4YtJ; Wed, 5 Aug 2020 09:16:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043AF13D9B; Wed, 5 Aug 2020 09:16:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0759GZwI004790; Wed, 5 Aug 2020 09:16:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759GZBG004789; Wed, 5 Aug 2020 09:16:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008050916.0759GZBG004789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 09:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363888 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 363888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:16:36 -0000 Author: ae Date: Wed Aug 5 09:16:35 2020 New Revision: 363888 URL: https://svnweb.freebsd.org/changeset/base/363888 Log: Handle delayed checksums if needed in NAT64. Upper level protocols defer checksums calculation in hope we have checksums offloading in a network card. CSUM_DELAY_DATA flag is used to determine that checksum calculation was deferred. And IP output routine checks for this flag before pass mbuf to lower layer. Forwarded packets have not this flag. NAT64 uses checksums adjustment when it translates IP headers. In most cases NAT64 is used for forwarded packets, but in case when it handles locally originated packets we need to finish checksum calculation that was deferred to correctly adjust it. Add check for presence of CSUM_DELAY_DATA flag and finish checksum calculation before adjustment. Reported and tested by: Evgeniy Khramtsov MFC after: 1 week Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Wed Aug 5 08:31:26 2020 (r363887) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Wed Aug 5 09:16:35 2020 (r363888) @@ -1294,6 +1294,12 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; + + /* Handle delayed checksums if needed. */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + in_delayed_cksum(m); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } /* Convert checksums. */ switch (proto) { case IPPROTO_TCP: @@ -1665,6 +1671,12 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui return (NAT64RETURN); } nat64_init_ip4hdr(ip6, frag, plen, proto, &ip); + + /* Handle delayed checksums if needed. */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(m, plen, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } /* Convert checksums. */ switch (proto) { case IPPROTO_TCP: From owner-svn-src-head@freebsd.org Wed Aug 5 09:19: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 1F5673AF573; Wed, 5 Aug 2020 09:19:42 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5g202Yyz4Z3b; Wed, 5 Aug 2020 09:19:42 +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 D496A13BC6; Wed, 5 Aug 2020 09:19:41 +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 0759Jfnl005112; Wed, 5 Aug 2020 09:19:41 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759JfU5005111; Wed, 5 Aug 2020 09:19:41 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202008050919.0759JfU5005111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 5 Aug 2020 09:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363889 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Commit-Revision: 363889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:19:42 -0000 Author: eugen Date: Wed Aug 5 09:19:41 2020 New Revision: 363889 URL: https://svnweb.freebsd.org/changeset/base/363889 Log: bsnmptools: make it print protocol errors to stderr instead of stdout Reviewed by: syrinx, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25911 Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Aug 5 09:16:35 2020 (r363888) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Aug 5 09:19:41 2020 (r363889) @@ -1828,11 +1828,11 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, break; case SNMP_SYNTAX_NOSUCHOBJECT: - fprintf(stdout, "No Such Object\n"); + fprintf(stderr, "No Such Object\n"); return (val->syntax); case SNMP_SYNTAX_NOSUCHINSTANCE: - fprintf(stdout, "No Such Instance\n"); + fprintf(stderr, "No Such Instance\n"); return (val->syntax); case SNMP_SYNTAX_ENDOFMIBVIEW: @@ -1841,12 +1841,12 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, case SNMP_SYNTAX_NULL: /* NOTREACHED */ - fprintf(stdout, "agent returned NULL Syntax\n"); + fprintf(stderr, "agent returned NULL Syntax\n"); return (val->syntax); default: /* NOTREACHED - If here - then all went completely wrong. */ - fprintf(stdout, "agent returned unknown syntax\n"); + fprintf(stderr, "agent returned unknown syntax\n"); return (-1); } From owner-svn-src-head@freebsd.org Wed Aug 5 09:24: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 E8FB83AF367; Wed, 5 Aug 2020 09:24:00 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5m05vPhz4ZXV; Wed, 5 Aug 2020 09:24:00 +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 ADB5413E60; Wed, 5 Aug 2020 09:24:00 +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 0759O0Mg010837; Wed, 5 Aug 2020 09:24:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759O0nY010836; Wed, 5 Aug 2020 09:24:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050924.0759O0nY010836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363890 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:24:01 -0000 Author: mjg Date: Wed Aug 5 09:24:00 2020 New Revision: 363890 URL: https://svnweb.freebsd.org/changeset/base/363890 Log: cache: convert ncnegnash into a macro It is a read-only var with value known at compilation time. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:19:41 2020 (r363889) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) @@ -284,8 +284,8 @@ static struct neglist __read_mostly *neglists; static struct neglist ncneg_hot; static u_long numhotneg; -#define numneglists (ncneghash + 1) -static u_int __read_mostly ncneghash; +#define ncneghash 3 +#define numneglists (ncneghash + 1) static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) { @@ -2091,7 +2091,6 @@ nchinit(void *dummy __unused) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); ncpurgeminvnodes = numbucketlocks * 2; - ncneghash = 3; neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numneglists; i++) { From owner-svn-src-head@freebsd.org Wed Aug 5 09:24: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 1C7A03AF999; Wed, 5 Aug 2020 09:24:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5mk745Xz4ZYY; Wed, 5 Aug 2020 09:24:38 +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 BD0CB13E61; Wed, 5 Aug 2020 09:24:38 +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 0759OcrW010910; Wed, 5 Aug 2020 09:24:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759Oc3H010909; Wed, 5 Aug 2020 09:24:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050924.0759Oc3H010909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363891 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:24:39 -0000 Author: mjg Date: Wed Aug 5 09:24:38 2020 New Revision: 363891 URL: https://svnweb.freebsd.org/changeset/base/363891 Log: cache: reduce zone alignment to 8 bytes It used to be sizeof of the given struct to accomodate for 32 bit mips doing 64 bit loads, but the same can be achieved with requireing just 64 bit alignment. While here reorder struct namecache so that most commonly used fields are closer. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) @@ -122,9 +122,9 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc "the state must fit in a union with a pointer without growing it"); struct namecache { - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ + CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ @@ -142,6 +142,8 @@ struct namecache { * to be stored. The nc_dotdottime field is used when a cache entry is mapping * both a non-dotdot directory name plus dotdot for the directory's * parent. + * + * See below for alignment requirement. */ struct namecache_ts { struct timespec nc_time; /* timespec provided by fs */ @@ -150,6 +152,14 @@ struct namecache_ts { struct namecache nc_nc; }; +/* + * At least mips n32 performs 64-bit accesses to timespec as found + * in namecache_ts and requires them to be aligned. Since others + * may be in the same spot suffer a little bit and enforce the + * alignment for everyone. Note this is a nop for 64-bit platforms. + */ +#define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) + #define nc_vp n_un.nu_vp #define nc_neg n_un.nu_neg @@ -2053,19 +2063,19 @@ nchinit(void *dummy __unused) cache_zone_small = uma_zcreate("S VFS Cache", sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_small_ts = uma_zcreate("STS VFS Cache", sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_large = uma_zcreate("L VFS Cache", sizeof(struct namecache) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_large_ts = uma_zcreate("LTS VFS Cache", sizeof(struct namecache_ts) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); VFS_SMR_ZONE_SET(cache_zone_small); From owner-svn-src-head@freebsd.org Wed Aug 5 09: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 F06123AFA8B; Wed, 5 Aug 2020 09:25:59 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5pH66bzz4Znf; Wed, 5 Aug 2020 09:25:59 +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 B4F1413D4F; Wed, 5 Aug 2020 09:25:59 +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 0759Pxeo011022; Wed, 5 Aug 2020 09:25:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759Px4U011021; Wed, 5 Aug 2020 09:25:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050925.0759Px4U011021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363892 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:26:00 -0000 Author: mjg Date: Wed Aug 5 09:25:59 2020 New Revision: 363892 URL: https://svnweb.freebsd.org/changeset/base/363892 Log: cache: convert the hash from LIST to SLIST This reduces struct namecache by sizeof(void *). Negative side is that we have to find the previous element (if any) when removing an entry, but since we normally don't expect collisions it should be fine. Note this adds cache_get_hash calls which can be eliminated. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:25:59 2020 (r363892) @@ -124,7 +124,7 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc struct namecache { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ + CK_SLIST_ENTRY(namecache) nc_hash;/* hash chain */ struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ @@ -264,7 +264,7 @@ VFS_SMR_DECLARE; */ #define NCHHASH(hash) \ (&nchashtbl[(hash) & nchash]) -static __read_mostly CK_LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */ +static __read_mostly CK_SLIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */ static u_long __read_mostly nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); @@ -520,6 +520,15 @@ cache_get_hash(char *name, u_char len, struct vnode *d return (fnv_32_buf(name, len, dvp->v_nchash)); } +static inline struct nchashhead * +NCP2BUCKET(struct namecache *ncp) +{ + uint32_t hash; + + hash = cache_get_hash(ncp->nc_name, ncp->nc_nlen, ncp->nc_dvp); + return (NCHHASH(hash)); +} + static inline struct rwlock * NCP2BUCKETLOCK(struct namecache *ncp) { @@ -687,7 +696,7 @@ retry: } /* Scan hash tables counting entries */ for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++) - CK_LIST_FOREACH(ncp, ncpp, nc_hash) + CK_SLIST_FOREACH(ncp, ncpp, nc_hash) cntbuf[i]++; cache_unlock_all_buckets(); for (error = 0, i = 0; i < n_nchash; i++) @@ -720,7 +729,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS) /* Scan hash tables for applicable entries */ for (ncpp = nchashtbl; n_nchash > 0; n_nchash--, ncpp++) { count = 0; - CK_LIST_FOREACH(ncp, ncpp, nc_hash) { + CK_SLIST_FOREACH(ncp, ncpp, nc_hash) { count++; } if (count) @@ -952,6 +961,7 @@ cache_negative_zap_one(void) static void cache_zap_locked(struct namecache *ncp) { + struct nchashhead *ncpp; if (!(ncp->nc_flag & NCF_NEGATIVE)) cache_assert_vnode_locked(ncp->nc_vp); @@ -963,7 +973,8 @@ cache_zap_locked(struct namecache *ncp) cache_ncp_invalidate(ncp); - CK_LIST_REMOVE(ncp, nc_hash); + ncpp = NCP2BUCKET(ncp); + CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); @@ -1122,7 +1133,7 @@ cache_zap_unlocked_bucket(struct namecache *ncp, struc cache_sort_vnodes(&dvlp, &vlp); cache_lock_vnodes(dvlp, vlp); rw_wlock(blp); - CK_LIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { if (rncp == ncp && rncp->nc_dvp == dvp && rncp->nc_nlen == cnp->cn_namelen && !bcmp(rncp->nc_name, cnp->cn_nameptr, rncp->nc_nlen)) @@ -1336,12 +1347,12 @@ retry_dotdot: hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); blp = HASH2BUCKETLOCK(hash); retry: - if (CK_LIST_EMPTY(NCHHASH(hash))) + if (CK_SLIST_EMPTY(NCHHASH(hash))) goto out_no_entry; rw_wlock(blp); - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -1485,7 +1496,7 @@ retry_hashed: rw_rlock(blp); } - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -1932,7 +1943,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * the same path name. */ ncpp = NCHHASH(hash); - CK_LIST_FOREACH(n2, ncpp, nc_hash) { + CK_SLIST_FOREACH(n2, ncpp, nc_hash) { if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { @@ -2021,7 +2032,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ - CK_LIST_INSERT_HEAD(ncpp, ncp, nc_hash); + CK_SLIST_INSERT_HEAD(ncpp, ncp, nc_hash); atomic_thread_fence_rel(); /* @@ -2053,6 +2064,28 @@ cache_roundup_2(u_int val) return (res); } +static struct nchashhead * +nchinittbl(u_long elements, u_long *hashmask) +{ + struct nchashhead *hashtbl; + u_long hashsize, i; + + hashsize = cache_roundup_2(desiredvnodes * 2) / 2; + + hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), M_VFSCACHE, M_WAITOK); + for (i = 0; i < hashsize; i++) + CK_SLIST_INIT(&hashtbl[i]); + *hashmask = hashsize - 1; + return (hashtbl); +} + +static void +ncfreetbl(struct nchashhead *hashtbl) +{ + + free(hashtbl, M_VFSCACHE); +} + /* * Name cache initialization, from vfs_init() when we are booting */ @@ -2084,7 +2117,7 @@ nchinit(void *dummy __unused) VFS_SMR_ZONE_SET(cache_zone_large_ts); ncsize = desiredvnodes * ncsizefactor; - nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); + nchashtbl = nchinittbl(desiredvnodes * 2, &nchash); ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ ncbuckethash = 7; @@ -2139,10 +2172,10 @@ cache_changesize(u_long newmaxvnodes) if (newmaxvnodes < numbucketlocks) newmaxvnodes = numbucketlocks; - new_nchashtbl = hashinit(newmaxvnodes, M_VFSCACHE, &new_nchash); + new_nchashtbl = nchinittbl(newmaxvnodes, &new_nchash); /* If same hash table size, nothing to do */ if (nchash == new_nchash) { - free(new_nchashtbl, M_VFSCACHE); + ncfreetbl(new_nchashtbl); return; } /* @@ -2157,17 +2190,17 @@ cache_changesize(u_long newmaxvnodes) nchashtbl = new_nchashtbl; nchash = new_nchash; for (i = 0; i <= old_nchash; i++) { - while ((ncp = CK_LIST_FIRST(&old_nchashtbl[i])) != NULL) { + while ((ncp = CK_SLIST_FIRST(&old_nchashtbl[i])) != NULL) { hash = cache_get_hash(ncp->nc_name, ncp->nc_nlen, ncp->nc_dvp); - CK_LIST_REMOVE(ncp, nc_hash); - CK_LIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); + CK_SLIST_REMOVE(&old_nchashtbl[i], ncp, namecache, nc_hash); + CK_SLIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); } } ncsize = newncsize; cache_unlock_all_buckets(); cache_unlock_all_vnodes(); - free(old_nchashtbl, M_VFSCACHE); + ncfreetbl(old_nchashtbl); } /* @@ -2317,7 +2350,7 @@ cache_purgevfs(struct mount *mp, bool force) for (j = i; j < n_nchash; j += numbucketlocks) { retry: bucket = &nchashtbl[j]; - CK_LIST_FOREACH_SAFE(ncp, bucket, nc_hash, nnp) { + CK_SLIST_FOREACH_SAFE(ncp, bucket, nc_hash, nnp) { cache_assert_bucket_locked(ncp, RA_WLOCKED); if (ncp->nc_dvp->v_mount != mp) continue; @@ -3233,7 +3266,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, * In particular at this point there can be a new ncp which matches the * search but hashes to a different neglist. */ - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp == oncp) break; } @@ -3583,7 +3616,7 @@ cache_fplookup_next(struct cache_fpl *fpl) hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; From owner-svn-src-head@freebsd.org Wed Aug 5 09:27: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 4EE643AF839; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5qb1nS3z4ZxT; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2093413BEE; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0759R7CU011135; Wed, 5 Aug 2020 09:27:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759R3FN011116; Wed, 5 Aug 2020 09:27:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050927.0759R3FN011116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363893 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Commit-Revision: 363893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:27:07 -0000 Author: mjg Date: Wed Aug 5 09:27:03 2020 New Revision: 363893 URL: https://svnweb.freebsd.org/changeset/base/363893 Log: vfs: remove the obsolete privused argument from vaccess This brings argument count down to 6, which is passable without the stack on amd64. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/subr_acl_nfs4.c head/sys/kern/subr_acl_posix1e.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -4941,7 +4941,7 @@ zfs_freebsd_access(ap) accmode = ap->a_accmode & ~(VREAD|VWRITE|VEXEC|VAPPEND); if (accmode != 0) { error = vaccess(vp->v_type, zp->z_mode, zp->z_uid, - zp->z_gid, accmode, ap->a_cred, NULL); + zp->z_gid, accmode, ap->a_cred); } } Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/cd9660/cd9660_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -158,7 +158,7 @@ cd9660_access(ap) } return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, - ip->inode.iso_gid, ap->a_accmode, ap->a_cred, NULL)); + ip->inode.iso_gid, ap->a_accmode, ap->a_cred)); } static int Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/devfs/devfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -533,7 +533,7 @@ devfs_access(struct vop_access_args *ap) de = de->de_dir; error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, - ap->a_accmode, ap->a_cred, NULL); + ap->a_accmode, ap->a_cred); if (error == 0) return (0); if (error != EACCES) Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -348,7 +348,7 @@ ext2_access(struct vop_access_args *ap) return (EPERM); error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - ap->a_accmode, ap->a_cred, NULL); + ap->a_accmode, ap->a_cred); return (error); } Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/fuse/fuse_internal.c Wed Aug 5 09:27:03 2020 (r363893) @@ -208,7 +208,7 @@ fuse_internal_access(struct vnode *vp, fuse_internal_getattr(vp, &va, cred, td); return vaccess(vp->v_type, va.va_mode, va.va_uid, - va.va_gid, mode, cred, NULL); + va.va_gid, mode, cred); } if (mode & VADMIN) { Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -250,7 +250,7 @@ msdosfs_access(struct vop_access_args *ap) } return (vaccess(vp->v_type, file_mode, pmp->pm_uid, pmp->pm_gid, - ap->a_accmode, ap->a_cred, NULL)); + ap->a_accmode, ap->a_cred)); } static int Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -3393,8 +3393,8 @@ nfsspec_access(struct vop_access_args *ap) error = VOP_GETATTR(vp, vap, cred); if (error) goto out; - error = vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, - accmode, cred, NULL); + error = vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, + accmode, cred); out: return error; } Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -167,8 +167,8 @@ pfs_access(struct vop_access_args *va) error = VOP_GETATTR(vn, &vattr, va->a_cred); if (error) PFS_RETURN (error); - error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid, - vattr.va_gid, va->a_accmode, va->a_cred, NULL); + error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid, vattr.va_gid, + va->a_accmode, va->a_cred); PFS_RETURN (error); } Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -141,7 +141,7 @@ smbfs_access(ap) } mpmode = vp->v_type == VREG ? smp->sm_file_mode : smp->sm_dir_mode; return (vaccess(vp->v_type, mpmode, smp->sm_uid, - smp->sm_gid, ap->a_accmode, ap->a_cred, NULL)); + smp->sm_gid, ap->a_accmode, ap->a_cred)); } /* ARGSUSED */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -396,8 +396,8 @@ tmpfs_access(struct vop_access_args *v) goto out; } - error = vaccess(vp->v_type, node->tn_mode, node->tn_uid, - node->tn_gid, accmode, cred, NULL); + error = vaccess(vp->v_type, node->tn_mode, node->tn_uid, node->tn_gid, + accmode, cred); out: MPASS(VOP_ISLOCKED(vp)); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/udf/udf_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -180,7 +180,7 @@ udf_access(struct vop_access_args *a) mode = udf_permtomode(node); return (vaccess(vp->v_type, mode, node->fentry->uid, node->fentry->gid, - accmode, a->a_cred, NULL)); + accmode, a->a_cred)); } static int Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/subr_acl_nfs4.c Wed Aug 5 09:27:03 2020 (r363893) @@ -172,7 +172,7 @@ _acl_denies(const struct acl *aclp, int access_mask, s int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *aclp, accmode_t accmode, struct ucred *cred, int *privused) + struct acl *aclp, accmode_t accmode, struct ucred *cred) { accmode_t priv_granted = 0; int denied, explicitly_denied, access_mask, is_directory, @@ -187,9 +187,6 @@ vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_ KASSERT((accmode & VAPPEND) == 0 || (accmode & VWRITE), ("VAPPEND without VWRITE")); - if (privused != NULL) - *privused = 0; - if (accmode & VADMIN) must_be_owner = 1; @@ -289,9 +286,6 @@ vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_ priv_granted |= VSTAT_PERMS; if ((accmode & priv_granted) == accmode) { - if (privused != NULL) - *privused = 1; - return (0); } Modified: head/sys/kern/subr_acl_posix1e.c ============================================================================== --- head/sys/kern/subr_acl_posix1e.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/subr_acl_posix1e.c Wed Aug 5 09:27:03 2020 (r363893) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); */ int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *acl, accmode_t accmode, struct ucred *cred, int *privused) + struct acl *acl, accmode_t accmode, struct ucred *cred) { struct acl_entry *acl_other, *acl_mask; accmode_t dac_granted; @@ -77,8 +77,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g * privileges to use may be ambiguous due to "best match", in which * case fall back on first match for the time being. */ - if (privused != NULL) - *privused = 0; /* * Determine privileges now, but don't apply until we've found a DAC @@ -142,8 +140,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g */ if ((accmode & (dac_granted | priv_granted)) == accmode) { - if (privused != NULL) - *privused = 1; return (0); } goto error; @@ -220,8 +216,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g accmode) goto error; - if (privused != NULL) - *privused = 1; return (0); } } @@ -303,8 +297,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g != accmode) break; - if (privused != NULL) - *privused = 1; return (0); case ACL_GROUP: @@ -327,8 +319,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g != accmode) break; - if (privused != NULL) - *privused = 1; return (0); default: @@ -359,8 +349,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g * XXXRW: Do privilege lookup here. */ if ((accmode & (dac_granted | priv_granted)) == accmode) { - if (privused != NULL) - *privused = 1; return (0); } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_mqueue.c Wed Aug 5 09:27:03 2020 (r363893) @@ -1178,8 +1178,8 @@ mqfs_access(struct vop_access_args *ap) error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) return (error); - error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid, - vattr.va_gid, ap->a_accmode, ap->a_cred, NULL); + error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid, vattr.va_gid, + ap->a_accmode, ap->a_cred); return (error); } @@ -2088,7 +2088,7 @@ kern_kmq_open(struct thread *td, const char *upath, in if (flags & FWRITE) accmode |= VWRITE; error = vaccess(VREG, pn->mn_mode, pn->mn_uid, - pn->mn_gid, accmode, td->td_ucred, NULL); + pn->mn_gid, accmode, td->td_ucred); } } @@ -2566,7 +2566,7 @@ mqf_chmod(struct file *fp, mode_t mode, struct ucred * pn = fp->f_data; sx_xlock(&mqfs_data.mi_lock); error = vaccess(VREG, pn->mn_mode, pn->mn_uid, pn->mn_gid, VADMIN, - active_cred, NULL); + active_cred); if (error != 0) goto out; pn->mn_mode = mode & ACCESSPERMS; Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_sem.c Wed Aug 5 09:27:03 2020 (r363893) @@ -212,7 +212,7 @@ ksem_chmod(struct file *fp, mode_t mode, struct ucred goto out; #endif error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, VADMIN, - active_cred, NULL); + active_cred); if (error != 0) goto out; ks->ks_mode = mode & ACCESSPERMS; @@ -362,7 +362,7 @@ ksem_access(struct ksem *ks, struct ucred *ucred) int error; error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, - VREAD | VWRITE, ucred, NULL); + VREAD | VWRITE, ucred); if (error) error = priv_check_cred(ucred, PRIV_SEM_WRITE); return (error); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_shm.c Wed Aug 5 09:27:03 2020 (r363893) @@ -679,7 +679,7 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, i accmode |= VWRITE; mtx_lock(&shm_timestamp_lock); error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, - accmode, ucred, NULL); + accmode, ucred); mtx_unlock(&shm_timestamp_lock); return (error); } @@ -1240,8 +1240,8 @@ shm_chmod(struct file *fp, mode_t mode, struct ucred * if (error != 0) goto out; #endif - error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, - shmfd->shm_gid, VADMIN, active_cred, NULL); + error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, + VADMIN, active_cred); if (error != 0) goto out; shmfd->shm_mode = mode & ACCESSPERMS; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/vfs_subr.c Wed Aug 5 09:27:03 2020 (r363893) @@ -5299,14 +5299,12 @@ vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gi /* * Common filesystem object access control check routine. Accepts a - * vnode's type, "mode", uid and gid, requested access mode, credentials, - * and optional call-by-reference privused argument allowing vaccess() - * to indicate to the caller whether privilege was used to satisfy the - * request (obsoleted). Returns 0 on success, or an errno on failure. + * vnode's type, "mode", uid and gid, requested access mode, and credentials. + * Returns 0 on success, or an errno on failure. */ int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, - accmode_t accmode, struct ucred *cred, int *privused) + accmode_t accmode, struct ucred *cred) { accmode_t dac_granted; accmode_t priv_granted; @@ -5321,9 +5319,6 @@ vaccess(enum vtype type, mode_t file_mode, uid_t file_ * as requested. If it exists, go with that. */ - if (privused != NULL) - *privused = 0; - dac_granted = 0; /* Check the owner. */ @@ -5409,9 +5404,6 @@ privcheck: priv_granted |= VADMIN; if ((accmode & (priv_granted | dac_granted)) == accmode) { - /* XXX audit: privilege used */ - if (privused != NULL) - *privused = 1; return (0); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/sys/vnode.h Wed Aug 5 09:27:03 2020 (r363893) @@ -667,16 +667,14 @@ int vn_commname(struct vnode *vn, char *buf, u_int buf int vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, u_int pathlen); int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, - gid_t file_gid, accmode_t accmode, struct ucred *cred, - int *privused); + gid_t file_gid, accmode_t accmode, struct ucred *cred); int vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred); int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *aclp, accmode_t accmode, struct ucred *cred, - int *privused); + struct acl *aclp, accmode_t accmode, struct ucred *cred); int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *acl, accmode_t accmode, - struct ucred *cred, int *privused); + struct ucred *cred); void vattr_null(struct vattr *vap); int vcount(struct vnode *vp); void vlazy(struct vnode *); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -390,12 +390,12 @@ ufs_accessx(ap) case 0: if (type == ACL_TYPE_NFS4) { error = vaccess_acl_nfs4(vp->v_type, ip->i_uid, - ip->i_gid, acl, accmode, ap->a_cred, NULL); + ip->i_gid, acl, accmode, ap->a_cred); } else { error = vfs_unixify_accmode(&accmode); if (error == 0) error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, - ip->i_gid, acl, accmode, ap->a_cred, NULL); + ip->i_gid, acl, accmode, ap->a_cred); } break; default: @@ -410,8 +410,8 @@ ufs_accessx(ap) */ error = vfs_unixify_accmode(&accmode); if (error == 0) - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, accmode, ap->a_cred, NULL); + error = vaccess(vp->v_type, ip->i_mode, + ip->i_uid, ip->i_gid, accmode, ap->a_cred); } acl_free(acl); @@ -421,7 +421,7 @@ ufs_accessx(ap) error = vfs_unixify_accmode(&accmode); if (error == 0) error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - accmode, ap->a_cred, NULL); + accmode, ap->a_cred); return (error); } From owner-svn-src-head@freebsd.org Wed Aug 5 09:27: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 332643AFC2B; Wed, 5 Aug 2020 09:27:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5rV0Vnsz4b1T; Wed, 5 Aug 2020 09:27:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E905C1418D; Wed, 5 Aug 2020 09:27:53 +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 0759Rrj8011209; Wed, 5 Aug 2020 09:27:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759RrBG011208; Wed, 5 Aug 2020 09:27:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050927.0759RrBG011208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363894 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:27:54 -0000 Author: mjg Date: Wed Aug 5 09:27:53 2020 New Revision: 363894 URL: https://svnweb.freebsd.org/changeset/base/363894 Log: Bump __FreeBSD_version after vaccess() change Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Aug 5 09:27:03 2020 (r363893) +++ head/sys/sys/param.h Wed Aug 5 09:27:53 2020 (r363894) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300104 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300105 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Aug 5 09:38: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 560F7370033; Wed, 5 Aug 2020 09:38:03 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM64C1g7Rz4bkH; Wed, 5 Aug 2020 09:38:03 +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 1CEA9141A1; Wed, 5 Aug 2020 09:38:03 +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 0759c28h017833; Wed, 5 Aug 2020 09:38:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759c2HH017832; Wed, 5 Aug 2020 09:38:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050938.0759c2HH017832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363895 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 09:38:03 -0000 Author: mjg Date: Wed Aug 5 09:38:02 2020 New Revision: 363895 URL: https://svnweb.freebsd.org/changeset/base/363895 Log: cache: don't ignore size passed to nchinittbl Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:27:53 2020 (r363894) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:38:02 2020 (r363895) @@ -2070,7 +2070,7 @@ nchinittbl(u_long elements, u_long *hashmask) struct nchashhead *hashtbl; u_long hashsize, i; - hashsize = cache_roundup_2(desiredvnodes * 2) / 2; + hashsize = cache_roundup_2(elements) / 2; hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), M_VFSCACHE, M_WAITOK); for (i = 0; i < hashsize; i++) From owner-svn-src-head@freebsd.org Wed Aug 5 10:27: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 11E49370C4D; Wed, 5 Aug 2020 10:27:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM78v6X59z4fDq; Wed, 5 Aug 2020 10:27:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEF59148E6; Wed, 5 Aug 2020 10:27:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075ARBRi048324; Wed, 5 Aug 2020 10:27:11 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075ARB4Y048323; Wed, 5 Aug 2020 10:27:11 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051027.075ARB4Y048323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 10:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363900 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 363900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 10:27:12 -0000 Author: ae Date: Wed Aug 5 10:27:11 2020 New Revision: 363900 URL: https://svnweb.freebsd.org/changeset/base/363900 Log: Fix typo. Submitted by: Evgeniy Khramtsov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25932 Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Aug 5 10:12:19 2020 (r363899) +++ head/sys/netinet6/in6_proto.c Wed Aug 5 10:27:11 2020 (r363900) @@ -586,7 +586,7 @@ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK "Create a loopback route when configuring an IPv6 address"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, - "Mask of enabled RF4620 node information query types"); + "Mask of enabled RFC4620 node information query types"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, nodeinfo_oldmcprefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, From owner-svn-src-head@freebsd.org Wed Aug 5 11:26: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 9888D3727AF; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8T33XgSz4jKS; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CED21545D; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BQFoR085307; Wed, 5 Aug 2020 11:26:15 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BQF6W085306; Wed, 5 Aug 2020 11:26:15 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008051126.075BQF6W085306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 5 Aug 2020 11:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363903 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:26:15 -0000 Author: 0mp (doc,ports committer) Date: Wed Aug 5 11:26:14 2020 New Revision: 363903 URL: https://svnweb.freebsd.org/changeset/base/363903 Log: Do not describe portsnap(8) as a way to manage /usr/ports Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Aug 5 11:11:31 2020 (r363902) +++ head/share/man/man7/build.7 Wed Aug 5 11:26:14 2020 (r363903) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2020 +.Dd August 5, 2020 .Dt BUILD 7 .Os .Sh NAME @@ -41,10 +41,8 @@ and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with .Xr svn 1 -or -.Xr svnlite 1 -or -.Xr portsnap 8 . +(or +.Xr svnlite 1 ) . Directory .Pa /usr/src contains the @@ -852,7 +850,6 @@ manpage first appeared in .Xr tests 7 , .Xr config 8 , .Xr mergemaster 8 , -.Xr portsnap 8 , .Xr reboot 8 , .Xr shutdown 8 .Sh AUTHORS From owner-svn-src-head@freebsd.org Wed Aug 5 11:26: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 379BA372882; Wed, 5 Aug 2020 11:26:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8Tk0l39z4jN1; Wed, 5 Aug 2020 11:26:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0F3915717; Wed, 5 Aug 2020 11:26:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BQnQP085386; Wed, 5 Aug 2020 11:26:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BQnMi085384; Wed, 5 Aug 2020 11:26:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051126.075BQnMi085384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363904 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 363904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:26:50 -0000 Author: ae Date: Wed Aug 5 11:26:49 2020 New Revision: 363904 URL: https://svnweb.freebsd.org/changeset/base/363904 Log: Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted. Submitted by: Evgeniy Khramtsov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25734 Modified: head/sbin/ipfw/nat64clat.c head/sbin/ipfw/nat64stl.c Modified: head/sbin/ipfw/nat64clat.c ============================================================================== --- head/sbin/ipfw/nat64clat.c Wed Aug 5 11:26:14 2020 (r363903) +++ head/sbin/ipfw/nat64clat.c Wed Aug 5 11:26:49 2020 (r363904) @@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac if ((p = strchr(*av, '/')) != NULL) *p++ = '\0'; + else + errx(EX_USAGE, + "Prefix length required: %s", *av); if (inet_pton(AF_INET6, *av, &prefix) != 1) errx(EX_USAGE, "Bad prefix: %s", *av); Modified: head/sbin/ipfw/nat64stl.c ============================================================================== --- head/sbin/ipfw/nat64stl.c Wed Aug 5 11:26:14 2020 (r363903) +++ head/sbin/ipfw/nat64stl.c Wed Aug 5 11:26:49 2020 (r363904) @@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac, NEED1("IPv6 prefix6 required"); if ((p = strchr(*av, '/')) != NULL) *p++ = '\0'; + else + errx(EX_USAGE, + "Prefix length required: %s", *av); if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1) errx(EX_USAGE, "Bad prefix: %s", *av); From owner-svn-src-head@freebsd.org Wed Aug 5 11:38: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 8FC313728F8; Wed, 5 Aug 2020 11:38:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8lG39kBz4jw3; Wed, 5 Aug 2020 11:38:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C4A51586E; Wed, 5 Aug 2020 11:38:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BcY49091714; Wed, 5 Aug 2020 11:38:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BcYeh091713; Wed, 5 Aug 2020 11:38:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202008051138.075BcYeh091713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 5 Aug 2020 11:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363905 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 363905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:38:34 -0000 Author: avg Date: Wed Aug 5 11:38:33 2020 New Revision: 363905 URL: https://svnweb.freebsd.org/changeset/base/363905 Log: gpiokeys: add a basic manual page Reviewed by: manu, bjk, 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25939 Added: head/share/man/man4/gpiokeys.4 (contents, props changed) Added: head/share/man/man4/gpiokeys.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/gpiokeys.4 Wed Aug 5 11:38:33 2020 (r363905) @@ -0,0 +1,152 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Andriy Gapon +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 5, 2020 +.Dt GPIOKEYS 4 +.Os +.Sh NAME +.Nm gpiokeys +.Nd GPIO keys device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options FDT" +.Cd "device gpio" +.Cd "device gpiokeys" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +gpiokeys_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides a way to represent a set of general purpose inputs as a +.Xr keyboard 4 +device. +At the moment the driver supports only +.Xr FDT 4 +based systems. +The DTS determines what pins are mapped to buttons and what key codes are +generated for each virtual button. +The +.Xr keyboard 4 +device can be used from userland to monitor for input changes. +.Pp +On an +.Xr FDT 4 +based system +the DTS part for a +.Nm +device usually looks like: +.Bd -literal +/ { + + ... + + gpio_keys { + compatible = "gpio-keys"; + + btn1 { + label = "button1"; + linux,code = ; + gpios = <&gpio 0 3 GPIO_ACTIVE_LOW> + }; + + btn2 { + label = "button2"; + linux,code = ; + gpios = <&gpio 0 4 GPIO_ACTIVE_LOW> + }; + }; +}; +.Ed +.Pp +For more details about the +.Va gpios +property, please consult +.Pa /usr/src/sys/dts/bindings-gpio.txt . +.Pp +The +.Nm +driver supports two properties for specifying a key code. +.Pp +The property +.Va freebsd,code +specifies a +.Fx +native scancode compatible with +.Xr kbdmap 5 +keyboard maps. +.Pp +The property +.Va linux,code +specifies an evdev scancode. +That scancode is internally translated to a native scancode. +Note that not all evdev scancodes have corresponding native scancodes. +If a scancode cannot be translated, then a diagnostic message is printed +and the input is ignored. +.Pp +The property +.Va label +is a descriptive name of a button. +It is used for diagnostic messages only. +This property is optional. +If not set, the node name is used in its place. +.Pp +The property +.Va autorepeat +determines whether autorepeat is enabled for a button. +.Pp +The property +.Va debounce-interval +defines debouncing interval time in milliseconds. +If not specified the interval defaults to 5. +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 , +.Xr keyboard 4 , +.Xr kbdmap 5 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 12.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . +This +manual page was written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . From owner-svn-src-head@freebsd.org Wed Aug 5 11:39: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 5DD33372A3B; Wed, 5 Aug 2020 11:39:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8ly1pb4z4k0F; Wed, 5 Aug 2020 11:39:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2136615655; Wed, 5 Aug 2020 11:39:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075Bd9sF091788; Wed, 5 Aug 2020 11:39:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bd9Be091785; Wed, 5 Aug 2020 11:39:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051139.075Bd9Be091785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363906 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:39:10 -0000 Author: ae Date: Wed Aug 5 11:39:09 2020 New Revision: 363906 URL: https://svnweb.freebsd.org/changeset/base/363906 Log: Add m__getjcl SDT probe. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/kern/kern_mbuf.c Wed Aug 5 11:39:09 2020 (r363906) @@ -1397,6 +1397,7 @@ m_getjcl(int how, short type, int flags, int size) uma_zfree(zone_mbuf, m); return (NULL); } + MBUF_PROBE5(m__getjcl, how, type, flags, size, m); return (m); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/kern/uipc_mbuf.c Wed Aug 5 11:39:09 2020 (r363906) @@ -78,6 +78,13 @@ SDT_PROBE_DEFINE4_XLATE(sdt, , , m__getcl, "uint32_t", "uint32_t", "struct mbuf *", "mbufinfo_t *"); +SDT_PROBE_DEFINE5_XLATE(sdt, , , m__getjcl, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t", + "struct mbuf *", "mbufinfo_t *"); + SDT_PROBE_DEFINE3_XLATE(sdt, , , m__clget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/sys/mbuf.h Wed Aug 5 11:39:09 2020 (r363906) @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(sdt, , , m__init); SDT_PROBE_DECLARE(sdt, , , m__gethdr); SDT_PROBE_DECLARE(sdt, , , m__get); SDT_PROBE_DECLARE(sdt, , , m__getcl); +SDT_PROBE_DECLARE(sdt, , , m__getjcl); SDT_PROBE_DECLARE(sdt, , , m__clget); SDT_PROBE_DECLARE(sdt, , , m__cljget); SDT_PROBE_DECLARE(sdt, , , m__cljset); From owner-svn-src-head@freebsd.org Wed Aug 5 11:41: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 9BB86372A66; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8pt3jWFz4kLR; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B0E1587C; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BfgZB094953; Wed, 5 Aug 2020 11:41:42 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BfgT2094952; Wed, 5 Aug 2020 11:41:42 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008051141.075BfgT2094952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Wed, 5 Aug 2020 11:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363907 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:41:42 -0000 Author: gbe (doc committer) Date: Wed Aug 5 11:41:41 2020 New Revision: 363907 URL: https://svnweb.freebsd.org/changeset/base/363907 Log: environ(7): Update the description and include some more environment variables - Add a better introduction to the DESCRIPTION section - Add a description for MANPATH and POSIXLY_CORRECT - Asorted improvements for the usage of some macros PR: 43823 Submitted by: Lyndon Nerenberg Reviewed by: 0mp, bcr Approved by: 0mp, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25912 Modified: head/share/man/man7/environ.7 Modified: head/share/man/man7/environ.7 ============================================================================== --- head/share/man/man7/environ.7 Wed Aug 5 11:39:09 2020 (r363906) +++ head/share/man/man7/environ.7 Wed Aug 5 11:41:41 2020 (r363907) @@ -28,7 +28,7 @@ .\" @(#)environ.7 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 14, 2020 +.Dd August 5, 2020 .Dt ENVIRON 7 .Os .Sh NAME @@ -37,21 +37,59 @@ .Sh SYNOPSIS .Ar extern char **environ ; .Sh DESCRIPTION -An array of strings called the +An array of strings, called the .Ar environment -is made available by +is made available to each process by .Xr execve 2 when a process begins. By convention these strings have the form -.Dq Ar name=value . -The following names are used by various commands: -.Bl -tag -width LC_MONETARY +.Va name Ns No = Ns Ar value , +and are referred to as +.Dq environment variables . +A process can query, update, and delete these strings using the +.Xr getenv 3 , +.Xr setenv 3 , +and +.Xr unsetenv 3 +functions, respectively. +The shells also provide commands to manipulate the environment; +they are described in the respective shell manual pages. +.Pp +What follows is a list of environment variables typically +seen on a +.Ux +system. +It includes only those variables that a user can expect to see during their +day-to-day use of the system, and is far from complete. +Environment variables specific to a particular program or library function +are documented in the +.Sx ENVIRONMENT +section of the appropriate manual page. +.Sh ENVIRONMENT +.Bl -tag -width LD_LIBRARY_PATH .It Ev BLOCKSIZE -The size of the block units used by several commands, most notably +The size of the block units used by several disk-related commands, +most notably .Xr df 1 , .Xr du 1 and .Xr ls 1 . +.Ev BLOCKSIZE +may be specified in units of a byte by specifying a number, +in units of a kilobyte by specifying a number followed by +.Ql K +or +.Ql k , +in units of a megabyte by specifying a number followed by +.Ql M +or +.Ql m , +and in units of a gigabyte by specifying a number followed +by +.Ql G +or +.Ql g . +Sizes less than 512 bytes or greater than a gigabyte are ignored. This variable is processed by the .Xr getbsize 3 function. @@ -117,6 +155,10 @@ used by .Xr mail 1 , .Xr sh 1 , and many other mail clients. +.It Ev MANPATH +The sequence of directories, separated by colons, searched by +.Xr man 1 +when looking for manual pages. .It Ev NLSPATH List of directories to be searched for the message catalog referred to by .Ev LC_MESSAGES . @@ -139,6 +181,9 @@ etc, when looking for an executable file. .Ev PATH is set to ``/usr/bin:/bin'' initially by .Xr login 1 . +.It Ev POSIXLY_CORRECT +When set to any value, this environment variable modifies the behaviour +of certain commands to (mostly) execute in a strictly POSIX-compliant manner. .It Ev PRINTER The name of the default printer to be used by .Xr lpr 1 , @@ -178,7 +223,7 @@ no is equivalent to a .Ev TERMPATH of -.Dq Pa $HOME/.termcap:/etc/termcap . +.Pa $HOME/.termcap:/etc/termcap . .Ev TERMPATH is ignored if .Ev TERMCAP @@ -186,22 +231,27 @@ contains a full pathname. .It Ev TMPDIR The directory in which to store temporary files. Most applications use either -.Dq /tmp +.Pa /tmp or -.Dq /var/tmp . +.Pa /var/tmp . Setting this variable will make them use another directory. .It Ev TZ The timezone to use when displaying dates. The normal format is a pathname relative to -.Dq Pa /usr/share/zoneinfo . +.Pa /usr/share/zoneinfo . For example, the command -.Dq env TZ=America/Los_Angeles date +.Pp +.Dl env TZ=America/Los_Angeles date +.Pp displays the current time in California. See .Xr tzset 3 for more information. .It Ev USER The login name of the user. +It is recommended that portable applications use +.Ev LOGNAME +instead. .El .Pp Further names may be placed in the environment by the From owner-svn-src-head@freebsd.org Wed Aug 5 11:54: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 AF92C3731DA; Wed, 5 Aug 2020 11:54:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM95648Ntz4lJm; Wed, 5 Aug 2020 11:54:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71346158C0; Wed, 5 Aug 2020 11:54:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075Bs2mP004010; Wed, 5 Aug 2020 11:54:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bs2pj004009; Wed, 5 Aug 2020 11:54:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051154.075Bs2pj004009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363908 - head/share/dtrace X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/share/dtrace X-SVN-Commit-Revision: 363908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:54:02 -0000 Author: ae Date: Wed Aug 5 11:54:02 2020 New Revision: 363908 URL: https://svnweb.freebsd.org/changeset/base/363908 Log: Synchronize definitions in mbuf.d with values from mbuf.h Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/share/dtrace/mbuf.d Modified: head/share/dtrace/mbuf.d ============================================================================== --- head/share/dtrace/mbuf.d Wed Aug 5 11:41:41 2020 (r363907) +++ head/share/dtrace/mbuf.d Wed Aug 5 11:54:02 2020 (r363908) @@ -53,37 +53,41 @@ inline int M_MCAST = 0x00000020; /* send/received as l inline int M_PROMISC = 0x00000040; /* packet was not for us */ #pragma D binding "1.6.3" M_VLANTAG inline int M_VLANTAG = 0x00000080; /* ether_vtag is valid */ -#pragma D binding "1.6.3" M_UNUSED_8 -inline int M_UNUSED_8 = 0x00000100; /* --available-- */ +#pragma D binding "1.13" M_EXTPG +inline int M_EXTPG = 0x00000100; /* has array of unmapped pages and TLS */ #pragma D binding "1.6.3" M_NOFREE inline int M_NOFREE = 0x00000200; /* do not free mbuf, embedded in cluster */ +#pragma D binding "1.13" M_TSTMP +inline int M_TSTMP = 0x00000400; /* rcv_tstmp field is valid */ +#pragma D binding "1.13" M_TSTMP_HPREC +inline int M_TSTMP_HPREC = 0x00000800; /* rcv_tstmp is high-prec */ +#pragma D binding "1.13" M_TSTMP_LRO +inline int M_TSTMP_LRO = 0x00001000; /* Time LRO pushed in pkt is valid */ + +#pragma D binding "1.13" M_PROTO1 +inline int M_PROTO1 = 0x00002000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO2 +inline int M_PROTO2 = 0x00004000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO3 +inline int M_PROTO3 = 0x00008000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO4 +inline int M_PROTO4 = 0x00010000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO5 +inline int M_PROTO5 = 0x00020000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO6 +inline int M_PROTO6 = 0x00040000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO7 +inline int M_PROTO7 = 0x00080000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO8 +inline int M_PROTO8 = 0x00100000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO9 +inline int M_PROTO9 = 0x00200000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO10 +inline int M_PROTO10 = 0x00400000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO11 +inline int M_PROTO11 = 0x00800000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO1 -inline int M_PROTO1 = 0x00001000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO2 -inline int M_PROTO2 = 0x00002000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO3 -inline int M_PROTO3 = 0x00004000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO4 -inline int M_PROTO4 = 0x00008000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO5 -inline int M_PROTO5 = 0x00010000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO6 -inline int M_PROTO6 = 0x00020000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO7 -inline int M_PROTO7 = 0x00040000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO8 -inline int M_PROTO8 = 0x00080000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO9 -inline int M_PROTO9 = 0x00100000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO10 -inline int M_PROTO10 = 0x00200000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO11 -inline int M_PROTO11 = 0x00400000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO12 -inline int M_PROTO12 = 0x00800000; /* protocol-specific */ - -#pragma D binding "1.6.3" mbufflags_string +#pragma D binding "1.13" mbufflags_string inline string mbufflags_string[uint32_t flags] = flags & M_EXT ? "M_EXT" : flags & M_PKTHDR ? "M_PKTHDR" : @@ -93,8 +97,11 @@ inline string mbufflags_string[uint32_t flags] = flags & M_MCAST ? "M_MCAST" : flags & M_PROMISC ? "M_PROMISC" : flags & M_VLANTAG ? "M_VLANTAG" : - flags & M_UNUSED_8 ? "M_UNUSED_8" : - flags & M_NOFREE ? "M_NOFREE" : + flags & M_EXTPG ? "M_EXTPG" : + flags & M_NOFREE ? "M_NOFREE" : + flags & M_TSTMP ? "M_TSTMP" : + flags & M_TSTMP_HPREC ? "M_TSTMP_HPREC" : + flags & M_TSTMP_LRO ? "M_TSTMP_LRO" : flags & M_PROTO1 ? "M_PROTO1" : flags & M_PROTO2 ? "M_PROTO2" : flags & M_PROTO3 ? "M_PROTO3" : @@ -106,7 +113,6 @@ inline string mbufflags_string[uint32_t flags] = flags & M_PROTO9 ? "M_PROTO9" : flags & M_PROTO10 ? "M_PROTO10" : flags & M_PROTO11 ? "M_PROTO11" : - flags & M_PROTO12 ? "M_PROTO12" : "none" ; typedef struct mbufinfo { From owner-svn-src-head@freebsd.org Wed Aug 5 11:54: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 58FC6373614; Wed, 5 Aug 2020 11:54:52 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM9641h8xz4lkp; Wed, 5 Aug 2020 11:54:52 +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 1CE9B15A53; Wed, 5 Aug 2020 11:54:52 +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 075BsqX8004101; Wed, 5 Aug 2020 11:54:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bsp0f004100; Wed, 5 Aug 2020 11:54:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008051154.075Bsp0f004100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 5 Aug 2020 11:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363909 - in head/sys: arm64/conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/conf riscv/conf X-SVN-Commit-Revision: 363909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 11:54:52 -0000 Author: andrew Date: Wed Aug 5 11:54:51 2020 New Revision: 363909 URL: https://svnweb.freebsd.org/changeset/base/363909 Log: Add DDB_CTF to the arm64 and riscv kernel configs This allows DTrace fbt probes to find arguments. Sponsored by: Innovate UK Modified: head/sys/arm64/conf/GENERIC head/sys/riscv/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 5 11:54:02 2020 (r363908) +++ head/sys/arm64/conf/GENERIC Wed Aug 5 11:54:51 2020 (r363909) @@ -72,6 +72,7 @@ options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options VFP # Floating-point support options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Aug 5 11:54:02 2020 (r363908) +++ head/sys/riscv/conf/GENERIC Wed Aug 5 11:54:51 2020 (r363909) @@ -67,6 +67,7 @@ options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options FPE # Floating-point extension support options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default From owner-svn-src-head@freebsd.org Wed Aug 5 14: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 4938B3773F3; Wed, 5 Aug 2020 14:08:45 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMD4Y18DVz4sPC; Wed, 5 Aug 2020 14:08:45 +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 0B89A16EDA; Wed, 5 Aug 2020 14:08:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075E8i7B083447; Wed, 5 Aug 2020 14:08:44 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075E8iG6083446; Wed, 5 Aug 2020 14:08:44 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008051408.075E8iG6083446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Aug 2020 14:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363910 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 363910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 14:08:45 -0000 Author: tsoome Date: Wed Aug 5 14:08:44 2020 New Revision: 363910 URL: https://svnweb.freebsd.org/changeset/base/363910 Log: zfs_keys_nextboot array is missing ZPOOL_CONFIG_POOL_GUID and ZPOOL_CONFIG_GUID As we do check the incomint nvlist, we either need to list all possible keys or use wildcard. PR: 248462 Reported by: larafercue@gmail.com Sponsored by: Netflix, Klara Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 11:54:51 2020 (r363909) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:08:44 2020 (r363910) @@ -3656,7 +3656,9 @@ zfs_ioc_log_history(const char *unused, nvlist_t *innv #ifdef __FreeBSD__ static const zfs_ioc_key_t zfs_keys_nextboot[] = { - {"command", DATA_TYPE_STRING, 0}, + {"command", DATA_TYPE_STRING, 0}, + {ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, 0}, + {ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, 0} }; static int From owner-svn-src-head@freebsd.org Wed Aug 5 14:32: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 463C2377EDC; Wed, 5 Aug 2020 14:32: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMDbq1Wj9z4ts3; Wed, 5 Aug 2020 14:32: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 18D4F1775F; Wed, 5 Aug 2020 14:32: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 075EWN2q001387; Wed, 5 Aug 2020 14:32:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075EWK8Y001375; Wed, 5 Aug 2020 14:32:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008051432.075EWK8Y001375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Aug 2020 14:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363911 - in head: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/commo... X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib... X-SVN-Commit-Revision: 363911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 14:32:23 -0000 Author: tsoome Date: Wed Aug 5 14:32:20 2020 New Revision: 363911 URL: https://svnweb.freebsd.org/changeset/base/363911 Log: MFOpenZFS: Add support for boot environment data to be stored in the label We are building new bootonce mechanism (previously zfs bootnext) and it is based on this OpenZFS change. Since this patch is nicely self contained, I am commiting it as is, and we can stack our changes. Original patch description follows: Modern bootloaders leverage data stored in the root filesystem to enable some of their powerful features. GRUB specifically has a grubenv file which can store large amounts of configuration data that can be read and written at boot time and during normal operation. This allows sysadmins to configure useful features like automated failover after failed boot attempts. Unfortunately, due to the Copy-on-Write nature of ZFS, the standard behavior of these tools cannot handle writing to ZFS files safely at boot time. We need an alternative way to store data that allows the bootloader to make changes to the data. This work is very similar to work that was done on Illumos to enable similar functionality in the FreeBSD bootloader. This patch is different in that the data being stored is a raw grubenv file; this file can store arbitrary variables and values, and the scripting provided by grub is powerful enough that special structures are not required to implement advanced behavior. We repurpose the second padding area in each label to store the grubenv file, protected by an embedded checksum. We add two ioctls to get and set this data, and libzfs_core and libzfs functions to access them more easily. There are no direct command line interfaces to these functions; these will be added directly to the bootloader utilities. Reviewed-by: Pavel Zakharov Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Paul Dagnelie Closes #10009 Obtained from: OpenZFS Sponsored by: Netflix, Klara Inc. Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/translate.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/cmd/zinject/translate.c Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. */ #include @@ -484,7 +484,7 @@ translate_device(const char *pool, const char *device, record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1; break; case TYPE_LABEL_PAD2: - record->zi_start = offsetof(vdev_label_t, vl_pad2); + record->zi_start = offsetof(vdev_label_t, vl_be); record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1; break; } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 5 14:32:20 2020 (r363911) @@ -837,6 +837,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s extern int zpool_read_label(int, nvlist_t **); extern int zpool_read_all_labels(int, nvlist_t **); extern int zpool_clear_label(int); +extern int zpool_set_bootenv(zpool_handle_t *, const char *); +extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t); /* is this zvol valid for use as a dump device? */ extern int zvol_check_dump_config(char *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov @@ -395,7 +395,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, * Assuming bootfs is a valid dataset name. */ static boolean_t -bootfs_name_valid(const char *pool, char *bootfs) +bootfs_name_valid(const char *pool, const char *bootfs) { int len = strlen(pool); @@ -4231,6 +4231,42 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, obj); } free(mntpnt); +} + +int +zpool_set_bootenv(zpool_handle_t *zhp, const char *envmap) +{ + int error = lzc_set_bootenv(zhp->zpool_name, envmap); + if (error != 0) { + (void) zpool_standard_error_fmt(zhp->zpool_hdl, error, + dgettext(TEXT_DOMAIN, + "error setting bootenv in pool '%s'"), zhp->zpool_name); + } + + return (error); +} + +int +zpool_get_bootenv(zpool_handle_t *zhp, char *outbuf, size_t size, off_t offset) +{ + nvlist_t *nvl; + int error = lzc_get_bootenv(zhp->zpool_name, &nvl);; + if (error != 0) { + (void) zpool_standard_error_fmt(zhp->zpool_hdl, error, + dgettext(TEXT_DOMAIN, + "error getting bootenv in pool '%s'"), zhp->zpool_name); + return (-1); + } + char *envmap = fnvlist_lookup_string(nvl, "envmap"); + if (offset >= strlen(envmap)) { + fnvlist_free(nvl); + return (0); + } + + strlcpy(outbuf, envmap + offset, size); + int bytes = MIN(strlen(envmap + offset), size); + fnvlist_free(nvl); + return (bytes); } #ifdef illumos Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. @@ -1209,4 +1209,26 @@ lzc_initialize(const char *poolname, pool_initialize_f fnvlist_free(args); return (error); +} + +/* + * Set the bootenv contents for the given pool. + */ +int +lzc_set_bootenv(const char *pool, const char *env) +{ + nvlist_t *args = fnvlist_alloc(); + fnvlist_add_string(args, "envmap", env); + int error = lzc_ioctl(ZFS_IOC_SET_BOOTENV, pool, args, NULL); + fnvlist_free(args); + return (error); +} + +/* + * Get the contents of the bootenv of the given pool. + */ +int +lzc_get_bootenv(const char *pool, nvlist_t **outnvl) +{ + return (lzc_ioctl(ZFS_IOC_GET_BOOTENV, pool, NULL, outnvl)); } Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2013 by Martin Matuska . All rights reserved. * Copyright 2017 RackTop Systems. * Copyright (c) 2017 Datto Inc. @@ -105,6 +105,8 @@ int lzc_channel_program_nosync(const char *, const cha int lzc_pool_checkpoint(const char *); int lzc_pool_checkpoint_discard(const char *); +int lzc_set_bootenv(const char *, const char *); +int lzc_get_bootenv(const char *, nvlist_t **); #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. */ @@ -173,6 +173,8 @@ extern nvlist_t *vdev_label_read_config(vdev_t *vd, ui extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); +extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); +extern int vdev_label_write_bootenv(vdev_t *, char *); typedef enum { VDEV_LABEL_CREATE, /* create/add a new device */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2018 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. */ @@ -392,7 +392,7 @@ struct vdev { #define VDEV_RAIDZ_MAXPARITY 3 #define VDEV_PAD_SIZE (8 << 10) -/* 2 padding areas (vl_pad1 and vl_pad2) to skip */ +/* 2 padding areas (vl_pad1 and vl_be) to skip */ #define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2 #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) @@ -419,9 +419,29 @@ typedef struct vdev_phys { zio_eck_t vp_zbt; } vdev_phys_t; +typedef enum vbe_vers { + /* The bootenv file is stored as ascii text in the envblock */ + VB_RAW = 0, + + /* + * The bootenv file is converted to an nvlist and then packed into the + * envblock. + */ + VB_NVLIST = 1 +} vbe_vers_t; + +typedef struct vdev_boot_envblock { + uint64_t vbe_version; + char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) - + sizeof (zio_eck_t)]; + zio_eck_t vbe_zbt; +} vdev_boot_envblock_t; + +CTASSERT(sizeof (vdev_boot_envblock_t) == VDEV_PAD_SIZE); + typedef struct vdev_label { char vl_pad1[VDEV_PAD_SIZE]; /* 8K */ - char vl_pad2[VDEV_PAD_SIZE]; /* 8K */ + vdev_boot_envblock_t vl_be; /* 8K */ vdev_phys_t vl_vdev_phys; /* 112K */ char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */ } vdev_label_t; /* 256K total */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 5 14:32:20 2020 (r363911) @@ -1566,7 +1566,7 @@ vdev_probe(vdev_t *vd, zio_t *zio) for (int l = 1; l < VDEV_LABELS; l++) { zio_nowait(zio_read_phys(pio, vd, vdev_label_offset(vd->vdev_psize, l, - offsetof(vdev_label_t, vl_pad2)), VDEV_PAD_SIZE, + offsetof(vdev_label_t, vl_be)), VDEV_PAD_SIZE, abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE), ZIO_CHECKSUM_OFF, vdev_probe_done, vps, ZIO_PRIORITY_SYNC_READ, vps->vps_flags, B_TRUE)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. * Copyright 2019 Joyent, Inc. */ @@ -781,7 +781,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label nvlist_t *label; vdev_phys_t *vp; abd_t *vp_abd; - abd_t *pad2; + abd_t *bootenv; uberblock_t *ub; abd_t *ub_abd; zio_t *zio; @@ -956,8 +956,8 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label ub->ub_txg = 0; /* Initialize the 2nd padding area. */ - pad2 = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); - abd_zero(pad2, VDEV_PAD_SIZE); + bootenv = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); + abd_zero(bootenv, VDEV_PAD_SIZE); /* * Write everything in parallel. @@ -976,8 +976,8 @@ retry: * Zero out the 2nd padding area where it might have * left over data from previous filesystem format. */ - vdev_label_write(zio, vd, l, pad2, - offsetof(vdev_label_t, vl_pad2), + vdev_label_write(zio, vd, l, bootenv, + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, NULL, NULL, flags); vdev_label_write(zio, vd, l, ub_abd, @@ -993,7 +993,7 @@ retry: } nvlist_free(label); - abd_free(pad2); + abd_free(bootenv); abd_free(ub_abd); abd_free(vp_abd); @@ -1016,7 +1016,149 @@ retry: return (error); } +/* + * Done callback for vdev_label_read_bootenv_impl. If this is the first + * callback to finish, store our abd in the callback pointer. Otherwise, we + * just free our abd and return. + */ +static void +vdev_label_read_bootenv_done(zio_t *zio) +{ + zio_t *rio = zio->io_private; + abd_t **cbp = rio->io_private; + + ASSERT3U(zio->io_size, ==, VDEV_PAD_SIZE); + + if (zio->io_error == 0) { + mutex_enter(&rio->io_lock); + if (*cbp == NULL) { + /* Will free this buffer in vdev_label_read_bootenv. */ + *cbp = zio->io_abd; + } else { + abd_free(zio->io_abd); + } + mutex_exit(&rio->io_lock); + } else { + abd_free(zio->io_abd); + } +} + +static void +vdev_label_read_bootenv_impl(zio_t *zio, vdev_t *vd, int flags) +{ + for (int c = 0; c < vd->vdev_children; c++) + vdev_label_read_bootenv_impl(zio, vd->vdev_child[c], flags); + + /* + * We just use the first label that has a correct checksum; the + * bootloader should have rewritten them all to be the same on boot, + * and any changes we made since boot have been the same across all + * labels. + * + * While grub supports writing to all four labels, other bootloaders + * don't, so we only use the first two labels to store boot + * information. + */ + if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { + for (int l = 0; l < VDEV_LABELS / 2; l++) { + vdev_label_read(zio, vd, l, + abd_alloc_linear(VDEV_PAD_SIZE, B_FALSE), + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, + vdev_label_read_bootenv_done, zio, flags); + } + } +} + int +vdev_label_read_bootenv(vdev_t *rvd, nvlist_t *command) +{ + spa_t *spa = rvd->vdev_spa; + abd_t *abd = NULL; + int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL | + ZIO_FLAG_SPECULATIVE | ZIO_FLAG_TRYHARD; + + ASSERT(command); + ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL); + + zio_t *zio = zio_root(spa, NULL, &abd, flags); + vdev_label_read_bootenv_impl(zio, rvd, flags); + int err = zio_wait(zio); + + if (abd != NULL) { + vdev_boot_envblock_t *vbe = abd_to_buf(abd); + if (vbe->vbe_version != VB_RAW) { + abd_free(abd); + return (SET_ERROR(ENOTSUP)); + } + vbe->vbe_bootenv[sizeof (vbe->vbe_bootenv) - 1] = '\0'; + fnvlist_add_string(command, "envmap", vbe->vbe_bootenv); + /* abd was allocated in vdev_label_read_bootenv_impl() */ + abd_free(abd); + /* If we managed to read any successfully, return success. */ + return (0); + } + return (err); +} + +int +vdev_label_write_bootenv(vdev_t *vd, char *envmap) +{ + zio_t *zio; + spa_t *spa = vd->vdev_spa; + vdev_boot_envblock_t *bootenv; + int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL; + int error = ENXIO; + + if (strlen(envmap) >= sizeof (bootenv->vbe_bootenv)) { + return (SET_ERROR(E2BIG)); + } + + ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL); + + for (int c = 0; c < vd->vdev_children; c++) { + int child_err = vdev_label_write_bootenv(vd->vdev_child[c], + envmap); + /* + * As long as any of the disks managed to write all of their + * labels successfully, return success. + */ + if (child_err == 0) + error = child_err; + } + + if (!vd->vdev_ops->vdev_op_leaf || vdev_is_dead(vd) || + !vdev_writeable(vd)) { + return (error); + } + ASSERT3U(sizeof (*bootenv), ==, VDEV_PAD_SIZE); + abd_t *abd = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); + abd_zero(abd, VDEV_PAD_SIZE); + bootenv = abd_borrow_buf_copy(abd, VDEV_PAD_SIZE); + + char *buf = bootenv->vbe_bootenv; + (void) strlcpy(buf, envmap, sizeof (bootenv->vbe_bootenv)); + bootenv->vbe_version = VB_RAW; + abd_return_buf_copy(abd, bootenv, VDEV_PAD_SIZE); + +retry: + zio = zio_root(spa, NULL, NULL, flags); + for (int l = 0; l < VDEV_LABELS / 2; l++) { + vdev_label_write(zio, vd, l, abd, + offsetof(vdev_label_t, vl_be), + VDEV_PAD_SIZE, NULL, NULL, flags); + } + + error = zio_wait(zio); + if (error != 0 && !(flags & ZIO_FLAG_TRYHARD)) { + flags |= ZIO_FLAG_TRYHARD; + goto retry; + } + + abd_free(abd); + return (error); +} + +int vdev_label_write_pad2(vdev_t *vd, const char *buf, size_t size) { spa_t *spa = vd->vdev_spa; @@ -1042,7 +1184,7 @@ vdev_label_write_pad2(vdev_t *vd, const char *buf, siz retry: zio = zio_root(spa, NULL, NULL, flags); vdev_label_write(zio, vd, 0, pad2, - offsetof(vdev_label_t, vl_pad2), + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, NULL, NULL, flags); error = zio_wait(zio); if (error != 0 && !(flags & ZIO_FLAG_TRYHARD)) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:32:20 2020 (r363911) @@ -3654,6 +3654,58 @@ zfs_ioc_log_history(const char *unused, nvlist_t *innv return (error); } +/* + * This ioctl is used to set the bootenv configuration on the current + * pool. This configuration is stored in the second padding area of the label, + * and it is used by the GRUB bootloader used on Linux to store the contents + * of the grubenv file. The file is stored as raw ASCII, and is protected by + * an embedded checksum. By default, GRUB will check if the boot filesystem + * supports storing the environment data in a special location, and if so, + * will invoke filesystem specific logic to retrieve it. This can be overriden + * by a variable, should the user so desire. + */ +/* ARGSUSED */ +static const zfs_ioc_key_t zfs_keys_set_bootenv[] = { + {"envmap", DATA_TYPE_STRING, 0}, +}; + +static int +zfs_ioc_set_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) +{ + char *envmap; + int error; + spa_t *spa; + + envmap = fnvlist_lookup_string(innvl, "envmap"); + if ((error = spa_open(name, &spa, FTAG)) != 0) + return (error); + spa_vdev_state_enter(spa, SCL_ALL); + error = vdev_label_write_bootenv(spa->spa_root_vdev, envmap); + (void) spa_vdev_state_exit(spa, NULL, 0); + spa_close(spa, FTAG); + return (error); +} + +static const zfs_ioc_key_t zfs_keys_get_bootenv[] = { + /* no nvl keys */ +}; + + /* ARGSUSED */ +static int +zfs_ioc_get_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) +{ + spa_t *spa; + int error; + + if ((error = spa_open(name, &spa, FTAG)) != 0) + return (error); + spa_vdev_state_enter(spa, SCL_ALL); + error = vdev_label_read_bootenv(spa->spa_root_vdev, outnvl); + (void) spa_vdev_state_exit(spa, NULL, 0); + spa_close(spa, FTAG); + return (error); +} + #ifdef __FreeBSD__ static const zfs_ioc_key_t zfs_keys_nextboot[] = { {"command", DATA_TYPE_STRING, 0}, @@ -6566,6 +6618,16 @@ zfs_ioctl_init(void) zfs_ioctl_register("reopen", ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen, zfs_secpolicy_config, POOL_NAME, POOL_CHECK_SUSPENDED, B_TRUE, B_TRUE, zfs_keys_pool_reopen, ARRAY_SIZE(zfs_keys_pool_reopen)); + + zfs_ioctl_register("set_bootenv", ZFS_IOC_SET_BOOTENV, + zfs_ioc_set_bootenv, zfs_secpolicy_config, POOL_NAME, + POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE, + zfs_keys_set_bootenv, ARRAY_SIZE(zfs_keys_set_bootenv)); + + zfs_ioctl_register("get_bootenv", ZFS_IOC_GET_BOOTENV, + zfs_ioc_get_bootenv, zfs_secpolicy_none, POOL_NAME, + POOL_CHECK_SUSPENDED, B_FALSE, B_TRUE, + zfs_keys_get_bootenv, ARRAY_SIZE(zfs_keys_get_bootenv)); /* IOCTLS that use the legacy function signature */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2018 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -1057,6 +1057,8 @@ typedef enum zfs_ioc { ZFS_IOC_POOL_DISCARD_CHECKPOINT, ZFS_IOC_POOL_INITIALIZE, ZFS_IOC_POOL_SYNC, + ZFS_IOC_SET_BOOTENV, + ZFS_IOC_GET_BOOTENV, ZFS_IOC_LAST } zfs_ioc_t; From owner-svn-src-head@freebsd.org Wed Aug 5 15:15: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 BB2F03796AA; Wed, 5 Aug 2020 15:15:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BMFZ536Qtz3T63; Wed, 5 Aug 2020 15:15:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x729.google.com with SMTP id b14so40262807qkn.4; Wed, 05 Aug 2020 08:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5qSL6iIb27vI/AJnoR0FGEu/hyTM6yGlnF6Amoxmdfg=; b=hGxwBe1kv4nNaZ7FFPJXQOVcU+FtvXeX7LR31rgrFwoAyckg4Ql3CcmLdZ7+RRtFqq oGvNX0FlQcX2HaqQN4QKo8F/HKMarSHWxEDWjR2qWFgzEcpgol1SNwcP9hKKVVZ6y5Re J76inQnLDHh5T5eSV0xw9rn+c5jWQROfNFRfFB8ZG7dLq6dLQoAT8+O1mehGtxvySxW8 u9flbXaN5veZj+BnCaZZwS+MbNriCzutB4DXh/4UzlvZYXraYwSk2QsK+nHEUCEojNN3 l2zr13D7QTdlwBPoROj5EqkhAVHqtLtMRkFXGyy5enYINtvAZE8X1utAZoFruiEN4KoH Dzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=5qSL6iIb27vI/AJnoR0FGEu/hyTM6yGlnF6Amoxmdfg=; b=iWGQ9GqEDNgsmd75p4tfwSn0LQsKupdXgEFZsioblA6fpLXfzgpmDFN7xt08Sq95d5 D4oGp0jc9w8LKaH0XHpqwe3y0vuhJv7tLmzLJi4E4JWMnllnxlLuU/TmImMC6eOaBQg4 vvGHxGuBb252AxqOAFyTtEPQPVv64mP2YNTIRYBDxTm+dweAfZnnFlkTlgGIR2Ku7L33 Tdt2hbe82woIdBnEaFnIsTJrU2RS5m4ovlCa/YkSRQxMQUs8vRQEBxoZ/xEtnuC/fidY xrCYcM7+dUvi0BBDZ0UOEhjMHOlwTp+bYbEFglb+/G2bfmZVm903t6WlfdQBDFvWJWgG XpVw== X-Gm-Message-State: AOAM530L+DUZqWXcHhvWYDz8pnUZtRk4mPYmuQBHnN56IUo+xKp38Px1 XigWHJl3uVcuK9QxV9xxpZnw8kCNlXA= X-Google-Smtp-Source: ABdhPJyXJfT8FFa9ADuLerkeOy/isn5ZcP8pjb053HK9hwfH6GYvEuinAsMqbqUvGxVve3rXdZFiGA== X-Received: by 2002:a37:d4c:: with SMTP id 73mr3553685qkn.445.1596640556032; Wed, 05 Aug 2020 08:15:56 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-35.dsl.bell.ca. [67.71.176.35]) by smtp.gmail.com with ESMTPSA id o17sm2241298qtr.13.2020.08.05.08.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 08:15:55 -0700 (PDT) Sender: Mark Johnston Date: Wed, 5 Aug 2020 11:15:53 -0400 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363875 - head/sys/ufs/ffs Message-ID: <20200805151553.GC75799@raichu> References: <202008042309.074N9Gao027102@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008042309.074N9Gao027102@repo.freebsd.org> X-Rspamd-Queue-Id: 4BMFZ536Qtz3T63 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 15:15:57 -0000 On Tue, Aug 04, 2020 at 11:09:16PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Tue Aug 4 23:09:15 2020 > New Revision: 363875 > URL: https://svnweb.freebsd.org/changeset/base/363875 > > Log: > ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set > > This restores the pre-adaptive spinning state for SU which livelocks > otherwise. Note this is a bug in SU. > > Reported by: pho What is the bug? From owner-svn-src-head@freebsd.org Wed Aug 5 15:20: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 DF8D3379852; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMFfw5dwFz3TNp; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5E471825E; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075FK8s9026740; Wed, 5 Aug 2020 15:20:08 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075FK7ho026737; Wed, 5 Aug 2020 15:20:07 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051520.075FK7ho026737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 15:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363915 - in head/contrib/bc: . locales src X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . locales src X-SVN-Commit-Revision: 363915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 15:20:08 -0000 Author: se Date: Wed Aug 5 15:20:07 2020 New Revision: 363915 URL: https://svnweb.freebsd.org/changeset/base/363915 Log: Upgrade to version 3.1.5 This version fixes some entries in the chinese message catalogs which could lead to program crashes when used. Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/locales/zh_CN.GB18030.msg head/contrib/bc/locales/zh_CN.GB2312.msg head/contrib/bc/locales/zh_CN.GBK.msg head/contrib/bc/locales/zh_CN.UTF-8.msg head/contrib/bc/locales/zh_CN.eucCN.msg head/contrib/bc/src/program.c head/contrib/bc/src/vm.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/Makefile.in Wed Aug 5 15:20:07 2020 (r363915) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.4 +VERSION = 3.1.5 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/NEWS.md Wed Aug 5 15:20:07 2020 (r363915) @@ -1,5 +1,13 @@ # News +## 3.1.5 + +This is a production release that fixes the Chinese locales (which caused `bc` +to crash) and a crash caused by `bc` executing code when it should not have been +able to. + +***ALL USERS SHOULD UPGRADE.*** + ## 3.1.4 This is a production release that fixes one bug, changes two behaviors, and Modified: head/contrib/bc/locales/zh_CN.GB18030.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GB2312.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GBK.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.UTF-8.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.eucCN.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/src/program.c ============================================================================== --- head/contrib/bc/src/program.c Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/src/program.c Wed Aug 5 15:20:07 2020 (r363915) @@ -1271,11 +1271,12 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); Modified: head/contrib/bc/src/vm.c ============================================================================== --- head/contrib/bc/src/vm.c Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/src/vm.c Wed Aug 5 15:20:07 2020 (r363915) @@ -464,7 +464,7 @@ static void bc_vm_process(const char *text) { while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs); - bc_program_exec(&vm.prog); + if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog); assert(BC_IS_DC || vm.prog.results.len == 0); From owner-svn-src-head@freebsd.org Wed Aug 5 15: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 0ABB6379B5B; Wed, 5 Aug 2020 15:33:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMFyN6Y3Pz3V3R; Wed, 5 Aug 2020 15:33:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F34182C0; Wed, 5 Aug 2020 15:33:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075FXW6E038625; Wed, 5 Aug 2020 15:33:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075FXWfB038624; Wed, 5 Aug 2020 15:33:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008051533.075FXWfB038624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 5 Aug 2020 15:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363916 - head/contrib/ipfilter/iplang X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/iplang X-SVN-Commit-Revision: 363916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 15:33:33 -0000 Author: cy Date: Wed Aug 5 15:33:32 2020 New Revision: 363916 URL: https://svnweb.freebsd.org/changeset/base/363916 Log: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. MFC after: 1 week Modified: head/contrib/ipfilter/iplang/iplang_y.y Modified: head/contrib/ipfilter/iplang/iplang_y.y ============================================================================== --- head/contrib/ipfilter/iplang/iplang_y.y Wed Aug 5 15:20:07 2020 (r363915) +++ head/contrib/ipfilter/iplang/iplang_y.y Wed Aug 5 15:33:32 2020 (r363916) @@ -30,11 +30,9 @@ #include #include #include -#ifndef linux # include # include # include -#endif #include #include #include @@ -589,29 +587,7 @@ struct statetoopt tosecopts[] = { { 0, 0 } }; -#ifdef bsdi -struct ether_addr * -ether_aton(s) - char *s; -{ - static struct ether_addr n; - u_int i[6]; - if (sscanf(s, " %x:%x:%x:%x:%x:%x ", &i[0], &i[1], - &i[2], &i[3], &i[4], &i[5]) == 6) { - n.ether_addr_octet[0] = (u_char)i[0]; - n.ether_addr_octet[1] = (u_char)i[1]; - n.ether_addr_octet[2] = (u_char)i[2]; - n.ether_addr_octet[3] = (u_char)i[3]; - n.ether_addr_octet[4] = (u_char)i[4]; - n.ether_addr_octet[5] = (u_char)i[5]; - return &n; - } - return NULL; -} -#endif - - struct in_addr getipv4addr(arg) char *arg; { @@ -645,7 +621,6 @@ struct ether_addr *buf; { struct ether_addr *e; -#if !defined(hpux) && !defined(linux) e = ether_aton(arg); if (!e) fprintf(stderr, "Invalid ethernet address: %s\n", arg); @@ -657,9 +632,6 @@ struct ether_addr *buf; sizeof(e->ether_addr_octet)); # endif return e; -#else - return NULL; -#endif } @@ -1584,9 +1556,7 @@ int arg; void set_icmpmtu(arg) int arg; { -#if BSD >= 199306 icmp->icmp_nextmtu = htons(arg); -#endif } From owner-svn-src-head@freebsd.org Wed Aug 5 16:36: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 CE03C37B0C5; Wed, 5 Aug 2020 16:36:54 +0000 (UTC) (envelope-from truckman@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BMHMV4sG1z3YQS; Wed, 5 Aug 2020 16:36:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id EB5D820610; Wed, 5 Aug 2020 16:36:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Wed, 5 Aug 2020 09:36:52 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r363891 - head/sys/kern To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <202008050924.0759Oc3H010909@repo.freebsd.org> Message-ID: References: <202008050924.0759Oc3H010909@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 16:36:54 -0000 On 5 Aug, Mateusz Guzik wrote: > Author: mjg > Date: Wed Aug 5 09:24:38 2020 > New Revision: 363891 > URL: https://svnweb.freebsd.org/changeset/base/363891 > > Log: > cache: reduce zone alignment to 8 bytes > > It used to be sizeof of the given struct to accomodate for 32 bit mips > doing 64 bit loads, but the same can be achieved with requireing just > 64 bit alignment. > > While here reorder struct namecache so that most commonly used fields > are closer. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) > +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) > @@ -122,9 +122,9 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc > "the state must fit in a union with a pointer without growing it"); > > struct namecache { > - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ > LIST_ENTRY(namecache) nc_src; /* source vnode list */ > TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ > + CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ > struct vnode *nc_dvp; /* vnode of parent of name */ > union { > struct vnode *nu_vp; /* vnode the name refers to */ > @@ -142,6 +142,8 @@ struct namecache { > * to be stored. The nc_dotdottime field is used when a cache entry is mapping > * both a non-dotdot directory name plus dotdot for the directory's > * parent. > + * > + * See below for alignment requirement. > */ > struct namecache_ts { > struct timespec nc_time; /* timespec provided by fs */ > @@ -150,6 +152,14 @@ struct namecache_ts { > struct namecache nc_nc; > }; > > +/* > + * At least mips n32 performs 64-bit accesses to timespec as found > + * in namecache_ts and requires them to be aligned. Since others > + * may be in the same spot suffer a little bit and enforce the > + * alignment for everyone. Note this is a nop for 64-bit platforms. > + */ > +#define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) time_t is only 32 bits on i386 From owner-svn-src-head@freebsd.org Wed Aug 5 17:06: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 1D7F237BA30; Wed, 5 Aug 2020 17:06:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ1L74Fxz3ZgT; Wed, 5 Aug 2020 17:06:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D204219714; Wed, 5 Aug 2020 17:06:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075H6EGe094161; Wed, 5 Aug 2020 17:06:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H6EBo094160; Wed, 5 Aug 2020 17:06:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008051706.075H6EBo094160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Aug 2020 17:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363917 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 363917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 17:06:15 -0000 Author: markj Date: Wed Aug 5 17:06:14 2020 New Revision: 363917 URL: https://svnweb.freebsd.org/changeset/base/363917 Log: Fix a TOCTOU vulnerability in freebsd32_copyin_control(). PR: 248257 Reported by: m00nbsd working with Trend Micro Zero Day Initiative Reviewed by: kib Security: SA-20:23.sendmsg Security: CVE-2020-7460 Security: ZDI-CAN-11543 Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 15:33:32 2020 (r363916) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:06:14 2020 (r363917) @@ -1449,78 +1449,90 @@ freebsd32_recvmsg(td, uap) static int freebsd32_copyin_control(struct mbuf **mp, caddr_t buf, u_int buflen) { + struct cmsghdr *cm; struct mbuf *m; - void *md; - u_int idx, len, msglen; + void *in, *in1, *md; + u_int msglen, outlen; int error; - buflen = FREEBSD32_ALIGN(buflen); - if (buflen > MCLBYTES) return (EINVAL); + in = malloc(buflen, M_TEMP, M_WAITOK); + error = copyin(buf, in, buflen); + if (error != 0) + goto out; + /* - * Iterate over the buffer and get the length of each message - * in there. This has 32-bit alignment and padding. Use it to - * determine the length of these messages when using 64-bit - * alignment and padding. + * Make a pass over the input buffer to determine the amount of space + * required for 64 bit-aligned copies of the control messages. */ - idx = 0; - len = 0; - while (idx < buflen) { - error = copyin(buf + idx, &msglen, sizeof(msglen)); - if (error) - return (error); - if (msglen < sizeof(struct cmsghdr)) - return (EINVAL); - msglen = FREEBSD32_ALIGN(msglen); - if (idx + msglen > buflen) - return (EINVAL); - idx += msglen; - msglen += CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - len += CMSG_ALIGN(msglen); - } - - if (len > MCLBYTES) - return (EINVAL); - - m = m_get(M_WAITOK, MT_CONTROL); - if (len > MLEN) - MCLGET(m, M_WAITOK); - m->m_len = len; - - md = mtod(m, void *); + in1 = in; + outlen = 0; while (buflen > 0) { - error = copyin(buf, md, sizeof(struct cmsghdr)); - if (error) + if (buflen < sizeof(*cm)) { + error = EINVAL; break; - msglen = *(u_int *)md; - msglen = FREEBSD32_ALIGN(msglen); + } + cm = (struct cmsghdr *)in1; + if (cm->cmsg_len < FREEBSD32_ALIGN(sizeof(*cm))) { + error = EINVAL; + break; + } + msglen = FREEBSD32_ALIGN(cm->cmsg_len); + if (msglen > buflen || msglen < cm->cmsg_len) { + error = EINVAL; + break; + } + buflen -= msglen; - /* Modify the message length to account for alignment. */ - *(u_int *)md = msglen + CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + in1 = (char *)in1 + msglen; + outlen += CMSG_ALIGN(sizeof(*cm)) + + CMSG_ALIGN(msglen - FREEBSD32_ALIGN(sizeof(*cm))); + } + if (error == 0 && outlen > MCLBYTES) { + /* + * XXXMJ This implies that the upper limit on 32-bit aligned + * control messages is less than MCLBYTES, and so we are not + * perfectly compatible. However, there is no platform + * guarantee that mbuf clusters larger than MCLBYTES can be + * allocated. + */ + error = EINVAL; + } + if (error != 0) + goto out; - md = (char *)md + CMSG_ALIGN(sizeof(struct cmsghdr)); - buf += FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - buflen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + m = m_get2(outlen, M_WAITOK, MT_CONTROL, 0); + m->m_len = outlen; + md = mtod(m, void *); - msglen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - if (msglen > 0) { - error = copyin(buf, md, msglen); - if (error) - break; - md = (char *)md + CMSG_ALIGN(msglen); - buf += msglen; - buflen -= msglen; - } + /* + * Make a second pass over input messages, copying them into the output + * buffer. + */ + in1 = in; + while (outlen > 0) { + /* Copy the message header and align the length field. */ + cm = md; + memcpy(cm, in1, sizeof(*cm)); + msglen = cm->cmsg_len - FREEBSD32_ALIGN(sizeof(*cm)); + cm->cmsg_len = CMSG_ALIGN(sizeof(*cm)) + msglen; + + /* Copy the message body. */ + in1 = (char *)in1 + FREEBSD32_ALIGN(sizeof(*cm)); + md = (char *)md + CMSG_ALIGN(sizeof(*cm)); + memcpy(md, in1, msglen); + in1 = (char *)in1 + FREEBSD32_ALIGN(msglen); + md = (char *)md + CMSG_ALIGN(msglen); + KASSERT(outlen >= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen), + ("outlen %u underflow, msglen %u", outlen, msglen)); + outlen -= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen); } - if (error) - m_free(m); - else - *mp = m; + *mp = m; +out: + free(in, M_TEMP); return (error); } From owner-svn-src-head@freebsd.org Wed Aug 5 17:26: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 C484537C2D4; Wed, 5 Aug 2020 17:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJSX4p6qz3cxp; Wed, 5 Aug 2020 17:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 839101937B; Wed, 5 Aug 2020 17:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075HQKK0007039; Wed, 5 Aug 2020 17:26:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075HQKhI007038; Wed, 5 Aug 2020 17:26:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008051726.075HQKhI007038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Aug 2020 17:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363925 - head/tools/uma/smrstress X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tools/uma/smrstress X-SVN-Commit-Revision: 363925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 17:26:20 -0000 Author: markj Date: Wed Aug 5 17:26:20 2020 New Revision: 363925 URL: https://svnweb.freebsd.org/changeset/base/363925 Log: Fix the smrstress build after r358400. Reported by: pho Modified: head/tools/uma/smrstress/smrstress.c Modified: head/tools/uma/smrstress/smrstress.c ============================================================================== --- head/tools/uma/smrstress/smrstress.c Wed Aug 5 17:14:37 2020 (r363924) +++ head/tools/uma/smrstress/smrstress.c Wed Aug 5 17:26:20 2020 (r363925) @@ -68,7 +68,7 @@ smrs_error(struct smrs *smrs, const char *fmt, ...) atomic_add_int(&smrs_failures, 1); printf("SMR ERROR: wr_seq %d, rd_seq %d, c_seq %d, generation %d, count %d ", - smrs_smr->c_shared->s_wr_seq, smrs_smr->c_shared->s_rd_seq, + smrs_smr->c_shared->s_wr.seq, smrs_smr->c_shared->s_rd_seq, zpcpu_get(smrs_smr)->c_seq, smrs->generation, smrs->count); va_start(ap, fmt); (void)vprintf(fmt, ap); From owner-svn-src-head@freebsd.org Wed Aug 5 17:40: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 684D237CA26; Wed, 5 Aug 2020 17:40:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BMJnL0Zfhz3dlg; Wed, 5 Aug 2020 17:40:53 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id f7so41531544wrw.1; Wed, 05 Aug 2020 10:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kIINTRLDQqiOEl9fQ3iaI+w7X6TVH0yX2mjkGOp1+sw=; b=E1BdsVLfT2naVLGMjT5AI4VQku9bGVrVLnEUtCCbKFOSfZvpA5c8tYbFldVnJ2DYc3 T+v+xw8gfW3q25jCZLirKn/nXBxKbyE267/XUvXme7IVr/56zRaHfiddv158N3Xg4lzL FcZ2+/M169JJU/ZIgU70BLUnLfBvs+DVSrt0WKke/ElWgJiCCxj8knggZoO50Nn5g93y j27qdVREzV7T4Nd11xeNRRcr1sTeNAKHPseUS/QTyAl0UUN7cqme4lKIZWT7OFi0uVEx ZtsGQ0zht3jAwwLDUL8v/ZqLBByoJKTaRMtVLVsN9b8hlhTxlAjU1/NpQUqotPBjvF5S GW7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kIINTRLDQqiOEl9fQ3iaI+w7X6TVH0yX2mjkGOp1+sw=; b=ounm/E2H4td9/2IGjko8ECCscOKKakn8CIlVB9xiCr5LeUkgjSqT/Y4Q+PNM7e2ChA nBgGLZZQYnVqJub+qz2x5YfhFFPGqsej4pJj6+0xD78/yJsDjK9RRwSVGhuEFR7F+1aD zOQ2Y5TqHlRMvWrCXo9Jv/2lBnNRRmUyqJh8Qnb0ajBE/TjjGdCnclSJJeUoVaXNXdYP Oo31b7OepIaCdpyF6vFpNAOeTAYZEQFecjpFEPiiltByooMHFbsE8U2ykUyajj82ifQR Mp5x09RO7GfQ5nvgHMkrp6UiJO3y7m2XrG8VRtVDUeMWkrvAJwDYmWaeYZ26MCdSsjKN zQfg== X-Gm-Message-State: AOAM530I40Mm/k0APf5aOhf2m5TN0gOkNXdI1mF5tJpWKe2Ic5UjMAch yPX+pLrDnkoBfnI1ytmE6i3PUKkv/wWYz/v7PGV+7Q== X-Google-Smtp-Source: ABdhPJzIfdvV30MvprILG/1evftOKB09JoX6UdH+8H5hSPikHVh99QQujwD42sf96ZRVrROTQFSrQgaGjLcTr4Pvbek= X-Received: by 2002:a5d:61c8:: with SMTP id q8mr3619850wrv.160.1596649251963; Wed, 05 Aug 2020 10:40:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Wed, 5 Aug 2020 10:40:50 -0700 (PDT) In-Reply-To: References: <202008050924.0759Oc3H010909@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 5 Aug 2020 19:40:50 +0200 Message-ID: Subject: Re: svn commit: r363891 - head/sys/kern To: Don Lewis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BMJnL0Zfhz3dlg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 17:40:54 -0000 That's fine, then the arch does not have avoidably increased alignment. On 8/5/20, Don Lewis wrote: > On 5 Aug, Mateusz Guzik wrote: >> Author: mjg >> Date: Wed Aug 5 09:24:38 2020 >> New Revision: 363891 >> URL: https://svnweb.freebsd.org/changeset/base/363891 >> >> Log: >> cache: reduce zone alignment to 8 bytes >> >> It used to be sizeof of the given struct to accomodate for 32 bit mips >> doing 64 bit loads, but the same can be achieved with requireing just >> 64 bit alignment. >> >> While here reorder struct namecache so that most commonly used fields >> are closer. >> >> Modified: >> head/sys/kern/vfs_cache.c >> >> Modified: head/sys/kern/vfs_cache.c >> ============================================================================== >> --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) >> +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) >> @@ -122,9 +122,9 @@ _Static_assert(sizeof(struct negstate) <= >> sizeof(struc >> "the state must fit in a union with a pointer without growing it"); >> >> struct namecache { >> - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ >> LIST_ENTRY(namecache) nc_src; /* source vnode list */ >> TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ >> + CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ >> struct vnode *nc_dvp; /* vnode of parent of name */ >> union { >> struct vnode *nu_vp; /* vnode the name refers to */ >> @@ -142,6 +142,8 @@ struct namecache { >> * to be stored. The nc_dotdottime field is used when a cache entry is >> mapping >> * both a non-dotdot directory name plus dotdot for the directory's >> * parent. >> + * >> + * See below for alignment requirement. >> */ >> struct namecache_ts { >> struct timespec nc_time; /* timespec provided by fs */ >> @@ -150,6 +152,14 @@ struct namecache_ts { >> struct namecache nc_nc; >> }; >> >> +/* >> + * At least mips n32 performs 64-bit accesses to timespec as found >> + * in namecache_ts and requires them to be aligned. Since others >> + * may be in the same spot suffer a little bit and enforce the >> + * alignment for everyone. Note this is a nop for 64-bit platforms. >> + */ >> +#define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) > > time_t is only 32 bits on i386 > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Aug 5 18:21: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 DBD693A5E89; Wed, 5 Aug 2020 18:21:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMKh35GtDz44Gl; Wed, 5 Aug 2020 18:21:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97DC81A323; Wed, 5 Aug 2020 18:21:23 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075ILNDi040838; Wed, 5 Aug 2020 18:21:23 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075ILNPB040446; Wed, 5 Aug 2020 18:21:23 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202008051821.075ILNPB040446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 5 Aug 2020 18:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363926 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 363926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 18:21:23 -0000 Author: gonzo Date: Wed Aug 5 18:21:22 2020 New Revision: 363926 URL: https://svnweb.freebsd.org/changeset/base/363926 Log: Add flag for SYSCON-controlled clocks on Rockhip platform Ethernet clocks on RK3328 are controlled by SYSCON registers, so add RK_CLK_COMPOSITE_GRF flag to indicate that clock node should access grf registers instead of CRU's Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D25918 Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c head/sys/arm64/rockchip/clk/rk_clk_composite.h Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Aug 5 17:26:20 2020 (r363925) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Aug 5 18:21:22 2020 (r363926) @@ -35,10 +35,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "clkdev_if.h" +#include "syscon_if.h" struct rk_clk_composite_sc { uint32_t muxdiv_offset; @@ -54,12 +56,14 @@ struct rk_clk_composite_sc { uint32_t gate_shift; uint32_t flags; + + struct syscon *grf; }; #define WRITE4(_clk, off, val) \ - CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) + rk_clk_composite_write_4(_clk, off, val) #define READ4(_clk, off, val) \ - CLKDEV_READ_4(clknode_get_device(_clk), off, val) + rk_clk_composite_read_4(_clk, off, val) #define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) #define DEVICE_UNLOCK(_clk) \ @@ -74,6 +78,49 @@ struct rk_clk_composite_sc { #define dprintf(format, arg...) #endif +static void +rk_clk_composite_read_4(struct clknode *clk, bus_addr_t addr, uint32_t *val) +{ + struct rk_clk_composite_sc *sc; + + sc = clknode_get_softc(clk); + if (sc->grf) + *val = SYSCON_READ_4(sc->grf, addr); + else + CLKDEV_READ_4(clknode_get_device(clk), addr, val); +} + +static void +rk_clk_composite_write_4(struct clknode *clk, bus_addr_t addr, uint32_t val) +{ + struct rk_clk_composite_sc *sc; + + sc = clknode_get_softc(clk); + if (sc->grf) + SYSCON_WRITE_4(sc->grf, addr, val | (0xffff << 16)); + else + CLKDEV_WRITE_4(clknode_get_device(clk), addr, val); +} + +static struct syscon * +rk_clk_composite_get_grf(struct clknode *clk) +{ + device_t dev; + phandle_t node; + struct syscon *grf; + + grf = NULL; + dev = clknode_get_device(clk); + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "rockchip,grf") && + syscon_get_by_ofw_property(dev, node, + "rockchip,grf", &grf) != 0) { + return (NULL); + } + + return (grf); +} + static int rk_clk_composite_init(struct clknode *clk, device_t dev) { @@ -81,6 +128,12 @@ rk_clk_composite_init(struct clknode *clk, device_t de uint32_t val, idx; sc = clknode_get_softc(clk); + if ((sc->flags & RK_CLK_COMPOSITE_GRF) != 0) { + sc->grf = rk_clk_composite_get_grf(clk); + if (sc->grf == NULL) + panic("clock %s has GRF flag set but no syscon is available", + clknode_get_name(clk)); + } idx = 0; if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) != 0) { Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.h Wed Aug 5 17:26:20 2020 (r363925) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.h Wed Aug 5 18:21:22 2020 (r363926) @@ -53,6 +53,7 @@ struct rk_clk_composite_def { #define RK_CLK_COMPOSITE_HAVE_GATE 0x0002 #define RK_CLK_COMPOSITE_DIV_EXP 0x0004 /* Register 0, 1, 2, 2, ... */ /* Divider 1, 2, 4, 8, ... */ +#define RK_CLK_COMPOSITE_GRF 0x0008 /* Use syscon registers instead of CRU's */ int rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef); From owner-svn-src-head@freebsd.org Wed Aug 5 18:22: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 C09D43A6006; Wed, 5 Aug 2020 18:22:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMKjD4fndz44Nw; Wed, 5 Aug 2020 18:22:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 842D91A561; Wed, 5 Aug 2020 18:22:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075IMOlh043568; Wed, 5 Aug 2020 18:22:24 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075IMOaE043567; Wed, 5 Aug 2020 18:22:24 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202008051822.075IMOaE043567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 5 Aug 2020 18:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363927 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 363927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 18:22:24 -0000 Author: gonzo Date: Wed Aug 5 18:22:24 2020 New Revision: 363927 URL: https://svnweb.freebsd.org/changeset/base/363927 Log: Add clocks for ethernet controllers on RK3328 Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D25918 Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Aug 5 18:21:22 2020 (r363926) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Aug 5 18:22:24 2020 (r363927) @@ -49,10 +49,31 @@ __FBSDID("$FreeBSD$"); #include +/* Registers */ +#define RK3328_GRF_SOC_CON4 0x410 +#define RK3328_GRF_MAC_CON1 0x904 +#define RK3328_GRF_MAC_CON2 0x908 + /* GATES */ +#define SCLK_MAC2PHY_RXTX 83 +#define SCLK_MAC2PHY_SRC 84 +#define SCLK_MAC2PHY_REF 85 +#define SCLK_MAC2PHY_OUT 86 +#define SCLK_MAC2IO_RX 87 +#define SCLK_MAC2IO_TX 88 +#define SCLK_MAC2IO_REFOUT 89 +#define SCLK_MAC2IO_REF 90 +#define SCLK_MAC2IO_OUT 91 #define SCLK_USB3OTG_REF 96 +#define SCLK_MAC2IO_SRC 99 +#define SCLK_MAC2IO 100 +#define SCLK_MAC2PHY 101 +#define SCLK_MAC2IO_EXT 102 #define ACLK_USB3OTG 132 +#define ACLK_GMAC 146 +#define ACLK_MAC2PHY 149 +#define ACLK_MAC2IO 150 #define ACLK_PERI 153 #define PCLK_GPIO0 200 #define PCLK_GPIO1 201 @@ -63,6 +84,9 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C2 207 #define PCLK_I2C3 208 #define PCLK_TSADC 213 +#define PCLK_GMAC 220 +#define PCLK_MAC2PHY 222 +#define PCLK_MAC2IO 223 #define PCLK_USB3PHY_OTG 224 #define PCLK_USB3PHY_PIPE 225 #define PCLK_USB3_GRF 226 @@ -87,6 +111,14 @@ static struct rk_cru_gate rk3328_gates[] = { CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3) CRU_GATE(0, "pclk_phy_pre", "pclk_bus_pre", 0x220, 4) + /* CRU_CLKGATE_CON8 */ + CRU_GATE(SCLK_MAC2IO_REF, "clk_mac2io_ref", "clk_mac2io", 0x224, 7) + CRU_GATE(SCLK_MAC2IO_REFOUT, "clk_mac2io_refout", "clk_mac2io", 0x224, 6) + CRU_GATE(SCLK_MAC2IO_TX, "clk_mac2io_tx", "clk_mac2io", 0x224, 5) + CRU_GATE(SCLK_MAC2IO_RX, "clk_mac2io_rx", "clk_mac2io", 0x224, 4) + CRU_GATE(SCLK_MAC2PHY_REF, "clk_mac2phy_ref", "clk_mac2phy", 0x224, 3) + CRU_GATE(SCLK_MAC2PHY_RXTX, "clk_mac2phy_rxtx", "clk_mac2phy", 0x224, 1) + /* CRU_CLKGATE_CON10 */ CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0) @@ -116,6 +148,12 @@ static struct rk_cru_gate rk3328_gates[] = { CRU_GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0x24C, 14) CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15) + /* CRU_CLKGATE_CON26 */ + CRU_GATE(ACLK_MAC2PHY, "aclk_mac2phy", "aclk_gmac", 0x268, 0) + CRU_GATE(PCLK_MAC2PHY, "pclk_mac2phy", "pclk_gmac", 0x268, 1) + CRU_GATE(ACLK_MAC2IO, "aclk_mac2io", "aclk_gmac", 0x268, 2) + CRU_GATE(PCLK_MAC2IO, "pclk_mac2io", "pclk_gmac", 0x268, 3) + /* CRU_CLKGATE_CON28 */ CRU_GATE(PCLK_USB3PHY_OTG, "pclk_usb3phy_otg", "pclk_phy_pre", 0x270, 1) CRU_GATE(PCLK_USB3PHY_PIPE, "pclk_usb3phy_pipe", "pclk_phy_pre", 0x270, 2) @@ -1077,6 +1115,210 @@ static struct rk_clk_composite_def ref_usb3otg_src = { .flags = RK_CLK_COMPOSITE_HAVE_GATE, }; +static const char *mac2io_src_parents[] = { "cpll", "gpll" }; + +static struct rk_clk_composite_def mac2io_src = { + .clkdef = { + .id = SCLK_MAC2IO_SRC, + .name = "clk_mac2io_src", + .parent_names = mac2io_src_parents, + .parent_cnt = nitems(mac2io_src_parents), + }, + /* CRU_CLKSEL_CON27 */ + .muxdiv_offset = 0x16c, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + /* CRU_CLKGATE_CON3 */ + .gate_offset = 0x20c, + .gate_shift = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE | RK_CLK_COMPOSITE_HAVE_MUX, +}; + +static const char *mac2io_out_parents[] = { "cpll", "gpll" }; + +static struct rk_clk_composite_def mac2io_out = { + .clkdef = { + .id = SCLK_MAC2IO_OUT, + .name = "clk_mac2io_out", + .parent_names = mac2io_out_parents, + .parent_cnt = nitems(mac2io_out_parents), + }, + /* CRU_CLKSEL_CON27 */ + .muxdiv_offset = 0x16c, + + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 8, + .div_width = 5, + + /* CRU_CLKGATE_CON3 */ + .gate_offset = 0x20c, + .gate_shift = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE | RK_CLK_COMPOSITE_HAVE_MUX, +}; + +static const char *mac2io_parents[] = { "clk_mac2io_src", "gmac_clkin" }; + +static struct rk_clk_composite_def mac2io = { + .clkdef = { + .id = SCLK_MAC2IO, + .name = "clk_mac2io", + .parent_names = mac2io_parents, + .parent_cnt = nitems(mac2io_parents), + }, + .muxdiv_offset = RK3328_GRF_MAC_CON1, + + .mux_shift = 10, + .mux_width = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_GRF +}; + +static const char *mac2io_ext_parents[] = { "clk_mac2io", "gmac_clkin" }; + +static struct rk_clk_composite_def mac2io_ext = { + .clkdef = { + .id = SCLK_MAC2IO_EXT, + .name = "clk_mac2io_ext", + .parent_names = mac2io_ext_parents, + .parent_cnt = nitems(mac2io_ext_parents), + }, + .muxdiv_offset = RK3328_GRF_SOC_CON4, + + .mux_shift = 14, + .mux_width = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_GRF +}; + +static const char *mac2phy_src_parents[] = { "cpll", "gpll" }; + +static struct rk_clk_composite_def mac2phy_src = { + .clkdef = { + .id = SCLK_MAC2PHY_SRC, + .name = "clk_mac2phy_src", + .parent_names = mac2phy_src_parents, + .parent_cnt = nitems(mac2phy_src_parents), + }, + /* CRU_CLKSEL_CON26 */ + .muxdiv_offset = 0x168, + + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + /* CRU_CLKGATE_CON3 */ + .gate_offset = 0x20c, + .gate_shift = 0, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE | RK_CLK_COMPOSITE_HAVE_MUX, +}; + +static const char *mac2phy_parents[] = { "clk_mac2phy_src", "phy_50m_out" }; + +static struct rk_clk_composite_def mac2phy = { + .clkdef = { + .id = SCLK_MAC2PHY, + .name = "clk_mac2phy", + .parent_names = mac2phy_parents, + .parent_cnt = nitems(mac2phy_parents), + }, + .muxdiv_offset = RK3328_GRF_MAC_CON2, + + .mux_shift = 10, + .mux_width = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_GRF +}; + +static const char *mac2phy_out_parents[] = { "clk_mac2phy" }; + +static struct rk_clk_composite_def mac2phy_out = { + .clkdef = { + .id = SCLK_MAC2PHY_OUT, + .name = "clk_mac2phy_out", + .parent_names = mac2phy_out_parents, + .parent_cnt = nitems(mac2phy_out_parents), + }, + /* CRU_CLKSEL_CON26 */ + .muxdiv_offset = 0x168, + + .div_shift = 8, + .div_width = 2, + + /* CRU_CLKGATE_CON9 */ + .gate_offset = 0x224, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE +}; + +static struct clk_fixed_def phy_50m_out = { + .clkdef.name = "phy_50m_out", + .freq = 50000000, +}; + +static struct clk_link_def gmac_clkin = { + .clkdef.name = "gmac_clkin", +}; + +static const char *aclk_gmac_parents[] = { "cpll", "gpll" }; + +static struct rk_clk_composite_def aclk_gmac = { + .clkdef = { + .id = ACLK_GMAC, + .name = "aclk_gmac", + .parent_names = aclk_gmac_parents, + .parent_cnt = nitems(aclk_gmac_parents), + }, + /* CRU_CLKSEL_CON35 */ + .muxdiv_offset = 0x18c, + + .mux_shift = 6, + .mux_width = 2, + + .div_shift = 0, + .div_width = 5, + + /* CRU_CLKGATE_CON3 */ + .gate_offset = 0x20c, + .gate_shift = 2, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE | RK_CLK_COMPOSITE_HAVE_MUX, +}; + +static const char *pclk_gmac_parents[] = { "aclk_gmac" }; + +static struct rk_clk_composite_def pclk_gmac = { + .clkdef = { + .id = PCLK_GMAC, + .name = "pclk_gmac", + .parent_names = pclk_gmac_parents, + .parent_cnt = nitems(pclk_gmac_parents), + }, + /* CRU_CLKSEL_CON25 */ + .muxdiv_offset = 0x164, + + .div_shift = 8, + .div_width = 3, + + /* CRU_CLKGATE_CON9 */ + .gate_offset = 0x224, + .gate_shift = 0, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE +}; + static struct rk_clk rk3328_clks[] = { { .type = RK3328_CLK_PLL, @@ -1174,6 +1416,50 @@ static struct rk_clk rk3328_clks[] = { { .type = RK_CLK_COMPOSITE, .clk.composite = &usb3otg_suspend + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2io_src + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2io + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2io_out + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2io_ext + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2phy_src + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2phy + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &mac2phy_out + }, + { + .type = RK_CLK_FIXED, + .clk.fixed = &phy_50m_out + }, + { + .type = RK_CLK_LINK, + .clk.link = &gmac_clkin + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &aclk_gmac + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &pclk_gmac }, }; From owner-svn-src-head@freebsd.org Wed Aug 5 18:24: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 D33293A5BEA; Wed, 5 Aug 2020 18:24:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMKm83sH1z452m; Wed, 5 Aug 2020 18:24:56 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (5.186.119.8.cgn.fibianet.dk [5.186.119.8]) by relay05.pair.com (Postfix) with ESMTP id 3C13A1A27A7; Wed, 5 Aug 2020 14:24:55 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 075IOs5Q098619 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 5 Aug 2020 20:24:54 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 075IOsvn098618; Wed, 5 Aug 2020 20:24:54 +0200 (CEST) (envelope-from pho) Date: Wed, 5 Aug 2020 20:24:54 +0200 From: Peter Holm To: Mark Johnston Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363875 - head/sys/ufs/ffs Message-ID: <20200805182454.GA98533@x8.osted.lan> References: <202008042309.074N9Gao027102@repo.freebsd.org> <20200805151553.GC75799@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200805151553.GC75799@raichu> X-Rspamd-Queue-Id: 4BMKm83sH1z452m X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 18:24:56 -0000 On Wed, Aug 05, 2020 at 11:15:53AM -0400, Mark Johnston wrote: > On Tue, Aug 04, 2020 at 11:09:16PM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Aug 4 23:09:15 2020 > > New Revision: 363875 > > URL: https://svnweb.freebsd.org/changeset/base/363875 > > > > Log: > > ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set > > > > This restores the pre-adaptive spinning state for SU which livelocks > > otherwise. Note this is a bug in SU. > > > > Reported by: pho > > What is the bug? https://people.freebsd.org/~pho/stress/log/mjguzik037.txt - Peter > _______________________________________________ > 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 Wed Aug 5 19:05: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 B54093A6D35; Wed, 5 Aug 2020 19:05: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMLgL4P7Pz46V8; Wed, 5 Aug 2020 19:05: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 6DAD61AE54; Wed, 5 Aug 2020 19:05: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 075J5oX4068263; Wed, 5 Aug 2020 19:05:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075J5nAf068258; Wed, 5 Aug 2020 19:05:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008051905.075J5nAf068258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 19:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363928 - in head: lib/libpmcstat usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libpmcstat usr.sbin/pmcstat X-SVN-Commit-Revision: 363928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 19:05:50 -0000 Author: mjg Date: Wed Aug 5 19:05:49 2020 New Revision: 363928 URL: https://svnweb.freebsd.org/changeset/base/363928 Log: pmcstat: implement showing offsets into symbols in top mode The -I option (and hotkey) is reused for this. Skipping symbol resolution is moved to the new -A option (and hotkey). While arguably this violates POLA I think it's a change for the better. ALso note the -I option was added in head. Differential Revision: https://reviews.freebsd.org/D21658 Modified: head/lib/libpmcstat/libpmcstat.h head/usr.sbin/pmcstat/pmcpl_callgraph.c head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/lib/libpmcstat/libpmcstat.h ============================================================================== --- head/lib/libpmcstat/libpmcstat.h Wed Aug 5 18:22:24 2020 (r363927) +++ head/lib/libpmcstat/libpmcstat.h Wed Aug 5 19:05:49 2020 (r363928) @@ -107,8 +107,9 @@ struct pmcstat_args { #define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ #define FLAG_HAS_DURATION 0x00080000 /* -l secs */ #define FLAG_DO_WIDE_GPROF_HC 0x00100000 /* -e */ -#define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -I */ +#define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -A */ #define FLAG_FILTER_THREAD_ID 0x00400000 /* -L */ +#define FLAG_SHOW_OFFSET 0x00800000 /* -I */ int pa_required; /* required features */ int pa_pplugin; /* pre-processing plugin */ Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Aug 5 18:22:24 2020 (r363927) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Aug 5 19:05:49 2020 (r363928) @@ -152,10 +152,12 @@ pmcstat_cgnode_hash_lookup_pc(struct pmcstat_process * * Try determine the function at this offset. If we can't * find a function round leave the `pc' value alone. */ - if ((sym = pmcstat_symbol_search(image, pc)) != NULL) - pc = sym->ps_start; - else - pmcstat_stats.ps_samples_unknown_function++; + if (!(args.pa_flags & (FLAG_SKIP_TOP_FN_RES | FLAG_SHOW_OFFSET))) { + if ((sym = pmcstat_symbol_search(image, pc)) != NULL) + pc = sym->ps_start; + else + pmcstat_stats.ps_samples_unknown_function++; + } for (hash = i = 0; i < sizeof(uintfptr_t); i++) hash += (pc >> i) & 0xFF; @@ -485,22 +487,35 @@ pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, v = PMCPL_CG_COUNTP(cg); snprintf(vs, sizeof(vs), "%.1f", v); v_attrs = PMCSTAT_ATTRPERCENT(v); - sym = NULL; /* Format name. */ - if (!(args.pa_flags & FLAG_SKIP_TOP_FN_RES)) - sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); - if (sym != NULL) { - snprintf(ns, sizeof(ns), "%s", - pmcstat_string_unintern(sym->ps_name)); - } else + sym = pmcstat_symbol_search(cg->pcg_image, cg->pcg_func); + if (sym == NULL) { snprintf(ns, sizeof(ns), "%p", (void *)(cg->pcg_image->pi_vaddr + cg->pcg_func)); + } else { + switch (args.pa_flags & (FLAG_SKIP_TOP_FN_RES | FLAG_SHOW_OFFSET)) { + case FLAG_SKIP_TOP_FN_RES | FLAG_SHOW_OFFSET: + case FLAG_SKIP_TOP_FN_RES: + snprintf(ns, sizeof(ns), "%p", + (void *)(cg->pcg_image->pi_vaddr + cg->pcg_func)); + break; + case FLAG_SHOW_OFFSET: + snprintf(ns, sizeof(ns), "%s+%#0lx", + pmcstat_string_unintern(sym->ps_name), + cg->pcg_func - sym->ps_start); + break; + default: + snprintf(ns, sizeof(ns), "%s", + pmcstat_string_unintern(sym->ps_name)); + break; + } + } PMCSTAT_ATTRON(v_attrs); PMCSTAT_PRINTW("%5.5s", vs); PMCSTAT_ATTROFF(v_attrs); - PMCSTAT_PRINTW(" %-10.10s %-20.20s", + PMCSTAT_PRINTW(" %-10.10s %-30.30s", pmcstat_string_unintern(cg->pcg_image->pi_name), ns); @@ -624,7 +639,7 @@ pmcpl_cg_topdisplay(void) qsort(sortbuffer, nentries, sizeof(struct pmcstat_cgnode *), pmcstat_cgnode_compare); - PMCSTAT_PRINTW("%5.5s %-10.10s %-20.20s %s\n", + PMCSTAT_PRINTW("%5.5s %-10.10s %-30.30s %s\n", "%SAMP", "IMAGE", "FUNCTION", "CALLERS"); nentries = min(pmcstat_displayheight - 2, nentries); Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Wed Aug 5 18:22:24 2020 (r363927) +++ head/usr.sbin/pmcstat/pmcstat.8 Wed Aug 5 19:05:49 2020 (r363928) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2018 +.Dd August 5, 2020 .Dt PMCSTAT 8 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd "performance measurement with performance monitoring hardware" .Sh SYNOPSIS .Nm +.Op Fl A .Op Fl C .Op Fl D Ar pathname .Op Fl E @@ -123,6 +124,8 @@ process' current and future children. .Sh OPTIONS The following options are available: .Bl -tag -width indent +.It Fl A +Skip symbol lookup and display address instead. .It Fl C Toggle between showing cumulative or incremental counts for subsequent counting mode PMCs specified on the command line. @@ -161,7 +164,7 @@ this information is sent to the output file specified .Fl o option. .It Fl I -Skip symbol lookup and display address instead. +Show the offset of the instruction pointer into the symbol. .It Fl L List all event names. .It Fl M Ar mapfilename @@ -222,10 +225,10 @@ specified in .Ar event-spec . .It Fl T Use a top like mode for sampling PMCs. The following hotkeys -can be used: 'c+a' switch to accumulative mode, 'c+d' switch -to delta mode, 'm' merge PMCs, 'n' change view, 'p' show next -PMC, ' ' pause, 'q' quit. calltree only: 'f' cost under threshold -is seen as a dot. +can be used: 'A' toggle symbol resolution, 'c+a' switch to accumulative mode, 'c+d' +switch to delta mode, 'I' toggle showing offsets into symbols, 'm' merge PMCs, 'n' +change view, 'p' show next PMC, ' ' pause, 'q' quit. calltree only: 'f' cost under +threshold is seen as a dot. .It Fl U Toggle capturing user-space call traces while in kernel mode. The default is for sampling PMCs to capture user-space callchain information Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Aug 5 18:22:24 2020 (r363927) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Aug 5 19:05:49 2020 (r363928) @@ -511,8 +511,12 @@ main(int argc, char **argv) CPU_COPY(&rootmask, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:ILM:NO:P:R:S:TUWZa:c:def:gi:k:l:m:n:o:p:qr:s:t:u:vw:z:")) != -1) + "ACD:EF:G:ILM:NO:P:R:S:TUWZa:c:def:gi:k:l:m:n:o:p:qr:s:t:u:vw:z:")) != -1) switch (option) { + case 'A': + args.pa_flags |= FLAG_SKIP_TOP_FN_RES; + break; + case 'a': /* Annotate + callgraph */ args.pa_flags |= FLAG_DO_ANNOTATE; args.pa_plugin = PMCSTAT_PL_ANNOTATE_CG; @@ -586,12 +590,13 @@ main(int argc, char **argv) args.pa_plugin = PMCSTAT_PL_GPROF; break; - case 'I': - args.pa_flags |= FLAG_SKIP_TOP_FN_RES; - break; case 'i': args.pa_flags |= FLAG_FILTER_THREAD_ID; args.pa_tid = strtol(optarg, &end, 0); + break; + + case 'I': + args.pa_flags |= FLAG_SHOW_OFFSET; break; case 'k': /* pathname to the kernel */ Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Wed Aug 5 18:22:24 2020 (r363927) +++ head/usr.sbin/pmcstat/pmcstat_log.c Wed Aug 5 19:05:49 2020 (r363928) @@ -612,6 +612,12 @@ pmcstat_keypress_log(void) c = wgetch(w); wprintw(w, "Key: %c => ", c); switch (c) { + case 'A': + if (args.pa_flags & FLAG_SKIP_TOP_FN_RES) + args.pa_flags &= ~FLAG_SKIP_TOP_FN_RES; + else + args.pa_flags |= FLAG_SKIP_TOP_FN_RES; + break; case 'c': wprintw(w, "enter mode 'd' or 'a' => "); c = wgetch(w); @@ -622,6 +628,12 @@ pmcstat_keypress_log(void) args.pa_topmode = PMCSTAT_TOP_ACCUM; wprintw(w, "switching to accumulation mode"); } + break; + case 'I': + if (args.pa_flags & FLAG_SHOW_OFFSET) + args.pa_flags &= ~FLAG_SHOW_OFFSET; + else + args.pa_flags |= FLAG_SHOW_OFFSET; break; case 'm': pmcstat_mergepmc = !pmcstat_mergepmc; From owner-svn-src-head@freebsd.org Wed Aug 5 19:11: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 224043A6BE9; Wed, 5 Aug 2020 19:11:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMLnx5yXkz46nd; Wed, 5 Aug 2020 19:11:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A3121AC20; Wed, 5 Aug 2020 19:11:33 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075JBXpM070143; Wed, 5 Aug 2020 19:11:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075JBWsU070138; Wed, 5 Aug 2020 19:11:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008051911.075JBWsU070138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 5 Aug 2020 19:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363929 - in head/sys: amd64/include dev/iommu i386/include x86/include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: amd64/include dev/iommu i386/include x86/include X-SVN-Commit-Revision: 363929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 19:11:34 -0000 Author: br Date: Wed Aug 5 19:11:31 2020 New Revision: 363929 URL: https://svnweb.freebsd.org/changeset/base/363929 Log: o Add machine/iommu.h and include MD iommu headers from it, so we don't ifdef for every arch in busdma_iommu.c; o No need to include specialreg.h for x86, remove it. Requested by: andrew Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25957 Added: head/sys/amd64/include/iommu.h (contents, props changed) head/sys/i386/include/iommu.h (contents, props changed) head/sys/x86/include/iommu.h (contents, props changed) Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu_gas.c Added: head/sys/amd64/include/iommu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/include/iommu.h Wed Aug 5 19:11:31 2020 (r363929) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Wed Aug 5 19:05:49 2020 (r363928) +++ head/sys/dev/iommu/busdma_iommu.c Wed Aug 5 19:11:31 2020 (r363929) @@ -59,17 +59,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#if defined(__amd64__) || defined(__i386__) -#include -#include -#include +#include #include -#include -#include -#endif /* * busdma_iommu.c, the implementation of the busdma(9) interface using Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Wed Aug 5 19:05:49 2020 (r363928) +++ head/sys/dev/iommu/iommu_gas.c Wed Aug 5 19:11:31 2020 (r363929) @@ -65,9 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__amd64__) || defined(__i386__) -#include -#endif +#include #include /* Added: head/sys/i386/include/iommu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/iommu.h Wed Aug 5 19:11:31 2020 (r363929) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#include Added: head/sys/x86/include/iommu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/iommu.h Wed Aug 5 19:11:31 2020 (r363929) @@ -0,0 +1,13 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +#ifndef _MACHINE_IOMMU_H_ +#define _MACHINE_IOMMU_H_ + +#include +#include +#include + +#endif /* !_MACHINE_IOMMU_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 5 19:16: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 3FCAD3A72BB; Wed, 5 Aug 2020 19:16:00 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMLv40xncz47YG; Wed, 5 Aug 2020 19:16:00 +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 03C021AEDF; Wed, 5 Aug 2020 19:16:00 +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 075JFxa7074385; Wed, 5 Aug 2020 19:15:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075JFxac074384; Wed, 5 Aug 2020 19:15:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008051915.075JFxac074384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 19:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363930 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 19:16:00 -0000 Author: mjg Date: Wed Aug 5 19:15:59 2020 New Revision: 363930 URL: https://svnweb.freebsd.org/changeset/base/363930 Log: pipe: reduce atime precision The routine is called on successful write and read, which on pipes happens a lot and for small sizes. Precision provided by default seems way bigger than necessary and it causes problems in vms on amd64 (it rdtscp's which vmexits). getnanotime seems to provide the level roughly in lines of Linux so we should be good here. Sample result from will-it-scale pipe1_processes -t 1 (ops/s): before: 426464 after: 3247421 Note the that atime handling for named pipes is broken with and without the patch. The filesystem code is never used for updating atime and never looks at the updated field. Consequently, while there are no provisions added to handle named pipes separately, the change is a nop for that case. Differential Revision: https://reviews.freebsd.org/D23964 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Aug 5 19:11:31 2020 (r363929) +++ head/sys/kern/sys_pipe.c Wed Aug 5 19:15:59 2020 (r363930) @@ -230,6 +230,7 @@ static int pipe_create(struct pipe *pipe, bool backing static int pipe_paircreate(struct thread *td, struct pipepair **p_pp); static __inline int pipelock(struct pipe *cpipe, int catch); static __inline void pipeunlock(struct pipe *cpipe); +static void pipe_timestamp(struct timespec *tsp); #ifndef PIPE_NODIRECT static int pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio); static void pipe_destroy_write_buffer(struct pipe *wpipe); @@ -279,7 +280,7 @@ pipe_zone_ctor(void *mem, int size, void *arg, int fla */ rpipe = &pp->pp_rpipe; bzero(rpipe, sizeof(*rpipe)); - vfs_timestamp(&rpipe->pipe_ctime); + pipe_timestamp(&rpipe->pipe_ctime); rpipe->pipe_atime = rpipe->pipe_mtime = rpipe->pipe_ctime; wpipe = &pp->pp_wpipe; @@ -422,6 +423,20 @@ pipe_dtor(struct pipe *dpipe) } /* + * Get a timestamp. + * + * This used to be vfs_timestamp but the higher precision is unnecessary and + * can very negatively affect performance in virtualized environments (e.g., on + * vms running on amd64 when using the rdtscp instruction). + */ +static void +pipe_timestamp(struct timespec *tsp) +{ + + getnanotime(tsp); +} + +/* * The pipe system call for the DTYPE_PIPE type of pipes. If we fail, let * the zone pick up the pieces via pipeclose(). */ @@ -804,7 +819,7 @@ locked_error: /* XXX: should probably do this before getting any locks. */ if (error == 0) - vfs_timestamp(&rpipe->pipe_atime); + pipe_timestamp(&rpipe->pipe_atime); unlocked_error: --rpipe->pipe_busy; @@ -1290,7 +1305,7 @@ pipe_write(struct file *fp, struct uio *uio, struct uc error = 0; if (error == 0) - vfs_timestamp(&wpipe->pipe_mtime); + pipe_timestamp(&wpipe->pipe_mtime); /* * We have something to offer, From owner-svn-src-head@freebsd.org Wed Aug 5 19:34: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 EA85C3A7616; Wed, 5 Aug 2020 19:34:13 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMMJ55v3wz48B9; Wed, 5 Aug 2020 19:34:13 +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 AEF871B19C; Wed, 5 Aug 2020 19:34:13 +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 075JYDI5086768; Wed, 5 Aug 2020 19:34:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075JYDL0086767; Wed, 5 Aug 2020 19:34:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008051934.075JYDL0086767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 19:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363931 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 19:34:14 -0000 Author: mjg Date: Wed Aug 5 19:34:13 2020 New Revision: 363931 URL: https://svnweb.freebsd.org/changeset/base/363931 Log: vfs hash: annotate the lock with __exclusive_cache_line Note the code does not scale in the current form. Modified: head/sys/kern/vfs_hash.c Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Wed Aug 5 19:15:59 2020 (r363930) +++ head/sys/kern/vfs_hash.c Wed Aug 5 19:34:13 2020 (r363931) @@ -43,7 +43,7 @@ static MALLOC_DEFINE(M_VFS_HASH, "vfs_hash", "VFS hash static LIST_HEAD(vfs_hash_head, vnode) *vfs_hash_tbl; static LIST_HEAD(,vnode) vfs_hash_side; static u_long vfs_hash_mask; -static struct rwlock vfs_hash_lock; +static struct rwlock __exclusive_cache_line vfs_hash_lock; static void vfs_hashinit(void *dummy __unused) From owner-svn-src-head@freebsd.org Wed Aug 5 20:42: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 344313A8D8A; Wed, 5 Aug 2020 20:42:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMNpT0fXRz4Clp; Wed, 5 Aug 2020 20:42:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDEF91BEC2; Wed, 5 Aug 2020 20:42:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075Kg8lO026429; Wed, 5 Aug 2020 20:42:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Kg8LE026428; Wed, 5 Aug 2020 20:42:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008052042.075Kg8LE026428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 20:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363932 - head/usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.sbin/pmcstat X-SVN-Commit-Revision: 363932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 20:42:09 -0000 Author: mjg Date: Wed Aug 5 20:42:08 2020 New Revision: 363932 URL: https://svnweb.freebsd.org/changeset/base/363932 Log: pmcstat: fix build on non-64 bit platforms Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Aug 5 19:34:13 2020 (r363931) +++ head/usr.sbin/pmcstat/pmcpl_callgraph.c Wed Aug 5 20:42:08 2020 (r363932) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -501,7 +502,7 @@ pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, (void *)(cg->pcg_image->pi_vaddr + cg->pcg_func)); break; case FLAG_SHOW_OFFSET: - snprintf(ns, sizeof(ns), "%s+%#0lx", + snprintf(ns, sizeof(ns), "%s+%#0" PRIx64, pmcstat_string_unintern(sym->ps_name), cg->pcg_func - sym->ps_start); break; From owner-svn-src-head@freebsd.org Wed Aug 5 22:09: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 C05213AA1D2; Wed, 5 Aug 2020 22:09:40 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMQlS4lPQz4Hk6; Wed, 5 Aug 2020 22:09:40 +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 86F421D0D9; Wed, 5 Aug 2020 22:09:40 +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 075M9ekh079042; Wed, 5 Aug 2020 22:09:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075M9ewm079041; Wed, 5 Aug 2020 22:09:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008052209.075M9ewm079041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 22:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363933 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 363933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 22:09:40 -0000 Author: mjg Date: Wed Aug 5 22:09:40 2020 New Revision: 363933 URL: https://svnweb.freebsd.org/changeset/base/363933 Log: riscv: fix uintfptr_t Fixes compilation after r363932 Modified: head/sys/riscv/include/profile.h Modified: head/sys/riscv/include/profile.h ============================================================================== --- head/sys/riscv/include/profile.h Wed Aug 5 20:42:08 2020 (r363932) +++ head/sys/riscv/include/profile.h Wed Aug 5 22:09:40 2020 (r363933) @@ -70,7 +70,7 @@ void mcount(uintfptr_t frompc, uintfptr_t selfpc); #else /* !_KERNEL */ -typedef unsigned long long uintfptr_t; +typedef __uintfptr_t uintfptr_t; #define _MCOUNT_DECL void mcount #define MCOUNT From owner-svn-src-head@freebsd.org Wed Aug 5 22:09: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 DF41A3AA1F5; Wed, 5 Aug 2020 22:09:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMQln5fZtz4HqR; Wed, 5 Aug 2020 22:09:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4EFA1CBEB; Wed, 5 Aug 2020 22:09:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075M9vHk079104; Wed, 5 Aug 2020 22:09:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075M9vag079103; Wed, 5 Aug 2020 22:09:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008052209.075M9vag079103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 22:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363934 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 363934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 22:09:57 -0000 Author: mjg Date: Wed Aug 5 22:09:57 2020 New Revision: 363934 URL: https://svnweb.freebsd.org/changeset/base/363934 Log: arm64: fix uintfptr_t Fixes compilation after r363932 Modified: head/sys/arm64/include/profile.h Modified: head/sys/arm64/include/profile.h ============================================================================== --- head/sys/arm64/include/profile.h Wed Aug 5 22:09:40 2020 (r363933) +++ head/sys/arm64/include/profile.h Wed Aug 5 22:09:57 2020 (r363934) @@ -70,7 +70,7 @@ void mcount(uintfptr_t frompc, uintfptr_t selfpc); #else /* !_KERNEL */ -typedef unsigned long long uintfptr_t; +typedef __uintfptr_t uintfptr_t; #define _MCOUNT_DECL void mcount #define MCOUNT From owner-svn-src-head@freebsd.org Wed Aug 5 22: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 A34E13AA4FF; Wed, 5 Aug 2020 22:27:41 +0000 (UTC) (envelope-from bz@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BMR8F3hmMz4JjR; Wed, 5 Aug 2020 22:27:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 457BE22D9E; Wed, 5 Aug 2020 22:27:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 97D038D4A388; Wed, 5 Aug 2020 22:27:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E9409E707C9; Wed, 5 Aug 2020 22:27:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id nyqR5Tldm7-Q; Wed, 5 Aug 2020 22:27:36 +0000 (UTC) Received: from [169.254.45.172] (unknown [IPv6:fde9:577b:c1a9:4902:1c04:979c:855d:2881]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 333F3E707B4; Wed, 5 Aug 2020 22:27:36 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Emmanuel Vadot" , "Warner Losh" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363862 - head/sys/cam/mmc Date: Wed, 05 Aug 2020 22:27:35 +0000 X-Mailer: MailMate (2.0BETAr6146) Message-ID: <676873E2-9199-4EE5-ADEF-59A8F9E1308B@FreeBSD.org> In-Reply-To: <202008042004.074K40ls016193@repo.freebsd.org> References: <202008042004.074K40ls016193@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 05 Aug 2020 22:27:41 -0000 On 4 Aug 2020, at 20:04, Emmanuel Vadot wrote: > Author: manu > Date: Tue Aug 4 20:04:00 2020 > New Revision: 363862 > URL: https://svnweb.freebsd.org/changeset/base/363862 > > Log: > mmccam: Hold the periph during init > > We need to sleep during this routine so acquire the cam hold too. Turns out that with this my /dev/sddaX.. device nodes are never created. Reverting this and things work a lot better again. > > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D25946 > > Modified: > head/sys/cam/mmc/mmc_da.c > > Modified: head/sys/cam/mmc/mmc_da.c > ============================================================================== > --- head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:02:23 2020 (r363861) > +++ head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:04:00 2020 (r363862) > @@ -1109,7 +1109,9 @@ sdda_start_init_task(void *context, int pending) > { > CAM_PRIORITY_NONE); > > cam_periph_lock(periph); > + cam_periph_hold(periph, PRIBIO|PCATCH); > sdda_start_init(context, new_ccb); > + cam_periph_unhold(periph); > cam_periph_unlock(periph); > xpt_free_ccb(new_ccb); > } From owner-svn-src-head@freebsd.org Thu Aug 6 00:23: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 010823ACE64; Thu, 6 Aug 2020 00:23:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMTjQ669Wz4R3V; Thu, 6 Aug 2020 00:23:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B43DA1E91F; Thu, 6 Aug 2020 00:23:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0760N6Cn065194; Thu, 6 Aug 2020 00:23:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0760N6Nb065193; Thu, 6 Aug 2020 00:23:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008060023.0760N6Nb065193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Aug 2020 00:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363935 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 363935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 00:23:07 -0000 Author: mjg Date: Thu Aug 6 00:23:06 2020 New Revision: 363935 URL: https://svnweb.freebsd.org/changeset/base/363935 Log: mac: even up all entry points to the same scheme - use a macro for checking whether the site is enabled - expand it to 0 if mac is not compiled in to begin with Modified: head/sys/security/mac/mac_framework.h Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Wed Aug 5 22:09:57 2020 (r363934) +++ head/sys/security/mac/mac_framework.h Thu Aug 6 00:23:06 2020 (r363935) @@ -264,11 +264,12 @@ extern bool mac_priv_check_fp_flag; #else #define mac_priv_check_fp_flag 0 #endif +#define mac_priv_check_enabled() __predict_false(mac_priv_check_fp_flag) static inline int mac_priv_check(struct ucred *cred, int priv) { - if (__predict_false(mac_priv_check_fp_flag)) + if (mac_priv_check_enabled()) return (mac_priv_check_impl(cred, priv)); return (0); } @@ -279,11 +280,12 @@ extern bool mac_priv_grant_fp_flag; #else #define mac_priv_grant_fp_flag 0 #endif +#define mac_priv_grant_enabled() __predict_false(mac_priv_grant_fp_flag) static inline int mac_priv_grant(struct ucred *cred, int priv) { - if (__predict_false(mac_priv_grant_fp_flag)) + if (mac_priv_grant_enabled()) return (mac_priv_grant_impl(cred, priv)); return (EPERM); } @@ -441,7 +443,11 @@ int mac_vnode_check_listextattr(struct ucred *cred, st int mac_vnode_check_lookup_impl(struct ucred *cred, struct vnode *dvp, struct componentname *cnp); +#ifdef MAC extern bool mac_vnode_check_lookup_fp_flag; +#else +#define mac_vnode_check_lookup_fp_flag 0 +#endif #define mac_vnode_check_lookup_enabled() __predict_false(mac_vnode_check_lookup_fp_flag) static inline int mac_vnode_check_lookup(struct ucred *cred, struct vnode *dvp, @@ -456,28 +462,38 @@ mac_vnode_check_lookup(struct ucred *cred, struct vnod int mac_vnode_check_mmap_impl(struct ucred *cred, struct vnode *vp, int prot, int flags); +#ifdef MAC extern bool mac_vnode_check_mmap_fp_flag; +#else +#define mac_vnode_check_mmap_fp_flag 0 +#endif +#define mac_vnode_check_mmap_enabled() __predict_false(mac_vnode_check_mmap_fp_flag) static inline int mac_vnode_check_mmap(struct ucred *cred, struct vnode *vp, int prot, int flags) { mac_vnode_assert_locked(vp, "mac_vnode_check_mmap"); - if (__predict_false(mac_vnode_check_mmap_fp_flag)) + if (mac_vnode_check_mmap_enabled()) return (mac_vnode_check_mmap_impl(cred, vp, prot, flags)); return (0); } int mac_vnode_check_open_impl(struct ucred *cred, struct vnode *vp, accmode_t accmode); +#ifdef MAC extern bool mac_vnode_check_open_fp_flag; +#else +#define mac_vnode_check_open_fp_flag 0 +#endif +#define mac_vnode_check_open_enabled() __predict_false(mac_vnode_check_open_fp_flag) static inline int mac_vnode_check_open(struct ucred *cred, struct vnode *vp, accmode_t accmode) { mac_vnode_assert_locked(vp, "mac_vnode_check_open"); - if (__predict_false(mac_vnode_check_open_fp_flag)) + if (mac_vnode_check_open_enabled()) return (mac_vnode_check_open_impl(cred, vp, accmode)); return (0); } @@ -526,42 +542,57 @@ int mac_vnode_check_setutimes(struct ucred *cred, stru int mac_vnode_check_stat_impl(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp); +#ifdef MAC extern bool mac_vnode_check_stat_fp_flag; +#else +#define mac_vnode_check_stat_fp_flag 0 +#endif +#define mac_vnode_check_stat_enabled() __predict_false(mac_vnode_check_stat_fp_flag) static inline int mac_vnode_check_stat(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp) { mac_vnode_assert_locked(vp, "mac_vnode_check_stat"); - if (__predict_false(mac_vnode_check_stat_fp_flag)) + if (mac_vnode_check_stat_enabled()) return (mac_vnode_check_stat_impl(active_cred, file_cred, vp)); return (0); } int mac_vnode_check_read_impl(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp); +#ifdef MAC extern bool mac_vnode_check_read_fp_flag; +#else +#define mac_vnode_check_read_fp_flag 0 +#endif +#define mac_vnode_check_read_enabled() __predict_false(mac_vnode_check_read_fp_flag) static inline int mac_vnode_check_read(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp) { mac_vnode_assert_locked(vp, "mac_vnode_check_read"); - if (__predict_false(mac_vnode_check_read_fp_flag)) + if (mac_vnode_check_read_enabled()) return (mac_vnode_check_read_impl(active_cred, file_cred, vp)); return (0); } int mac_vnode_check_write_impl(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp); +#ifdef MAC extern bool mac_vnode_check_write_fp_flag; +#else +#define mac_vnode_check_write_fp_flag 0 +#endif +#define mac_vnode_check_write_enabled() __predict_false(mac_vnode_check_write_fp_flag) static inline int mac_vnode_check_write(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp) { mac_vnode_assert_locked(vp, "mac_vnode_check_write"); - if (__predict_false(mac_vnode_check_write_fp_flag)) + if (mac_vnode_check_write_enabled()) return (mac_vnode_check_write_impl(active_cred, file_cred, vp)); return (0); } From owner-svn-src-head@freebsd.org Thu Aug 6 04:19: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 81D4C3B10A5; Thu, 6 Aug 2020 04:19: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMZyX2PKCz4cCC; Thu, 6 Aug 2020 04:19:48 +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 31FB421174; Thu, 6 Aug 2020 04:19:48 +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 0764Jmxl007241; Thu, 6 Aug 2020 04:19:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0764JmVj007240; Thu, 6 Aug 2020 04:19:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008060419.0764JmVj007240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Aug 2020 04:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363938 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 04:19:48 -0000 Author: mjg Date: Thu Aug 6 04:19:47 2020 New Revision: 363938 URL: https://svnweb.freebsd.org/changeset/base/363938 Log: cache: plug unititalized variable use CID: 1431128 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Aug 6 01:49:00 2020 (r363937) +++ head/sys/kern/vfs_cache.c Thu Aug 6 04:19:47 2020 (r363938) @@ -3456,8 +3456,7 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) vput(dvp); else vrele(dvp); - cache_fpl_aborted(fpl); - return (error); + return (cache_fpl_aborted(fpl)); } error = cache_fplookup_final_child(fpl, tvs); From owner-svn-src-head@freebsd.org Thu Aug 6 04:20: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 4AADD3B0ED4; Thu, 6 Aug 2020 04:20:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMZz31FCrz4bwm; Thu, 6 Aug 2020 04:20:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D654211D4; Thu, 6 Aug 2020 04:20:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0764KEjR007342; Thu, 6 Aug 2020 04:20:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0764KEM1007341; Thu, 6 Aug 2020 04:20:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008060420.0764KEM1007341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Aug 2020 04:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363939 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 04:20:15 -0000 Author: mjg Date: Thu Aug 6 04:20:14 2020 New Revision: 363939 URL: https://svnweb.freebsd.org/changeset/base/363939 Log: cache: add more predicts for failing conditions Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Aug 6 04:19:47 2020 (r363938) +++ head/sys/kern/vfs_cache.c Thu Aug 6 04:20:14 2020 (r363939) @@ -3389,7 +3389,7 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum if ((cnp->cn_flags & LOCKSHARED) == 0) lkflags = LK_EXCLUSIVE; error = vget_finish(tvp, lkflags, tvs); - if (error != 0) { + if (__predict_false(error != 0)) { return (cache_fpl_aborted(fpl)); } } else { @@ -3442,7 +3442,7 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) if ((cnp->cn_flags & LOCKPARENT) != 0) { error = vget_finish(dvp, LK_EXCLUSIVE, dvs); - if (error != 0) { + if (__predict_false(error != 0)) { vget_abort(tvp, tvs); return (cache_fpl_aborted(fpl)); } @@ -3460,7 +3460,7 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) } error = cache_fplookup_final_child(fpl, tvs); - if (error != 0) { + if (__predict_false(error != 0)) { MPASS(fpl->status == CACHE_FPL_STATUS_ABORTED); if ((cnp->cn_flags & LOCKPARENT) != 0) vput(dvp); From owner-svn-src-head@freebsd.org Thu Aug 6 08:21: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 F14B137AADB; Thu, 6 Aug 2020 08:21:33 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMhKT638Cz3bZd; Thu, 6 Aug 2020 08:21:33 +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 B2EC223DF6; Thu, 6 Aug 2020 08:21:33 +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 0768LXg0058041; Thu, 6 Aug 2020 08:21:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0768LXPi058040; Thu, 6 Aug 2020 08:21:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008060821.0768LXPi058040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 6 Aug 2020 08:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363945 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 08:21:34 -0000 Author: manu Date: Thu Aug 6 08:21:33 2020 New Revision: 363945 URL: https://svnweb.freebsd.org/changeset/base/363945 Log: mmccam: Unhold the periph when we add the device Otherwise the device node aren't created. Pointy hat to: manu Reported by: bz Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Thu Aug 6 08:06:07 2020 (r363944) +++ head/sys/cam/mmc/mmc_da.c Thu Aug 6 08:21:33 2020 (r363945) @@ -1505,6 +1505,7 @@ finish_hs_tests: softc->state = SDDA_STATE_NORMAL; + cam_periph_unhold(periph); /* MMC partitions support */ if (mmcp->card_features & CARD_FEATURE_MMC && mmc_get_spec_vers(periph) >= 4) { sdda_process_mmc_partitions(periph, start_ccb); @@ -1516,6 +1517,7 @@ finish_hs_tests: sdda_get_read_only(periph, start_ccb)); softc->part_curr = 0; } + cam_periph_hold(periph, PRIBIO|PCATCH); xpt_announce_periph(periph, softc->card_id_string); /* From owner-svn-src-head@freebsd.org Thu Aug 6 08:48: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 8F26637A9FA; Thu, 6 Aug 2020 08:48:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMhwS3JlYz3cHh; Thu, 6 Aug 2020 08:48:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54EE62451F; Thu, 6 Aug 2020 08:48:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0768mO8M072491; Thu, 6 Aug 2020 08:48:24 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0768mN7m072485; Thu, 6 Aug 2020 08:48:23 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008060848.0768mN7m072485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 6 Aug 2020 08:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363946 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 08:48:24 -0000 Author: br Date: Thu Aug 6 08:48:23 2020 New Revision: 363946 URL: https://svnweb.freebsd.org/changeset/base/363946 Log: Add iommu_domain constructor and destructor. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25956 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_idpgtbl.c Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Thu Aug 6 08:21:33 2020 (r363945) +++ head/sys/dev/iommu/busdma_iommu.c Thu Aug 6 08:48:23 2020 (r363946) @@ -1063,3 +1063,23 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmama free(ma, M_TEMP); return (error); } + +void +iommu_domain_init(struct iommu_unit *unit, struct iommu_domain *domain, + const struct iommu_domain_map_ops *ops) +{ + + domain->ops = ops; + domain->iommu = unit; + + RB_INIT(&domain->rb_root); + TAILQ_INIT(&domain->unload_entries); + mtx_init(&domain->lock, "iodom", NULL, MTX_DEF); +} + +void +iommu_domain_fini(struct iommu_domain *domain) +{ + + mtx_destroy(&domain->lock); +} Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Thu Aug 6 08:21:33 2020 (r363945) +++ head/sys/dev/iommu/iommu.h Thu Aug 6 08:48:23 2020 (r363946) @@ -223,6 +223,9 @@ int iommu_gas_reserve_region(struct iommu_domain *doma void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno); bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno); +void iommu_domain_init(struct iommu_unit *unit, struct iommu_domain *domain, + const struct iommu_domain_map_ops *ops); +void iommu_domain_fini(struct iommu_domain *domain); bool bus_dma_iommu_set_buswide(device_t dev); int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Thu Aug 6 08:21:33 2020 (r363945) +++ head/sys/x86/iommu/intel_ctx.c Thu Aug 6 08:48:23 2020 (r363946) @@ -322,6 +322,7 @@ static struct dmar_domain * dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapped) { struct iommu_domain *iodom; + struct iommu_unit *unit; struct dmar_domain *domain; int error, id, mgaw; @@ -330,16 +331,14 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp return (NULL); domain = malloc(sizeof(*domain), M_DMAR_DOMAIN, M_WAITOK | M_ZERO); iodom = DOM2IODOM(domain); + unit = DMAR2IOMMU(dmar); domain->domain = id; LIST_INIT(&domain->contexts); - RB_INIT(&domain->iodom.rb_root); - TAILQ_INIT(&domain->iodom.unload_entries); TASK_INIT(&domain->iodom.unload_task, 0, dmar_domain_unload_task, domain); - mtx_init(&domain->iodom.lock, "dmardom", NULL, MTX_DEF); + iommu_domain_init(unit, iodom, &dmar_domain_map_ops); + domain->dmar = dmar; - domain->iodom.iommu = &dmar->iommu; - domain_pgtbl_init(domain); /* * For now, use the maximal usable physical address of the @@ -430,8 +429,11 @@ dmar_ctx_unlink(struct dmar_ctx *ctx) static void dmar_domain_destroy(struct dmar_domain *domain) { + struct iommu_domain *iodom; struct dmar_unit *dmar; + iodom = DOM2IODOM(domain); + KASSERT(TAILQ_EMPTY(&domain->iodom.unload_entries), ("unfinished unloads %p", domain)); KASSERT(LIST_EMPTY(&domain->contexts), @@ -442,7 +444,7 @@ dmar_domain_destroy(struct dmar_domain *domain) ("destroying dom %p with refs %d", domain, domain->refs)); if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) { DMAR_DOMAIN_LOCK(domain); - iommu_gas_fini_domain(DOM2IODOM(domain)); + iommu_gas_fini_domain(iodom); DMAR_DOMAIN_UNLOCK(domain); } if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { @@ -450,7 +452,7 @@ dmar_domain_destroy(struct dmar_domain *domain) DMAR_DOMAIN_PGLOCK(domain); domain_free_pgtbl(domain); } - mtx_destroy(&domain->iodom.lock); + iommu_domain_fini(iodom); dmar = DOM2DMAR(domain); free_unr(dmar->domids, domain->domain); free(domain, M_DMAR_DOMAIN); Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Thu Aug 6 08:21:33 2020 (r363945) +++ head/sys/x86/iommu/intel_dmar.h Thu Aug 6 08:48:23 2020 (r363946) @@ -264,7 +264,7 @@ void domain_flush_iotlb_sync(struct dmar_domain *domai iommu_gaddr_t size); int domain_alloc_pgtbl(struct dmar_domain *domain); void domain_free_pgtbl(struct dmar_domain *domain); -void domain_pgtbl_init(struct dmar_domain *domain); +extern const struct iommu_domain_map_ops dmar_domain_map_ops; int dmar_dev_depth(device_t child); void dmar_dev_path(device_t child, int *busno, void *path1, int depth); Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Thu Aug 6 08:21:33 2020 (r363945) +++ head/sys/x86/iommu/intel_idpgtbl.c Thu Aug 6 08:48:23 2020 (r363946) @@ -813,16 +813,7 @@ domain_flush_iotlb_sync(struct dmar_domain *domain, io DMAR_UNLOCK(unit); } -static const struct iommu_domain_map_ops dmar_domain_map_ops = { +const struct iommu_domain_map_ops dmar_domain_map_ops = { .map = domain_map_buf, .unmap = domain_unmap_buf, }; - -void -domain_pgtbl_init(struct dmar_domain *domain) -{ - struct iommu_domain *iodom; - - iodom = DOM2IODOM(domain); - iodom->ops = &dmar_domain_map_ops; -} From owner-svn-src-head@freebsd.org Thu Aug 6 11:18:06 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 B213037D86F; Thu, 6 Aug 2020 11:18:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMmFB4K6Vz41Gj; Thu, 6 Aug 2020 11:18:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E9426200; Thu, 6 Aug 2020 11:18:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076BI6VT063966; Thu, 6 Aug 2020 11:18:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076BI6Rb063965; Thu, 6 Aug 2020 11:18:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202008061118.076BI6Rb063965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Aug 2020 11:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363948 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 363948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 11:18:06 -0000 Author: avg Date: Thu Aug 6 11:18:06 2020 New Revision: 363948 URL: https://svnweb.freebsd.org/changeset/base/363948 Log: ccu_sun8i_r: minor comment update MFC after: 1 week Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Thu Aug 6 10:12:39 2020 (r363947) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Thu Aug 6 11:18:06 2020 (r363948) @@ -119,7 +119,7 @@ NM_CLK(r_ccu_ir_clk, "ir", r_ccu_ir_parents, /* names, parents */ 0x54, /* offset */ 0, 4, 0, 0, /* N factor */ - 16, 2, 0, 0, /* M flags */ + 16, 2, 0, 0, /* M factor */ 24, 2, /* mux */ 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_REPARENT | AW_CLK_HAS_GATE);/* flags */ From owner-svn-src-head@freebsd.org Thu Aug 6 12:49: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 902803A1F4F; Thu, 6 Aug 2020 12:49:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMpGZ3Fprz45Sy; Thu, 6 Aug 2020 12:49:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 531BE270AE; Thu, 6 Aug 2020 12:49:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076CnQ6c018211; Thu, 6 Aug 2020 12:49:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076CnPFI018209; Thu, 6 Aug 2020 12:49:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008061249.076CnPFI018209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 6 Aug 2020 12:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363949 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 12:49:26 -0000 Author: br Date: Thu Aug 6 12:49:25 2020 New Revision: 363949 URL: https://svnweb.freebsd.org/changeset/base/363949 Log: Move dmar_domain_unload_task to busdma_iommu.c. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25972 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/x86/iommu/intel_ctx.c Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Thu Aug 6 11:18:06 2020 (r363948) +++ head/sys/dev/iommu/busdma_iommu.c Thu Aug 6 12:49:25 2020 (r363949) @@ -1064,6 +1064,26 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmama return (error); } +static void +iommu_domain_unload_task(void *arg, int pending) +{ + struct iommu_domain *domain; + struct iommu_map_entries_tailq entries; + + domain = arg; + TAILQ_INIT(&entries); + + for (;;) { + IOMMU_DOMAIN_LOCK(domain); + TAILQ_SWAP(&domain->unload_entries, &entries, + iommu_map_entry, dmamap_link); + IOMMU_DOMAIN_UNLOCK(domain); + if (TAILQ_EMPTY(&entries)) + break; + iommu_domain_unload(domain, &entries, true); + } +} + void iommu_domain_init(struct iommu_unit *unit, struct iommu_domain *domain, const struct iommu_domain_map_ops *ops) @@ -1072,6 +1092,7 @@ iommu_domain_init(struct iommu_unit *unit, struct iomm domain->ops = ops; domain->iommu = unit; + TASK_INIT(&domain->unload_task, 0, iommu_domain_unload_task, domain); RB_INIT(&domain->rb_root); TAILQ_INIT(&domain->unload_entries); mtx_init(&domain->lock, "iodom", NULL, MTX_DEF); Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Thu Aug 6 11:18:06 2020 (r363948) +++ head/sys/x86/iommu/intel_ctx.c Thu Aug 6 12:49:25 2020 (r363949) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); static MALLOC_DEFINE(M_DMAR_DOMAIN, "dmar_dom", "Intel DMAR Domain"); -static void dmar_domain_unload_task(void *arg, int pending); static void dmar_unref_domain_locked(struct dmar_unit *dmar, struct dmar_domain *domain); static void dmar_domain_destroy(struct dmar_domain *domain); @@ -334,8 +333,6 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp unit = DMAR2IOMMU(dmar); domain->domain = id; LIST_INIT(&domain->contexts); - TASK_INIT(&domain->iodom.unload_task, 0, dmar_domain_unload_task, - domain); iommu_domain_init(unit, iodom, &dmar_domain_map_ops); domain->dmar = dmar; @@ -875,26 +872,6 @@ dmar_domain_unload(struct dmar_domain *domain, } TAILQ_CONCAT(&unit->tlb_flush_entries, entries, dmamap_link); DMAR_UNLOCK(unit); -} - -static void -dmar_domain_unload_task(void *arg, int pending) -{ - struct dmar_domain *domain; - struct iommu_map_entries_tailq entries; - - domain = arg; - TAILQ_INIT(&entries); - - for (;;) { - DMAR_DOMAIN_LOCK(domain); - TAILQ_SWAP(&domain->iodom.unload_entries, &entries, - iommu_map_entry, dmamap_link); - DMAR_DOMAIN_UNLOCK(domain); - if (TAILQ_EMPTY(&entries)) - break; - dmar_domain_unload(domain, &entries, true); - } } struct iommu_ctx * From owner-svn-src-head@freebsd.org Thu Aug 6 13:25: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 464CA3A2855; Thu, 6 Aug 2020 13:25:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMq3j1CzHz47TP; Thu, 6 Aug 2020 13:25:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D2C027839; Thu, 6 Aug 2020 13:25:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076DP4WK042612; Thu, 6 Aug 2020 13:25:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076DP4Ql042611; Thu, 6 Aug 2020 13:25:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008061325.076DP4Ql042611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 6 Aug 2020 13:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363950 - in head/sys/dev: rtwn/usb usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 363950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 13:25:05 -0000 Author: hselasky Date: Thu Aug 6 13:25:04 2020 New Revision: 363950 URL: https://svnweb.freebsd.org/changeset/base/363950 Log: Add new USB ID. Submitted by: Dmitry Luhtionov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Thu Aug 6 12:49:25 2020 (r363949) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Thu Aug 6 13:25:04 2020 (r363950) @@ -123,6 +123,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(TPLINK, WN727NV5), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), + RTWN_RTL8188EU_DEV(MERCUSYS, MW150US), #undef RTWN_RTL8188EU_DEV /* RTL8812AU */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Aug 6 12:49:25 2020 (r363949) +++ head/sys/dev/usb/usbdevs Thu Aug 6 13:25:04 2020 (r363950) @@ -782,6 +782,7 @@ vendor NHJ 0x2770 NHJ vendor THINGM 0x27b8 ThingM vendor PERASO 0x2932 Peraso Technologies, Inc. vendor PLANEX 0x2c02 Planex Communications +vendor MERCUSYS 0x2c4e Mercusys, Inc. vendor QUECTEL 0x2c7c Quectel Wireless Solutions vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. @@ -3191,6 +3192,9 @@ product MELCO WLIUCGNM2 0x01ee WLI-UC-GNM2 product MELCO WIU2433DM 0x0242 WI-U2-433DM product MELCO WIU3866D 0x025d WI-U3-866D product MELCO WIU2433DHP 0x029b WI-U2-433DHP + +/* Mercusys, Inc. */ +product MERCUSYS MW150US 0x0102 Mercusys MW150US /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 From owner-svn-src-head@freebsd.org Thu Aug 6 13:41: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 491A33A3132; Thu, 6 Aug 2020 13:41:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMqQv1SX6z48bf; Thu, 6 Aug 2020 13:41:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF7BB27DD8; Thu, 6 Aug 2020 13:41:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076DfgcR050924; Thu, 6 Aug 2020 13:41:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076Dfgp8050921; Thu, 6 Aug 2020 13:41:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202008061341.076Dfgp8050921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Aug 2020 13:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363951 - in head/sys: conf dev/usb/misc modules/usb modules/usb/cp2112 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: conf dev/usb/misc modules/usb modules/usb/cp2112 X-SVN-Commit-Revision: 363951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 13:41:43 -0000 Author: avg Date: Thu Aug 6 13:41:42 2020 New Revision: 363951 URL: https://svnweb.freebsd.org/changeset/base/363951 Log: cp2112: driver for the namesake GPIO and I2C master gadget Documentation: - CP2112 Datasheet https://www.silabs.com/documents/public/data-sheets/cp2112-datasheet.pdf - AN495: CP2112 Interface Specification https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf - CP2112 Errata https://www.silabs.com/documents/public/errata/cp2112-errata.pdf The logic is implemented as three sub-drivers. The parent driver claims the USB device and creates two child devices. One acts as a GPIO controller and the other is an I2C controller. Tested with CP2112 revision F02. Both features seem to work. HTU21 sensor was used as an I2C slave. Reviewed by: adrian, hselasky MFC after: 2 weeks Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D25359 Added: head/sys/dev/usb/misc/cp2112.c (contents, props changed) head/sys/modules/usb/cp2112/ head/sys/modules/usb/cp2112/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 6 13:25:04 2020 (r363950) +++ head/sys/conf/files Thu Aug 6 13:41:42 2020 (r363951) @@ -3331,6 +3331,7 @@ dev/usb/serial/usb_serial.c optional ucom | u3g | uar # # USB misc drivers # +dev/usb/misc/cp2112.c optional cp2112 dev/usb/misc/ufm.c optional ufm dev/usb/misc/udbp.c optional udbp dev/usb/misc/ugold.c optional ugold Added: head/sys/dev/usb/misc/cp2112.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/misc/cp2112.c Thu Aug 6 13:41:42 2020 (r363951) @@ -0,0 +1,1381 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * Hardware information links: + * - CP2112 Datasheet + * https://www.silabs.com/documents/public/data-sheets/cp2112-datasheet.pdf + * - AN495: CP2112 Interface Specification + * https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf + * - CP2112 Errata + * https://www.silabs.com/documents/public/errata/cp2112-errata.pdf + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include "iicbus_if.h" + +#include +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR usb_debug +#include + +#define CP2112GPIO_LOCK(sc) sx_xlock(&sc->gpio_lock) +#define CP2112GPIO_UNLOCK(sc) sx_xunlock(&sc->gpio_lock) +#define CP2112GPIO_LOCKED(sc) sx_assert(&sc->gpio_lock, SX_XLOCKED) + +#define CP2112_PART_NUM 0x0c +#define CP2112_GPIO_COUNT 8 +#define CP2112_REPORT_SIZE 64 + +#define CP2112_REQ_RESET 0x1 +#define CP2112_REQ_GPIO_CFG 0x2 +#define CP2112_REQ_GPIO_GET 0x3 +#define CP2112_REQ_GPIO_SET 0x4 +#define CP2112_REQ_VERSION 0x5 +#define CP2112_REQ_SMB_CFG 0x6 + +#define CP2112_REQ_SMB_READ 0x10 +#define CP2112_REQ_SMB_WRITE_READ 0x11 +#define CP2112_REQ_SMB_READ_FORCE_SEND 0x12 +#define CP2112_REQ_SMB_READ_RESPONSE 0x13 +#define CP2112_REQ_SMB_WRITE 0x14 +#define CP2112_REQ_SMB_XFER_STATUS_REQ 0x15 +#define CP2112_REQ_SMB_XFER_STATUS_RESP 0x16 +#define CP2112_REQ_SMB_CANCEL 0x17 + +#define CP2112_REQ_LOCK 0x20 +#define CP2112_REQ_USB_CFG 0x21 + +#define CP2112_IIC_REPSTART_VER 2 /* Erratum CP2112_E10. */ + +#define CP2112_IIC_STATUS0_IDLE 0 +#define CP2112_IIC_STATUS0_BUSY 1 +#define CP2112_IIC_STATUS0_CMP 2 +#define CP2112_IIC_STATUS0_ERROR 3 + +#define CP2112_IIC_STATUS1_TIMEOUT_NACK 0 +#define CP2112_IIC_STATUS1_TIMEOUT_BUS 1 +#define CP2112_IIC_STATUS1_ARB_LOST 2 + + +struct cp2112_softc { + device_t sc_gpio_dev; + device_t sc_iic_dev; + struct usb_device *sc_udev; + uint8_t sc_iface_index; + uint8_t sc_version; +}; + +struct cp2112gpio_softc { + struct sx gpio_lock; + device_t busdev; + int gpio_caps; + struct gpio_pin pins[CP2112_GPIO_COUNT]; +}; + +static int cp2112_detach(device_t dev); +static int cp2112gpio_detach(device_t dev); +static int cp2112iic_detach(device_t dev); + +static int +cp2112_get_report(device_t dev, uint8_t id, void *data, uint16_t len) +{ + struct cp2112_softc *sc; + int err; + + sc = device_get_softc(dev); + err = usbd_req_get_report(sc->sc_udev, NULL, data, + len, sc->sc_iface_index, UHID_FEATURE_REPORT, id); + return (err); +} + +static int +cp2112_set_report(device_t dev, uint8_t id, void *data, uint16_t len) +{ + struct cp2112_softc *sc; + int err; + + sc = device_get_softc(dev); + err = usbd_req_set_report(sc->sc_udev, NULL, data, + len, sc->sc_iface_index, UHID_FEATURE_REPORT, id); + return (err); +} + +static int +cp2112_gpio_read_pin(device_t dev, uint32_t pin_num, bool *on) +{ + struct { + uint8_t id; + uint8_t state; + } __packed data; + struct cp2112gpio_softc *sc; + int err; + + sc = device_get_softc(dev); + CP2112GPIO_LOCKED(sc); + + data.id = CP2112_REQ_GPIO_GET; + err = cp2112_get_report(device_get_parent(dev), + CP2112_REQ_GPIO_GET, &data, sizeof(data)); + if (err != 0) + return (err); + *on = (data.state & ((uint8_t)1 << pin_num)) != 0; + return (0); + +} + +static int +cp2112_gpio_write_pin(device_t dev, uint32_t pin_num, bool on) +{ + struct { + uint8_t id; + uint8_t state; + uint8_t mask; + } __packed data; + struct cp2112gpio_softc *sc; + int err; + bool actual; + + sc = device_get_softc(dev); + CP2112GPIO_LOCKED(sc); + + data.id = CP2112_REQ_GPIO_SET; + data.state = (uint8_t)on << pin_num; + data.mask = (uint8_t)1 << pin_num; + + err = cp2112_set_report(device_get_parent(dev), + CP2112_REQ_GPIO_SET, &data, sizeof(data)); + if (err != 0) + return (err); + err = cp2112_gpio_read_pin(dev, pin_num, &actual); + if (err != 0) + return (err); + if (actual != on) + return (EIO); + return (0); +} + +static int +cp2112_gpio_configure_write_pin(device_t dev, uint32_t pin_num, + bool output, bool pushpull) +{ + struct { + uint8_t id; + uint8_t output; + uint8_t pushpull; + uint8_t special; + uint8_t divider; + } __packed data; + struct cp2112gpio_softc *sc; + int err; + uint8_t mask; + + sc = device_get_softc(dev); + CP2112GPIO_LOCKED(sc); + + mask = (uint8_t)1 << pin_num; + data.id = CP2112_REQ_GPIO_CFG; + err = cp2112_get_report(device_get_parent(dev), + CP2112_REQ_GPIO_CFG, &data, sizeof(data)); + if (err != 0) + return (err); + if (output) { + data.output |= mask; + if (pushpull) + data.pushpull |= mask; + else + data.pushpull &= ~mask; + } else { + data.output &= ~mask; + data.pushpull &= ~mask; + } + + err = cp2112_set_report(device_get_parent(dev), + CP2112_REQ_GPIO_CFG, &data, sizeof(data)); + if (err != 0) + return (err); + + /* Read back and verify. */ + err = cp2112_get_report(device_get_parent(dev), + CP2112_REQ_GPIO_CFG, &data, sizeof(data)); + if (err != 0) + return (err); + if (((data.output & mask) != 0) != output) + return (EIO); + if (((data.pushpull & mask) != 0) != pushpull) + return (EIO); + return (0); +} + +static device_t +cp2112_gpio_get_bus(device_t dev) +{ + struct cp2112gpio_softc *sc; + + sc = device_get_softc(dev); + return (sc->busdev); +} + +static int +cp2112_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = CP2112_GPIO_COUNT - 1; + return (0); +} + +static int +cp2112_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value) +{ + struct cp2112gpio_softc *sc; + int err; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + err = cp2112_gpio_write_pin(dev, pin_num, pin_value != 0); + CP2112GPIO_UNLOCK(sc); + + return (err); +} + +static int +cp2112_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value) +{ + struct cp2112gpio_softc *sc; + int err; + bool on; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + err = cp2112_gpio_read_pin(dev, pin_num, &on); + CP2112GPIO_UNLOCK(sc); + + if (err == 0) + *pin_value = on; + return (err); +} + +static int +cp2112_gpio_pin_toggle(device_t dev, uint32_t pin_num) +{ + struct cp2112gpio_softc *sc; + int err; + bool on; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + err = cp2112_gpio_read_pin(dev, pin_num, &on); + if (err == 0) + err = cp2112_gpio_write_pin(dev, pin_num, !on); + CP2112GPIO_UNLOCK(sc); + + return (err); +} + +static int +cp2112_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps) +{ + struct cp2112gpio_softc *sc; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + *caps = sc->gpio_caps; + CP2112GPIO_UNLOCK(sc); + + return (0); +} + +static int +cp2112_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags) +{ + struct cp2112gpio_softc *sc; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + *flags = sc->pins[pin_num].gp_flags; + CP2112GPIO_UNLOCK(sc); + + return (0); +} + +static int +cp2112_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name) +{ + struct cp2112gpio_softc *sc; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + CP2112GPIO_LOCK(sc); + memcpy(name, sc->pins[pin_num].gp_name, GPIOMAXNAME); + CP2112GPIO_UNLOCK(sc); + + return (0); +} + +static int +cp2112_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags) +{ + struct cp2112gpio_softc *sc; + struct gpio_pin *pin; + int err; + + if (pin_num >= CP2112_GPIO_COUNT) + return (EINVAL); + + sc = device_get_softc(dev); + if ((flags & sc->gpio_caps) != flags) + return (EINVAL); + + if ((flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) == 0) + return (EINVAL); + if ((flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) { + return (EINVAL); + } + if ((flags & GPIO_PIN_INPUT) != 0) { + if ((flags & (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) != 0) + return (EINVAL); + } else { + if ((flags & (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) == + (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) + return (EINVAL); + } + + CP2112GPIO_LOCK(sc); + pin = &sc->pins[pin_num]; + + /* + * If neither push-pull or opendrain is explcitely requested, then + * preserve the current state. + */ + if ((flags & GPIO_PIN_OUTPUT) != 0 && + (flags & (GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL)) == 0) + flags |= pin->gp_flags & (GPIO_PIN_OPENDRAIN|GPIO_PIN_PUSHPULL); + err = cp2112_gpio_configure_write_pin(dev, pin_num, + (flags & GPIO_PIN_OUTPUT) != 0, + (flags & GPIO_PIN_PUSHPULL) != 0); + if (err == 0) + pin->gp_flags = flags; + CP2112GPIO_UNLOCK(sc); + + return (err); +} + +static const STRUCT_USB_HOST_ID cp2112_devs[] = { + { USB_VP(USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP2112) }, + { USB_VP(0x1009, USB_PRODUCT_SILABS_CP2112) }, /* XXX */ +}; + +static int +cp2112_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bInterfaceClass != UICLASS_HID) + return (ENXIO); + + if (usbd_lookup_id_by_uaa(cp2112_devs, sizeof(cp2112_devs), uaa) == 0) + return (BUS_PROBE_DEFAULT); + return (ENXIO); +} + +static int +cp2112_attach(device_t dev) +{ + struct { + uint8_t id; + uint8_t part_num; + uint8_t version; + } __packed vdata; + struct usb_attach_arg *uaa; + struct cp2112_softc *sc; + int err; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + + device_set_usb_desc(dev); + + sc->sc_udev = uaa->device; + sc->sc_iface_index = uaa->info.bIfaceIndex; + + vdata.id = CP2112_REQ_VERSION; + err = cp2112_get_report(dev, CP2112_REQ_VERSION, &vdata, sizeof(vdata)); + if (err != 0) + goto detach; + device_printf(dev, "part number 0x%02x, version 0x%02x\n", + vdata.part_num, vdata.version); + if (vdata.part_num != CP2112_PART_NUM) { + device_printf(dev, "unsupported part number\n"); + goto detach; + } + sc->sc_version = vdata.version; + sc->sc_gpio_dev = device_add_child(dev, "gpio", -1); + if (sc->sc_gpio_dev != NULL) { + err = device_probe_and_attach(sc->sc_gpio_dev); + if (err != 0) { + device_printf(dev, "failed to attach gpio child\n"); + } + } else { + device_printf(dev, "failed to create gpio child\n"); + } + + sc->sc_iic_dev = device_add_child(dev, "iichb", -1); + if (sc->sc_iic_dev != NULL) { + err = device_probe_and_attach(sc->sc_iic_dev); + if (err != 0) { + device_printf(dev, "failed to attach iic child\n"); + } + } else { + device_printf(dev, "failed to create iic child\n"); + } + + return (0); + +detach: + cp2112_detach(dev); + return (ENXIO); +} + +static int +cp2112_detach(device_t dev) +{ + int err; + + err = bus_generic_detach(dev); + if (err != 0) + return (err); + device_delete_children(dev); + return (0); +} + +static int +cp2112gpio_probe(device_t dev) +{ + device_set_desc(dev, "CP2112 GPIO interface"); + return (BUS_PROBE_SPECIFIC); +} + +static int +cp2112gpio_attach(device_t dev) +{ + struct { + uint8_t id; + uint8_t output; + uint8_t pushpull; + uint8_t special; + uint8_t divider; + } __packed data; + struct cp2112gpio_softc *sc; + device_t cp2112; + int err; + int i; + uint8_t mask; + + cp2112 = device_get_parent(dev); + sc = device_get_softc(dev); + sx_init(&sc->gpio_lock, "cp2112 lock"); + + sc->gpio_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN | + GPIO_PIN_PUSHPULL; + + data.id = CP2112_REQ_GPIO_CFG; + err = cp2112_get_report(cp2112, CP2112_REQ_GPIO_CFG, + &data, sizeof(data)); + if (err != 0) + goto detach; + + for (i = 0; i < CP2112_GPIO_COUNT; i++) { + struct gpio_pin *pin; + + mask = (uint8_t)1 << i; + pin = &sc->pins[i]; + pin->gp_flags = 0; + + snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%u", i); + pin->gp_name[GPIOMAXNAME - 1] = '\0'; + + if ((data.output & mask) != 0) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + if ((data.pushpull & mask) != 0) + pin->gp_flags |= GPIO_PIN_PUSHPULL; + else + pin->gp_flags |= GPIO_PIN_OPENDRAIN; + } else { + pin->gp_flags |= GPIO_PIN_INPUT; + } + } + + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + device_printf(dev, "gpiobus_attach_bus failed\n"); + goto detach; + } + return (0); + +detach: + cp2112gpio_detach(dev); + return (ENXIO); +} + +static int +cp2112gpio_detach(device_t dev) +{ + struct cp2112gpio_softc *sc; + + sc = device_get_softc(dev); + if (sc->busdev != NULL) + gpiobus_detach_bus(dev); + sx_destroy(&sc->gpio_lock); + return (0); +} + +static device_method_t cp2112hid_methods[] = { + DEVMETHOD(device_probe, cp2112_probe), + DEVMETHOD(device_attach, cp2112_attach), + DEVMETHOD(device_detach, cp2112_detach), + + DEVMETHOD_END +}; + +static device_method_t cp2112gpio_methods[] = { + /* Device */ + DEVMETHOD(device_probe, cp2112gpio_probe), + DEVMETHOD(device_attach, cp2112gpio_attach), + DEVMETHOD(device_detach, cp2112gpio_detach), + + /* GPIO */ + DEVMETHOD(gpio_get_bus, cp2112_gpio_get_bus), + DEVMETHOD(gpio_pin_max, cp2112_gpio_pin_max), + DEVMETHOD(gpio_pin_get, cp2112_gpio_pin_get), + DEVMETHOD(gpio_pin_set, cp2112_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, cp2112_gpio_pin_toggle), + DEVMETHOD(gpio_pin_getname, cp2112_gpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, cp2112_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, cp2112_gpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, cp2112_gpio_pin_setflags), + + DEVMETHOD_END +}; + +static driver_t cp2112hid_driver = { + .name = "cp2112hid", + .methods = cp2112hid_methods, + .size = sizeof(struct cp2112_softc), +}; + +static devclass_t cp2112hid_devclass; +DRIVER_MODULE(cp2112hid, uhub, cp2112hid_driver, cp2112hid_devclass, + NULL, NULL); +MODULE_DEPEND(cp2112hid, usb, 1, 1, 1); +MODULE_VERSION(cp2112hid, 1); +USB_PNP_HOST_INFO(cp2112_devs); + +static driver_t cp2112gpio_driver = { + .name = "gpio", + .methods = cp2112gpio_methods, + .size = sizeof(struct cp2112gpio_softc), +}; + +static devclass_t cp2112gpio_devclass; +DRIVER_MODULE(cp2112gpio, cp2112hid, cp2112gpio_driver, cp2112gpio_devclass, + NULL, NULL); +MODULE_DEPEND(cp2112gpio, cp2112hid, 1, 1, 1); +MODULE_DEPEND(cp2112gpio, gpiobus, 1, 1, 1); +MODULE_VERSION(cp2112gpio, 1); + + + +/* CP2112 I2C driver code. */ + + +enum { + CP2112_INTR_OUT = 0, + CP2112_INTR_IN, + CP2112_N_TRANSFER, +}; + +struct cp2112iic_softc { + device_t dev; + device_t iicbus_dev; + struct usb_xfer *xfers[CP2112_N_TRANSFER]; + u_char own_addr; + struct { + struct mtx lock; + struct cv cv; + struct { + uint8_t *data; + int len; + int done; + int error; + } in; + struct { + const uint8_t *data; + int len; + int done; + int error; + } out; + } io; +}; + +static void +cp2112iic_intr_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct cp2112iic_softc *sc; + struct cp2112_softc *psc; + struct usb_page_cache *pc; + + sc = usbd_xfer_softc(xfer); + psc = device_get_softc(device_get_parent(sc->dev)); + + mtx_assert(&sc->io.lock, MA_OWNED); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_SETUP: + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_in(pc, 0, sc->io.out.data, sc->io.out.len); + usbd_xfer_set_frame_len(xfer, 0, sc->io.out.len); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + break; + case USB_ST_TRANSFERRED: + sc->io.out.error = 0; + sc->io.out.done = 1; + cv_signal(&sc->io.cv); + break; + default: /* Error */ + device_printf(sc->dev, "write intr state %d error %d\n", + USB_GET_STATE(xfer), error); + sc->io.out.error = IIC_EBUSERR; + cv_signal(&sc->io.cv); + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + } + break; + } +} + +static void +cp2112iic_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct cp2112iic_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int act_len, len; + + mtx_assert(&sc->io.lock, MA_OWNED); + usbd_xfer_status(xfer, &act_len, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + if (sc->io.in.done) { + device_printf(sc->dev, + "interrupt while previous is pending, ignored\n"); + } else if (sc->io.in.len == 0) { + uint8_t buf[8]; + + /* + * There is a spurious Transfer Status Response and + * zero-length Read Response during hardware + * configuration. Possibly they carry some information + * about the initial bus state. + */ + if (device_is_attached(sc->dev)) { + device_printf(sc->dev, + "unsolicited interrupt, ignored\n"); + if (bootverbose) { + pc = usbd_xfer_get_frame(xfer, 0); + len = MIN(sizeof(buf), act_len); + usbd_copy_out(pc, 0, buf, len); + device_printf(sc->dev, "data: %*D\n", + len, buf, " "); + } + } else { + pc = usbd_xfer_get_frame(xfer, 0); + len = MIN(sizeof(buf), act_len); + usbd_copy_out(pc, 0, buf, len); + if (buf[0] == CP2112_REQ_SMB_XFER_STATUS_RESP) { + device_printf(sc->dev, + "initial bus status0 = 0x%02x, " + "status1 = 0x%02x\n", + buf[1], buf[2]); + } + } + } else if (act_len == CP2112_REPORT_SIZE) { + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, sc->io.in.data, sc->io.in.len); + sc->io.in.error = 0; + sc->io.in.done = 1; + } else { + device_printf(sc->dev, + "unexpected input report length %u\n", act_len); + sc->io.in.error = IIC_EBUSERR; + sc->io.in.done = 1; + } + cv_signal(&sc->io.cv); + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + device_printf(sc->dev, "read intr state %d error %d\n", + USB_GET_STATE(xfer), error); + + sc->io.in.error = IIC_EBUSERR; + sc->io.in.done = 1; + cv_signal(&sc->io.cv); + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static const struct usb_config cp2112iic_config[CP2112_N_TRANSFER] = { + [CP2112_INTR_OUT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = { .pipe_bof = 1, .no_pipe_ok = 1, }, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &cp2112iic_intr_write_callback, + }, + [CP2112_INTR_IN] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &cp2112iic_intr_read_callback, + }, +}; + +static int +cp2112iic_send_req(struct cp2112iic_softc *sc, const void *data, + uint16_t len) +{ + int err; + + mtx_assert(&sc->io.lock, MA_OWNED); + KASSERT(sc->io.out.done == 0, ("%s: conflicting request", __func__)); + + sc->io.out.data = data; + sc->io.out.len = len; + + DTRACE_PROBE1(send__req, uint8_t, *(const uint8_t *)data); + + usbd_transfer_start(sc->xfers[CP2112_INTR_OUT]); + + while (!sc->io.out.done) + cv_wait(&sc->io.cv, &sc->io.lock); + + usbd_transfer_stop(sc->xfers[CP2112_INTR_OUT]); + + sc->io.out.done = 0; + sc->io.out.data = NULL; + sc->io.out.len = 0; + err = sc->io.out.error; + if (err != 0) { + device_printf(sc->dev, "output report 0x%02x failed: %d\n", + *(const uint8_t*)data, err); + } + return (err); +} + +static int +cp2112iic_req_resp(struct cp2112iic_softc *sc, const void *req_data, + uint16_t req_len, void *resp_data, uint16_t resp_len) +{ + int err; + + mtx_assert(&sc->io.lock, MA_OWNED); + + /* + * Prepare to receive a response interrupt even before the + * request transfer is confirmed (USB_ST_TRANSFERED). + */ + KASSERT(sc->io.in.done == 0, ("%s: conflicting request", __func__)); + sc->io.in.len = resp_len; + sc->io.in.data = resp_data; + + err = cp2112iic_send_req(sc, req_data, req_len); + if (err != 0) { + sc->io.in.len = 0; + sc->io.in.data = NULL; + return (err); + } + + while (!sc->io.in.done) + cv_wait(&sc->io.cv, &sc->io.lock); + + err = sc->io.in.error; + sc->io.in.done = 0; + sc->io.in.error = 0; + sc->io.in.len = 0; + sc->io.in.data = NULL; + return (err); +} + +static int +cp2112iic_check_req_status(struct cp2112iic_softc *sc) +{ + struct { + uint8_t id; + uint8_t request; + } __packed xfer_status_req; + struct { + uint8_t id; + uint8_t status0; + uint8_t status1; + uint16_t status2; + uint16_t status3; + } __packed xfer_status_resp; + int err; + + mtx_assert(&sc->io.lock, MA_OWNED); + + do { + xfer_status_req.id = CP2112_REQ_SMB_XFER_STATUS_REQ; + xfer_status_req.request = 1; + err = cp2112iic_req_resp(sc, + &xfer_status_req, sizeof(xfer_status_req), + &xfer_status_resp, sizeof(xfer_status_resp)); + + if (xfer_status_resp.id != CP2112_REQ_SMB_XFER_STATUS_RESP) { + device_printf(sc->dev, + "unexpected response 0x%02x to status request\n", + xfer_status_resp.id); + err = IIC_EBUSERR; + goto out; + } + + DTRACE_PROBE4(xfer__status, uint8_t, xfer_status_resp.status0, + uint8_t, xfer_status_resp.status1, + uint16_t, be16toh(xfer_status_resp.status2), + uint16_t, be16toh(xfer_status_resp.status3)); + + switch (xfer_status_resp.status0) { + case CP2112_IIC_STATUS0_IDLE: + err = IIC_ESTATUS; + break; + case CP2112_IIC_STATUS0_BUSY: + err = ERESTART; /* non-I2C, special handling */ + break; + case CP2112_IIC_STATUS0_CMP: + err = IIC_NOERR; + break; + case CP2112_IIC_STATUS0_ERROR: + switch (xfer_status_resp.status1) { + case CP2112_IIC_STATUS1_TIMEOUT_NACK: + err = IIC_ENOACK; + break; + case CP2112_IIC_STATUS1_TIMEOUT_BUS: + err = IIC_ETIMEOUT; + break; + case CP2112_IIC_STATUS1_ARB_LOST: + err = IIC_EBUSBSY; + break; + default: + device_printf(sc->dev, + "i2c error, status = 0x%02x\n", + xfer_status_resp.status1); + err = IIC_ESTATUS; + break; + } + break; + default: + device_printf(sc->dev, + "unknown i2c xfer status0 0x%02x\n", + xfer_status_resp.status0); + err = IIC_EBUSERR; + break; + } + + } while (err == ERESTART); +out: + return (err); +} + +static int +cp2112iic_read_data(struct cp2112iic_softc *sc, void *data, uint16_t in_len, + uint16_t *out_len) +{ + struct { + uint8_t id; + uint16_t length; + } __packed data_read_force_send; + struct { + uint8_t id; + uint8_t status; + uint8_t length; + uint8_t data[61]; + } __packed data_read_resp; + int err; + + mtx_assert(&sc->io.lock, MA_OWNED); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 6 15:17: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 B8D643A4642; Thu, 6 Aug 2020 15:17:44 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMsYh4Rz6z4DYC; Thu, 6 Aug 2020 15:17:44 +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 77E689010; Thu, 6 Aug 2020 15:17:44 +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 076FHirv010185; Thu, 6 Aug 2020 15:17:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076FHiVk010184; Thu, 6 Aug 2020 15:17:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008061517.076FHiVk010184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Aug 2020 15:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363955 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 363955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 15:17:44 -0000 Author: mav Date: Thu Aug 6 15:17:44 2020 New Revision: 363955 URL: https://svnweb.freebsd.org/changeset/base/363955 Log: Add Intel Apollo Lake AHCI ID. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Thu Aug 6 14:16:07 2020 (r363954) +++ head/sys/dev/ahci/ahci_pci.c Thu Aug 6 15:17:44 2020 (r363955) @@ -180,6 +180,7 @@ static const struct { {0x1f3e8086, 0x00, "Intel Avoton (RAID)", 0}, {0x1f3f8086, 0x00, "Intel Avoton (RAID)", 0}, {0x23a38086, 0x00, "Intel Coleto Creek", 0}, + {0x5ae38086, 0x00, "Intel Apollo Lake", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, {0x8c048086, 0x00, "Intel Lynx Point (RAID)", 0}, From owner-svn-src-head@freebsd.org Thu Aug 6 15:43: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 A0E413A571B; Thu, 6 Aug 2020 15:43:00 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMt6r3r4Gz4GMk; Thu, 6 Aug 2020 15:43:00 +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 67EB3926A; Thu, 6 Aug 2020 15:43:00 +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 076Fh0cH028428; Thu, 6 Aug 2020 15:43:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076Fh0Cb028427; Thu, 6 Aug 2020 15:43:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008061543.076Fh0Cb028427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Aug 2020 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363959 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 15:43:00 -0000 Author: markj Date: Thu Aug 6 15:42:59 2020 New Revision: 363959 URL: https://svnweb.freebsd.org/changeset/base/363959 Log: Remove the vfs.reassignbufcalls counter and sysctl. As the 20-year old comment above it suggests, the counter is of dubious value. Moreover, the (global) counter was not updated precisely and hurts scalability. Reviewed by: cem, kib, mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25965 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Aug 6 15:25:11 2020 (r363958) +++ head/sys/kern/vfs_subr.c Thu Aug 6 15:42:59 2020 (r363959) @@ -206,15 +206,6 @@ 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(). - * XXX these are probably of (very) limited utility now. - */ -static int reassignbufcalls; -SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW | CTLFLAG_STATS, - &reassignbufcalls, 0, "Number of calls to reassignbuf"); - 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"); @@ -2732,7 +2723,6 @@ reassignbuf(struct buf *bp) vp = bp->b_vp; bo = bp->b_bufobj; - ++reassignbufcalls; CTR3(KTR_BUF, "reassignbuf(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); From owner-svn-src-head@freebsd.org Thu Aug 6 15:43: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 1BC843A579D; Thu, 6 Aug 2020 15:43:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMt7773ybz4GWv; Thu, 6 Aug 2020 15:43:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D69059686; Thu, 6 Aug 2020 15:43:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076FhFNN028486; Thu, 6 Aug 2020 15:43:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076FhFbG028485; Thu, 6 Aug 2020 15:43:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008061543.076FhFbG028485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Aug 2020 15:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363960 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 15:43:16 -0000 Author: markj Date: Thu Aug 6 15:43:15 2020 New Revision: 363960 URL: https://svnweb.freebsd.org/changeset/base/363960 Log: Clean up reassignbuf() and buf_vlist_remove() a bit. - Convert panic() calls to INVARIANTS-only assertions. The PCTRIE code provides some of the same protection since it will panic upon an attempt to remove a non-resident buffer. - Update the comment above reassignbuf() to reflect reality. Reviewed by: cem, kib, mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25965 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Aug 6 15:42:59 2020 (r363959) +++ head/sys/kern/vfs_subr.c Thu Aug 6 15:43:15 2020 (r363960) @@ -2256,13 +2256,17 @@ static void buf_vlist_remove(struct buf *bp) { struct bufv *bv; + b_xflags_t flags; + flags = bp->b_xflags; + KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); ASSERT_BO_WLOCKED(bp->b_bufobj); - KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) != - (BX_VNDIRTY|BX_VNCLEAN), - ("buf_vlist_remove: Buf %p is on two lists", bp)); - if (bp->b_xflags & BX_VNDIRTY) + KASSERT((flags & (BX_VNDIRTY | BX_VNCLEAN)) != 0 && + (flags & (BX_VNDIRTY | BX_VNCLEAN)) != (BX_VNDIRTY | BX_VNCLEAN), + ("%s: buffer %p has invalid queue state", __func__, bp)); + + if ((flags & BX_VNDIRTY) != 0) bv = &bp->b_bufobj->bo_dirty; else bv = &bp->b_bufobj->bo_clean; @@ -2391,10 +2395,7 @@ brelvp(struct buf *bp) vp = bp->b_vp; /* XXX */ bo = bp->b_bufobj; BO_LOCK(bo); - if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) - buf_vlist_remove(bp); - else - panic("brelvp: Buffer %p not on queue.", bp); + buf_vlist_remove(bp); if ((bo->bo_flag & BO_ONWORKLST) && bo->bo_dirty.bv_cnt == 0) { bo->bo_flag &= ~BO_ONWORKLST; mtx_lock(&sync_mtx); @@ -2707,9 +2708,7 @@ syncer_resume(void) } /* - * Reassign a buffer from one vnode to another. - * Used to assign file specific control information - * (indirect blocks) to the vnode to which they belong. + * Move the buffer between the clean and dirty lists of its vnode. */ void reassignbuf(struct buf *bp) @@ -2724,23 +2723,15 @@ reassignbuf(struct buf *bp) vp = bp->b_vp; bo = bp->b_bufobj; + KASSERT((bp->b_flags & B_PAGING) == 0, + ("%s: cannot reassign paging buffer %p", __func__, bp)); + CTR3(KTR_BUF, "reassignbuf(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - /* - * B_PAGING flagged buffers cannot be reassigned because their vp - * is not fully linked in. - */ - if (bp->b_flags & B_PAGING) - panic("cannot reassign paging buffer"); - /* - * Delete from old vnode list, if on one. - */ BO_LOCK(bo); - if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) - buf_vlist_remove(bp); - else - panic("reassignbuf: Buffer %p not on queue.", bp); + buf_vlist_remove(bp); + /* * If dirty, put on list of dirty buffers; otherwise insert onto list * of clean buffers. From owner-svn-src-head@freebsd.org Thu Aug 6 16:11: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 15A2C3A5DAF; Thu, 6 Aug 2020 16:11:31 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMtlk6wjpz4J54; Thu, 6 Aug 2020 16:11:30 +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 D28D39673; Thu, 6 Aug 2020 16:11:30 +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 076GBUsr046098; Thu, 6 Aug 2020 16:11:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076GBU8i046096; Thu, 6 Aug 2020 16:11:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008061611.076GBU8i046096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 6 Aug 2020 16:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363962 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 363962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 16:11:31 -0000 Author: manu Date: Thu Aug 6 16:11:30 2020 New Revision: 363962 URL: https://svnweb.freebsd.org/changeset/base/363962 Log: pkgbase: Remove vcs revision from kernel and runtime comment This is not needed and we don't do that for other packages. Modified: head/release/packages/kernel.ucl head/release/packages/runtime.ucl Modified: head/release/packages/kernel.ucl ============================================================================== --- head/release/packages/kernel.ucl Thu Aug 6 15:46:39 2020 (r363961) +++ head/release/packages/kernel.ucl Thu Aug 6 16:11:30 2020 (r363962) @@ -5,7 +5,7 @@ name = "FreeBSD-%PKGNAME%" origin = "base" version = "%VERSION%" -comment = "%COMMENT% %VCS_REVISION%" +comment = "%COMMENT%" categories = [ base ] maintainer = "re@FreeBSD.org" www = "https://www.FreeBSD.org" Modified: head/release/packages/runtime.ucl ============================================================================== --- head/release/packages/runtime.ucl Thu Aug 6 15:46:39 2020 (r363961) +++ head/release/packages/runtime.ucl Thu Aug 6 16:11:30 2020 (r363962) @@ -5,7 +5,7 @@ name = "FreeBSD-%PKGNAME%" origin = "base" version = "%VERSION%" -comment = "%COMMENT% %VCS_REVISION%" +comment = "%COMMENT%" categories = [ base ] maintainer = "re@FreeBSD.org" www = "https://www.FreeBSD.org" From owner-svn-src-head@freebsd.org Thu Aug 6 16:13: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 407B53A6355; Thu, 6 Aug 2020 16:13:55 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMtpW10YWz4JTP; Thu, 6 Aug 2020 16:13:55 +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 0709C9B9C; Thu, 6 Aug 2020 16:13:55 +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 076GDsqj047261; Thu, 6 Aug 2020 16:13:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076GDsbY047260; Thu, 6 Aug 2020 16:13:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008061613.076GDsbY047260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 6 Aug 2020 16:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363964 - head X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 363964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 16:13:55 -0000 Author: manu Date: Thu Aug 6 16:13:54 2020 New Revision: 363964 URL: https://svnweb.freebsd.org/changeset/base/363964 Log: pkgbase: Add a new variable PKG_TIMESTAMP libarchive uses the SOURCE_DATE_EPOCH env variable to set the date of file in an archive, this is useful for reproducibility. Add a variable name PKG_TIMESTAMP that take a epoch time and set SOURCE_DATE_EPOCH to this. By default it is the current time so no changes here. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 6 16:12:13 2020 (r363963) +++ head/Makefile.inc1 Thu Aug 6 16:13:54 2020 (r363964) @@ -545,6 +545,13 @@ PKG_VERSION= ${_REVISION}${EXTRA_REVISION} .endif .endif # !defined(PKG_VERSION) +.if !defined(PKG_TIMESTAMP) +TIMEEPOCHNOW= %s +SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime} +.else +SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP} +.endif + .if !defined(_MKSHOWCONFIG) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE @@ -1831,6 +1838,7 @@ create-packages-kernel: _pkgbootstrap _repodir .PHONY ${MAKE} -f Makefile.inc1 \ DESTDIR=${KSTAGEDIR} \ PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \ + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ create-kernel-packages create-packages: .PHONY create-packages-world create-packages-kernel @@ -1847,6 +1855,7 @@ create-world-packages: _pkgbootstrap .PHONY done > ${WSTAGEDIR}/packages.mk ${_+_}@cd ${.CURDIR}; \ ${MAKE} -f Makefile.inc1 create-world-packages-jobs \ + SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ .MAKE.JOB.PREFIX= .if make(create-world-packages-jobs) From owner-svn-src-head@freebsd.org Thu Aug 6 16:14: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 22B533A5CFF; Thu, 6 Aug 2020 16:14:44 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMtqS04FMz4Jlb; Thu, 6 Aug 2020 16:14:44 +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 DA4429AEA; Thu, 6 Aug 2020 16:14: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 076GEheL047345; Thu, 6 Aug 2020 16:14:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076GEhnA047344; Thu, 6 Aug 2020 16:14:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008061614.076GEhnA047344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 6 Aug 2020 16:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363965 - head X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 363965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 16:14:44 -0000 Author: manu Date: Thu Aug 6 16:14:43 2020 New Revision: 363965 URL: https://svnweb.freebsd.org/changeset/base/363965 Log: pkgbase: Add the possibility to choose the output dir The output dir is set to ${REPODIR}/${PKG_ABI}/${PKG_VERSION} now. Add the possibility to specify the last componant and set it by default to ${PKG_VERSION} as before. This is useful for tests and also for building packages with the same PKG_VERSION provided to check differences. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 6 16:13:54 2020 (r363964) +++ head/Makefile.inc1 Thu Aug 6 16:14:43 2020 (r363965) @@ -1789,6 +1789,7 @@ KSTAGEDIR?= ${OBJTOP}/kernelstage REPODIR?= ${OBJROOT}repo PKG_FORMAT?= txz PKGSIGNKEY?= # empty +PKG_OUTPUT_DIR?= ${PKG_VERSION} .ORDER: stage-packages create-packages .ORDER: create-packages create-world-packages @@ -1883,7 +1884,7 @@ create-world-package-${pkgname}: .PHONY create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} + -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} .endfor _default_flavor= -default @@ -1916,7 +1917,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} + -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} . endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1949,7 +1950,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} + -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} . endfor . endif . endfor @@ -1965,7 +1966,7 @@ sign-packages: _pkgbootstrap .PHONY ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \ - ln -s ${PKG_VERSION} latest + ln -s ${PKG_OUTPUT_DIR} latest # # From owner-svn-src-head@freebsd.org Thu Aug 6 16:20: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 86ECA3A5E21; Thu, 6 Aug 2020 16:20:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMtxx31L7z4Jtb; Thu, 6 Aug 2020 16:20:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46EB397F9; Thu, 6 Aug 2020 16:20:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076GKLjc047658; Thu, 6 Aug 2020 16:20:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076GKLoa047657; Thu, 6 Aug 2020 16:20:21 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202008061620.076GKLoa047657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 6 Aug 2020 16:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363966 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 16:20:21 -0000 Author: brooks Date: Thu Aug 6 16:20:20 2020 New Revision: 363966 URL: https://svnweb.freebsd.org/changeset/base/363966 Log: Preserve ASLR vm_map flags across fork In the most common case (fork+execve) this doesn't matter, but further attempts to apply entropy would fail in (e.g.) a pre-fork server. Reported by: Alfredo Mazzinghi Reviewed by: kib, markj Obtained from: CheriBSD MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D25966 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Aug 6 16:14:43 2020 (r363965) +++ head/sys/vm/vm_map.c Thu Aug 6 16:20:20 2020 (r363966) @@ -4109,6 +4109,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c } new_map->anon_loc = old_map->anon_loc; + new_map->flags |= old_map->flags & (MAP_ASLR | MAP_ASLR_IGNSTART); VM_MAP_ENTRY_FOREACH(old_entry, old_map) { if ((old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) From owner-svn-src-head@freebsd.org Thu Aug 6 17:28:01 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 8E4CB3A7156; Thu, 6 Aug 2020 17:28:01 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMwS05c9xz4MtF; Thu, 6 Aug 2020 17:28:00 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6A4DF3C0199; Thu, 6 Aug 2020 17:27:59 +0000 (UTC) Date: Thu, 6 Aug 2020 17:27:59 +0000 From: Brooks Davis To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363966 - head/sys/vm Message-ID: <20200806172759.GC19649@spindle.one-eyed-alien.net> References: <202008061620.076GKLoa047657@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JYK4vJDZwFMowpUq" Content-Disposition: inline In-Reply-To: <202008061620.076GKLoa047657@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4BMwS05c9xz4MtF X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-1.84 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.30)[-0.299]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.60)[-0.602]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_SHORT(-0.04)[-0.035]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 17:28:01 -0000 --JYK4vJDZwFMowpUq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 06, 2020 at 04:20:21PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Aug 6 16:20:20 2020 > New Revision: 363966 > URL: https://svnweb.freebsd.org/changeset/base/363966 >=20 > Log: > Preserve ASLR vm_map flags across fork > =20 > In the most common case (fork+execve) this doesn't matter, but further > attempts to apply entropy would fail in (e.g.) a pre-fork server. > =20 > Reported by: Alfredo Mazzinghi > Reviewed by: kib, markj > Obtained from: CheriBSD > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D25966 For the record, ASLR is off by default so there will not be a security advisory on this issue. If there are enough users who are concerned about this we will consider an eratta notice for 12.1. -- Brooks --JYK4vJDZwFMowpUq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfLD2eAAoJEKzQXbSebgfAcmMH/3/8c+Xbs1w0Rr/8qo9Bo/jN qA9dskspU6SAlIlaxv3Ip/AxtrghNobfTD8hnfnDu6B9p8jPtdpNvacCcYwpFWR7 +2Nr/tlQtiAF5m6PPAq/Blx9aMeuboqLdcq93k7F/6aB4Ngn/bSR5gaElVS3OWjh iMRwNtWvTWD26BFB4mHgEzd6t7qz9RiJSor2OwCD7/F9BJv6sECYseL21pNu8aSE PfE4KoXFVGKpyyoeLVThufZckY3Dvpsrhavr0sqTcRO9hjQOwN0rvEtGSBgA2AVI H4gNSBdgVmUZTvEcQsa46iajnpfnHUrCiE0/FZXbyZ74PczfLpbU8p0+1Xdi4s0= =zAIG -----END PGP SIGNATURE----- --JYK4vJDZwFMowpUq-- From owner-svn-src-head@freebsd.org Thu Aug 6 17:49: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 988723A7C11; Thu, 6 Aug 2020 17:49:20 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMwwc3Zk9z4PR1; Thu, 6 Aug 2020 17:49:20 +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 594B1AD18; Thu, 6 Aug 2020 17:49:20 +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 076HnKXh003458; Thu, 6 Aug 2020 17:49:20 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076HnKxX003457; Thu, 6 Aug 2020 17:49:20 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202008061749.076HnKxX003457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 6 Aug 2020 17:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363972 - head/lib/libc/powerpc64/gen X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/libc/powerpc64/gen X-SVN-Commit-Revision: 363972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 17:49:20 -0000 Author: bdragon Date: Thu Aug 6 17:49:19 2020 New Revision: 363972 URL: https://svnweb.freebsd.org/changeset/base/363972 Log: [POWERPC] Fix ppc64 makecontext() parameter overflow handling. On ELFv2, the overflow parameters in the stack frame are at a different offset from sp than ELFv1. Adjust code to use the correct offset in all cases. This had resulted in argv[8] and up being copied to the incorrect address in the new context's initial stack frame. This is not necessarily the only bug in this function, I need to do a full review still and ensure the rest of the math is sane for ELFv2 stack frames. Reported by: pherde (Probably. My notes are a bit unclear.) Reviewed by: jhibbits (in irc) Sponsored by: Tag1 Consulting, Inc. Modified: head/lib/libc/powerpc64/gen/makecontext.c Modified: head/lib/libc/powerpc64/gen/makecontext.c ============================================================================== --- head/lib/libc/powerpc64/gen/makecontext.c Thu Aug 6 16:44:24 2020 (r363971) +++ head/lib/libc/powerpc64/gen/makecontext.c Thu Aug 6 17:49:19 2020 (r363972) @@ -102,7 +102,11 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in uint64_t *argp; /* Skip past frame pointer and saved LR */ +#if !defined(_CALL_ELF) || _CALL_ELF == 1 argp = (uint64_t *)sp + 6; +#else + argp = (uint64_t *)sp + 4; +#endif for (i = 0; i < stackargs; i++) *argp++ = va_arg(ap, uint64_t); From owner-svn-src-head@freebsd.org Thu Aug 6 19:16: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 639D93A937E; Thu, 6 Aug 2020 19:16:13 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMyrs1z3vz4Tjs; Thu, 6 Aug 2020 19:16:13 +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 277F1B6F2; Thu, 6 Aug 2020 19:16:13 +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 076JGDb1058547; Thu, 6 Aug 2020 19:16:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076JGCqW058542; Thu, 6 Aug 2020 19:16:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008061916.076JGCqW058542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Aug 2020 19:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363979 - in head: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Commit-Revision: 363979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 19:16:13 -0000 Author: mav Date: Thu Aug 6 19:16:11 2020 New Revision: 363979 URL: https://svnweb.freebsd.org/changeset/base/363979 Log: Add CTL support for REPORT IDENTIFYING INFORMATION command. It allows to report to initiator LU identifying information, preset via "ident_info" and "text_ident_info" options. Unfortunately it is impossible to implement SET IDENTIFYING INFORMATION, since we have no persistent storage it requires, so the information is read-only for initiator and has to be set out-of-band. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Aug 6 19:15:31 2020 (r363978) +++ head/sys/cam/ctl/ctl.c Thu Aug 6 19:16:11 2020 (r363979) @@ -7130,6 +7130,88 @@ ctl_read_defect(struct ctl_scsiio *ctsio) } int +ctl_report_ident_info(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun = CTL_LUN(ctsio); + struct scsi_report_ident_info *cdb; + struct scsi_report_ident_info_data *rii_ptr; + struct scsi_report_ident_info_descr *riid_ptr; + const char *oii, *otii; + int retval, alloc_len, total_len = 0, len = 0; + + CTL_DEBUG_PRINT(("ctl_report_ident_info\n")); + + cdb = (struct scsi_report_ident_info *)ctsio->cdb; + retval = CTL_RETVAL_COMPLETE; + + total_len = sizeof(struct scsi_report_ident_info_data); + switch (cdb->type) { + case RII_LUII: + oii = dnvlist_get_string(lun->be_lun->options, + "ident_info", NULL); + if (oii) + len = strlen(oii); /* Approximately */ + break; + case RII_LUTII: + otii = dnvlist_get_string(lun->be_lun->options, + "text_ident_info", NULL); + if (otii) + len = strlen(otii) + 1; /* NULL-terminated */ + break; + case RII_IIS: + len = 2 * sizeof(struct scsi_report_ident_info_descr); + break; + default: + ctl_set_invalid_field(/*ctsio*/ ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 11, + /*bit_valid*/ 1, + /*bit*/ 2); + ctl_done((union ctl_io *)ctsio); + return(retval); + } + total_len += len; + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + ctsio->kern_sg_entries = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; + + rii_ptr = (struct scsi_report_ident_info_data *)ctsio->kern_data_ptr; + switch (cdb->type) { + case RII_LUII: + if (oii) { + if (oii[0] == '0' && oii[1] == 'x') + len = hex2bin(oii, (uint8_t *)(rii_ptr + 1), len); + else + strncpy((uint8_t *)(rii_ptr + 1), oii, len); + } + break; + case RII_LUTII: + if (otii) + strlcpy((uint8_t *)(rii_ptr + 1), otii, len); + break; + case RII_IIS: + riid_ptr = (struct scsi_report_ident_info_descr *)(rii_ptr + 1); + riid_ptr->type = RII_LUII; + scsi_ulto2b(0xffff, riid_ptr->length); + riid_ptr++; + riid_ptr->type = RII_LUTII; + scsi_ulto2b(0xffff, riid_ptr->length); + } + scsi_ulto2b(len, rii_ptr->length); + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + return(retval); +} + +int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = CTL_SOFTC(ctsio); Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Thu Aug 6 19:15:31 2020 (r363978) +++ head/sys/cam/ctl/ctl_cmd_table.c Thu Aug 6 19:16:11 2020 (r363979) @@ -829,8 +829,15 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] = /* 04 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, -/* 05 */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +/* 05 REPORT IDENTIFYING INFORMATION */ +{ctl_report_ident_info, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_NO_MEDIA | + CTL_CMD_FLAG_OK_ON_STANDBY | + CTL_CMD_FLAG_OK_ON_UNAVAIL | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, + 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x07}}, /* 06 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -854,7 +861,7 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] = CTL_LUN_PAT_NONE, 12, {0xea, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 0B */ +/* 0B REPORT ALIASES */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 0C REPORT SUPPORTED_OPCODES */ @@ -877,7 +884,7 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] = CTL_LUN_PAT_NONE, 12, {0x0d, 0x80, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 0E */ +/* 0E REPORT PRIORITY */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 0F REPORT TIMESTAMP */ @@ -890,7 +897,10 @@ const struct ctl_cmd_entry ctl_cmd_table_a3[32] = CTL_LUN_PAT_NONE, 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 10-1f */ +/* 10 MANAGEMENT PROTOCOL IN */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 11-1f */ }; const struct ctl_cmd_entry ctl_cmd_table[256] = Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Thu Aug 6 19:15:31 2020 (r363978) +++ head/sys/cam/ctl/ctl_private.h Thu Aug 6 19:16:11 2020 (r363979) @@ -517,6 +517,7 @@ int ctl_get_event_status(struct ctl_scsiio *ctsio); int ctl_mechanism_status(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio); +int ctl_report_ident_info(struct ctl_scsiio *ctsio); int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio); int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio); int ctl_report_supported_tmf(struct ctl_scsiio *ctsio); Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Aug 6 19:15:31 2020 (r363978) +++ head/sys/cam/scsi/scsi_all.h Thu Aug 6 19:16:11 2020 (r363979) @@ -1484,6 +1484,32 @@ struct scsi_maintenance_in uint8_t control; }; +struct scsi_report_ident_info +{ + uint8_t opcode; + uint8_t service_action; + uint8_t reserved[4]; + uint8_t length[4]; + uint8_t type; +#define RII_LUII 0x00 +#define RII_LUTII 0x04 +#define RII_IIS 0xfc + uint8_t control; +}; + +struct scsi_report_ident_info_data +{ + uint8_t reserved[2]; + uint8_t length[2]; +}; + +struct scsi_report_ident_info_descr +{ + uint8_t type; + uint8_t reserved; + uint8_t length[2]; +}; + struct scsi_report_supported_opcodes { uint8_t opcode; Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Thu Aug 6 19:15:31 2020 (r363978) +++ head/usr.sbin/ctladm/ctladm.8 Thu Aug 6 19:16:11 2020 (r363979) @@ -1,6 +1,6 @@ .\" .\" Copyright (c) 2003 Silicon Graphics International Corp. -.\" Copyright (c) 2015 Alexander Motin +.\" Copyright (c) 2015-2020 Alexander Motin .\" Copyright (c) 2018 Marcelo Araujo .\" All rights reserved. .\" @@ -36,7 +36,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd July 25, 2019 +.Dd August 6, 2020 .Dt CTLADM 8 .Os .Sh NAME @@ -877,6 +877,10 @@ EUI, NAA or UUID identifier should be set to UNIQUE va EXTENDED COPY command access the LUN. Non-unique LUN identifiers may lead to data corruption. Some initiators may not support later introduced UUID identifiers. +.It Va ident_info +Specified LUN identification information (string or 0x + hex). +.It Va text_ident_info +Specified LUN text identification information (UTF-8 string). .It Va ha_role Setting to "primary" or "secondary" overrides default role of the node in HA cluster, set by kern.cam.ctl.ha_role sysctl. From owner-svn-src-head@freebsd.org Thu Aug 6 20:31: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 E8B923A9ED5; Thu, 6 Aug 2020 20:31:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN0X65SrFz4YD4; Thu, 6 Aug 2020 20:31:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE1BCD8C; Thu, 6 Aug 2020 20:31:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076KVocl002693; Thu, 6 Aug 2020 20:31:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076KVoRt002692; Thu, 6 Aug 2020 20:31:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008062031.076KVoRt002692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 6 Aug 2020 20:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363988 - head/usr.sbin/yp_mkdb X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.sbin/yp_mkdb X-SVN-Commit-Revision: 363988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 20:31:51 -0000 Author: dim Date: Thu Aug 6 20:31:50 2020 New Revision: 363988 URL: https://svnweb.freebsd.org/changeset/base/363988 Log: Fix clang 11 -Wformat warnings in yp_mkdb: usr.sbin/yp_mkdb/yp_mkdb.c:91:40: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size, ~~~~ ^~~~~~~~ usr.sbin/yp_mkdb/yp_mkdb.c:92:7: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] data.data); ^~~~~~~~~ MFC after: 3 days Modified: head/usr.sbin/yp_mkdb/yp_mkdb.c Modified: head/usr.sbin/yp_mkdb/yp_mkdb.c ============================================================================== --- head/usr.sbin/yp_mkdb/yp_mkdb.c Thu Aug 6 19:34:55 2020 (r363987) +++ head/usr.sbin/yp_mkdb/yp_mkdb.c Thu Aug 6 20:31:50 2020 (r363988) @@ -88,8 +88,8 @@ unwind(char *map) key.data = NULL; while (yp_next_record(dbp, &key, &data, 1, 1) == YP_TRUE) - printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size, - data.data); + printf("%.*s %.*s\n", (int)key.size, (char *)key.data, + (int)data.size, (char *)data.data); (void)(dbp->close)(dbp); return; From owner-svn-src-head@freebsd.org Thu Aug 6 20:44: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 E88773AA7A1; Thu, 6 Aug 2020 20:44:40 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN0pw5sySz4ZHN; Thu, 6 Aug 2020 20:44:40 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACF5CCB60; Thu, 6 Aug 2020 20:44:40 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076Kie7I013610; Thu, 6 Aug 2020 20:44:40 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076Kiel8013609; Thu, 6 Aug 2020 20:44:40 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008062044.076Kiel8013609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 6 Aug 2020 20:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363991 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 363991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 20:44:41 -0000 Author: arichardson Date: Thu Aug 6 20:44:40 2020 New Revision: 363991 URL: https://svnweb.freebsd.org/changeset/base/363991 Log: ctfmerge: Fix missing pthread_cond_init() This does not appear to matter on FreeBSD or Linux, but when building an amd64 kernel on macOS I was seeing infinite loops in ctfmerge. It turns out the loop in wip_save_work() was looping forever due to pthread_cond_wait() always returning -EINVAL. Reviewed By: markj, brooks Differential Revision: https://reviews.freebsd.org/D25973 Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c Thu Aug 6 20:44:18 2020 (r363990) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c Thu Aug 6 20:44:40 2020 (r363991) @@ -665,6 +665,7 @@ wq_init(workqueue_t *wq, int nfiles) for (i = 0; i < nslots; i++) { pthread_mutex_init(&wq->wq_wip[i].wip_lock, NULL); + pthread_cond_init(&wq->wq_wip[i].wip_cv, NULL); wq->wq_wip[i].wip_batchid = wq->wq_next_batchid++; } From owner-svn-src-head@freebsd.org Thu Aug 6 20:46: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 A46BE3AAA4A; Thu, 6 Aug 2020 20:46:14 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN0rk2Mdsz4ZRy; Thu, 6 Aug 2020 20:46:14 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A0C4CB64; Thu, 6 Aug 2020 20:46:14 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076KkDbi013903; Thu, 6 Aug 2020 20:46:13 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076KkDSc013901; Thu, 6 Aug 2020 20:46:13 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008062046.076KkDSc013901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 6 Aug 2020 20:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363992 - head/usr.sbin/pwd_mkdb X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 363992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 20:46:14 -0000 Author: arichardson Date: Thu Aug 6 20:46:13 2020 New Revision: 363992 URL: https://svnweb.freebsd.org/changeset/base/363992 Log: Allow bootstrapping pwd_mkdb on Linux/macOS We need to provide a struct passwd that is compatible with the target system and this is not the case when cross-building from macOS/Linux. It should also be a problem when bootstrapping for an i386 target from a FreeBSD amd64 host since time_t does not match across those systems. However, pwd_mkdb always truncates integer values to 32-bit so this difference does not result in different databases. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25931 Added: head/usr.sbin/pwd_mkdb/pwd.h (contents, props changed) Modified: head/usr.sbin/pwd_mkdb/Makefile Modified: head/usr.sbin/pwd_mkdb/Makefile ============================================================================== --- head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:44:40 2020 (r363991) +++ head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:46:13 2020 (r363992) @@ -9,5 +9,8 @@ MAN= pwd_mkdb.8 SRCS= pw_scan.c pwd_mkdb.c CFLAGS+= -I${SRCTOP}/lib/libc/gen # for pw_scan.h +.if defined(BOOTSTRAPPING) +CFLAGS+=-I${.CURDIR} +.endif .include Added: head/usr.sbin/pwd_mkdb/pwd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pwd_mkdb/pwd.h Thu Aug 6 20:46:13 2020 (r363992) @@ -0,0 +1,66 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * When building pwd_mkdb we need to use target systems definition of + * struct passwd. This protects against future changes to struct passwd and + * is essential to allow cross-building from Linux/macOS hosts since the + * structure is not compatible there. + */ +#include +#include +/* + * Note: pwd_mkdb always stores uint32_t for all integer fields (including + * time_t!) so these definitions do not need to match sys/sys/_types.h + */ +typedef uint32_t _bootstrap_gid_t; +typedef uint32_t _bootstrap_uid_t; +typedef uint64_t _bootstrap_time_t; +#define _GID_T_DECLARED +#define _TIME_T_DECLARED +#define _UID_T_DECLARED +#define _SIZE_T_DECLARED + +#define gid_t _bootstrap_gid_t +#define uid_t _bootstrap_uid_t +#define time_t _bootstrap_time_t +#define passwd _bootstrap_passwd +#include "../../include/pwd.h" +#undef gid_t +#undef uid_t +#undef time_t From owner-svn-src-head@freebsd.org Thu Aug 6 20:46: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 C2D813AAB1B; Thu, 6 Aug 2020 20:46:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN0rs4VjNz4ZSY; Thu, 6 Aug 2020 20:46:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E255FCE1B; Thu, 6 Aug 2020 20:46:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076KkIgE013957; Thu, 6 Aug 2020 20:46:18 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076KkI8i013956; Thu, 6 Aug 2020 20:46:18 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008062046.076KkI8i013956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 6 Aug 2020 20:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363993 - head/stand X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 363993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 20:46:21 -0000 Author: arichardson Date: Thu Aug 6 20:46:18 2020 New Revision: 363993 URL: https://svnweb.freebsd.org/changeset/base/363993 Log: stand: use portable ln -n instead of ln -h This fixes the build on Linux Differential Revision: https://reviews.freebsd.org/D24783 Modified: head/stand/defs.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Aug 6 20:46:13 2020 (r363992) +++ head/stand/defs.mk Thu Aug 6 20:46:18 2020 (r363993) @@ -237,6 +237,6 @@ ${_ILINKS}: .NOMETA esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET} "->" $$path ; \ - ln -fhs $$path ${.TARGET} + ln -fns $$path ${.TARGET} .endif # !NO_OBJ .endif # __BOOT_DEFS_MK__ From owner-svn-src-head@freebsd.org Thu Aug 6 21:01: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 5FD053ABA05; Thu, 6 Aug 2020 21:01:27 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN1BH1xK5z4bl0; Thu, 6 Aug 2020 21:01:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25E4BCC77; Thu, 6 Aug 2020 21:01:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076L1R5h026310; Thu, 6 Aug 2020 21:01:27 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076L1RjA026309; Thu, 6 Aug 2020 21:01:27 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008062101.076L1RjA026309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 6 Aug 2020 21:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363995 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 363995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 21:01:27 -0000 Author: vmaffione Date: Thu Aug 6 21:01:26 2020 New Revision: 363995 URL: https://svnweb.freebsd.org/changeset/base/363995 Log: em(4): honor vlanhwtag offload The FreeBSD em driver fails to properly reset the VME flag in the e1000 CTRL register oneg the following ifconfig command ifconfig em1 -vlanhwtag Tested on the e1000 device emulated by QEMU, and on a real NIC (chip=0x10d38086). PR: 236584 Submitted by: murat@sunnyvalley.io Reported by: murat@sunnyvalley.io MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25286 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Aug 6 20:55:18 2020 (r363994) +++ head/sys/dev/e1000/if_em.c Thu Aug 6 21:01:26 2020 (r363995) @@ -1334,6 +1334,11 @@ em_if_init(if_ctx_t ctx) ctrl |= E1000_CTRL_VME; E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); } + } else { + u32 ctrl; + ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); + ctrl &= ~E1000_CTRL_VME; + E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); } /* Don't lose promiscuous settings */ From owner-svn-src-head@freebsd.org Thu Aug 6 21:32: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 81F963AC589; Thu, 6 Aug 2020 21:32:26 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN1t22tKTz4f2D; Thu, 6 Aug 2020 21:32:26 +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 4713CCFFA; Thu, 6 Aug 2020 21:32:26 +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 076LWQNp045482; Thu, 6 Aug 2020 21:32:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076LWQha045481; Thu, 6 Aug 2020 21:32:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008062132.076LWQha045481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 6 Aug 2020 21:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363996 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 363996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 21:32:26 -0000 Author: vmaffione Date: Thu Aug 6 21:32:25 2020 New Revision: 363996 URL: https://svnweb.freebsd.org/changeset/base/363996 Log: iflib: netmap: don't increment ifl_cidx on the wrong free list Netmap only uses free list 0 to keep it consistent with its one-to-one mapping between each netmap ring and a device RX (or TX) queue. However, the current iflib_netmap_rxsync() routine was mistakenly updating the ifl_cidx field of both free lists. PR: 248494 MFC after: 2 weeks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Aug 6 21:01:26 2020 (r363995) +++ head/sys/net/iflib.c Thu Aug 6 21:32:25 2020 (r363996) @@ -1076,28 +1076,28 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl struct netmap_adapter *na = kring->na; struct netmap_ring *ring = kring->ring; if_t ifp = na->ifp; - iflib_fl_t fl; uint32_t nm_i; /* index into the netmap ring */ uint32_t nic_i; /* index into the NIC ring */ - u_int i, n; + u_int n; u_int const lim = kring->nkr_num_slots - 1; u_int const head = kring->rhead; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - struct if_rxd_info ri; if_ctx_t ctx = ifp->if_softc; iflib_rxq_t rxq = &ctx->ifc_rxqs[kring->ring_id]; + iflib_fl_t fl = &rxq->ifr_fl[0]; + struct if_rxd_info ri; + if (head > lim) return netmap_ring_reinit(kring); /* - * XXX netmap_fl_refill() only ever (re)fills free list 0 so far. + * netmap only uses free list 0, to avoid out of order consumption + * of receive buffers */ - for (i = 0, fl = rxq->ifr_fl; i < rxq->ifr_nfl; i++, fl++) { - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - } + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* * First part: import newly received packets. @@ -1119,38 +1119,35 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl int crclen = iflib_crcstrip ? 0 : 4; int error, avail; - for (i = 0; i < rxq->ifr_nfl; i++) { - fl = &rxq->ifr_fl[i]; - nic_i = fl->ifl_cidx; - nm_i = netmap_idx_n2k(kring, nic_i); - avail = ctx->isc_rxd_available(ctx->ifc_softc, - rxq->ifr_id, nic_i, USHRT_MAX); - for (n = 0; avail > 0 && nm_i != hwtail_lim; n++, avail--) { - rxd_info_zero(&ri); - ri.iri_frags = rxq->ifr_frags; - ri.iri_qsidx = kring->ring_id; - ri.iri_ifp = ctx->ifc_ifp; - ri.iri_cidx = nic_i; + nic_i = fl->ifl_cidx; + nm_i = netmap_idx_n2k(kring, nic_i); + avail = ctx->isc_rxd_available(ctx->ifc_softc, + rxq->ifr_id, nic_i, USHRT_MAX); + for (n = 0; avail > 0 && nm_i != hwtail_lim; n++, avail--) { + rxd_info_zero(&ri); + ri.iri_frags = rxq->ifr_frags; + ri.iri_qsidx = kring->ring_id; + ri.iri_ifp = ctx->ifc_ifp; + ri.iri_cidx = nic_i; - error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); - ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; - ring->slot[nm_i].flags = 0; - bus_dmamap_sync(fl->ifl_buf_tag, - fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); - nm_i = nm_next(nm_i, lim); - nic_i = nm_next(nic_i, lim); + error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); + ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; + ring->slot[nm_i].flags = 0; + bus_dmamap_sync(fl->ifl_buf_tag, + fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); + } + if (n) { /* update the state variables */ + if (netmap_no_pendintr && !force_update) { + /* diagnostics */ + iflib_rx_miss ++; + iflib_rx_miss_bufs += n; } - if (n) { /* update the state variables */ - if (netmap_no_pendintr && !force_update) { - /* diagnostics */ - iflib_rx_miss ++; - iflib_rx_miss_bufs += n; - } - fl->ifl_cidx = nic_i; - kring->nr_hwtail = nm_i; - } - kring->nr_kflags &= ~NKR_PENDINTR; + fl->ifl_cidx = nic_i; + kring->nr_hwtail = nm_i; } + kring->nr_kflags &= ~NKR_PENDINTR; } /* * Second part: skip past packets that userspace has released. @@ -1160,7 +1157,6 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl * nic_i is the index in the NIC ring, and * nm_i == (nic_i + kring->nkr_hwofs) % ring_size */ - /* XXX not sure how this will work with multiple free lists */ nm_i = kring->nr_hwcur; return (netmap_fl_refill(rxq, kring, nm_i, false)); From owner-svn-src-head@freebsd.org Thu Aug 6 21:37: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 DD7ED3AC6DD; Thu, 6 Aug 2020 21:37:38 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN2025ZnDz4fKW; Thu, 6 Aug 2020 21:37:38 +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 9F7B8D2F7; Thu, 6 Aug 2020 21:37:38 +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 076Lbcbw045831; Thu, 6 Aug 2020 21:37:38 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076Lbc9q045830; Thu, 6 Aug 2020 21:37:38 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008062137.076Lbc9q045830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 6 Aug 2020 21:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363997 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 363997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 06 Aug 2020 21:37:38 -0000 Author: vmaffione Date: Thu Aug 6 21:37:38 2020 New Revision: 363997 URL: https://svnweb.freebsd.org/changeset/base/363997 Log: iflib: netmap: drop redundant check The validity of head is already checked by nm_rxsync_prologue(). MFC after: 2 weeks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Aug 6 21:32:25 2020 (r363996) +++ head/sys/net/iflib.c Thu Aug 6 21:37:38 2020 (r363997) @@ -1080,16 +1080,12 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl uint32_t nic_i; /* index into the NIC ring */ u_int n; u_int const lim = kring->nkr_num_slots - 1; - u_int const head = kring->rhead; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; if_ctx_t ctx = ifp->if_softc; iflib_rxq_t rxq = &ctx->ifc_rxqs[kring->ring_id]; iflib_fl_t fl = &rxq->ifr_fl[0]; struct if_rxd_info ri; - - if (head > lim) - return netmap_ring_reinit(kring); /* * netmap only uses free list 0, to avoid out of order consumption From owner-svn-src-head@freebsd.org Fri Aug 7 02:48: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 38B303B0AC9; Fri, 7 Aug 2020 02:48:20 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BN8tX0kNWz3dxn; Fri, 7 Aug 2020 02:48:20 +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 F066511012; Fri, 7 Aug 2020 02:48:19 +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 0772mJgl035102; Fri, 7 Aug 2020 02:48:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0772mJvY035101; Fri, 7 Aug 2020 02:48:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008070248.0772mJvY035101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Aug 2020 02:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364004 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 364004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 02:48:20 -0000 Author: imp Date: Fri Aug 7 02:48:19 2020 New Revision: 364004 URL: https://svnweb.freebsd.org/changeset/base/364004 Log: All the other printf() calls cast to (void) here, do the two newer ones for consistency. Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Fri Aug 7 01:05:10 2020 (r364003) +++ head/sbin/mount/mount.c Fri Aug 7 02:48:19 2020 (r364004) @@ -697,9 +697,9 @@ prmount(struct statfs *sfp) (uintmax_t)sfp->f_syncreads, (uintmax_t)sfp->f_asyncreads); if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) { - printf(", fsid "); + (void)printf(", fsid "); for (i = 0; i < sizeof(sfp->f_fsid); i++) - printf("%02x", ((u_char *)&sfp->f_fsid)[i]); + (void)printf("%02x", ((u_char *)&sfp->f_fsid)[i]); } } (void)printf(")\n"); From owner-svn-src-head@freebsd.org Fri Aug 7 08:41: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 AB4FA3B57D8; Fri, 7 Aug 2020 08:41:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNJjk47dZz49bh; Fri, 7 Aug 2020 08:41:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7258D15149; Fri, 7 Aug 2020 08:41:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0778fEkB051563; Fri, 7 Aug 2020 08:41:14 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0778fEs8051562; Fri, 7 Aug 2020 08:41:14 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008070841.0778fEs8051562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 7 Aug 2020 08:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364005 - head/contrib/telnet/telnet X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/contrib/telnet/telnet X-SVN-Commit-Revision: 364005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 08:41:14 -0000 Author: gbe (doc committer) Date: Fri Aug 7 08:41:14 2020 New Revision: 364005 URL: https://svnweb.freebsd.org/changeset/base/364005 Log: telnet(1): Document -P option PR: 248157 Submitted by: Juraj Lutter Reviewed by: bcr Approved by: bcr Obtained from: NetBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25794 Modified: head/contrib/telnet/telnet/telnet.1 Modified: head/contrib/telnet/telnet/telnet.1 ============================================================================== --- head/contrib/telnet/telnet/telnet.1 Fri Aug 7 02:48:19 2020 (r364004) +++ head/contrib/telnet/telnet/telnet.1 Fri Aug 7 08:41:14 2020 (r364005) @@ -28,7 +28,7 @@ .\" @(#)telnet.1 8.6 (Berkeley) 6/1/94 .\" $FreeBSD$ .\" -.Dd September 18, 2006 +.Dd August 7, 2020 .Dt TELNET 1 .Os .Sh NAME @@ -47,6 +47,7 @@ protocol .Op Fl l Ar user .Op Fl n Ar tracefile .Op Fl s Ar src_addr +.Op Fl P Ar policy .Oo .Ar host .Op Ar port @@ -189,6 +190,13 @@ for recording trace information. See the .Ic set tracefile command below. +.It Fl P Ar policy +Use IPsec policy specification string +.Ar policy , +for the connections. +See +.Xr ipsec_set_policy 3 +for details. .It Fl r Specifies a user interface similar to .Xr rlogin 1 . From owner-svn-src-head@freebsd.org Fri Aug 7 08:57: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 955D53B5EC0; Fri, 7 Aug 2020 08:57:32 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNK4X3RMbz4Bd1; Fri, 7 Aug 2020 08:57:32 +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 550EA155AE; Fri, 7 Aug 2020 08:57:32 +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 0778vW6X062731; Fri, 7 Aug 2020 08:57:32 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0778vWGM062730; Fri, 7 Aug 2020 08:57:32 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202008070857.0778vWGM062730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 7 Aug 2020 08:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364006 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 364006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 08:57:32 -0000 Author: lwhsu Date: Fri Aug 7 08:57:31 2020 New Revision: 364006 URL: https://svnweb.freebsd.org/changeset/base/364006 Log: Add a .Pp to separate description and sample code for readability. Modified: head/share/man/man9/seqc.9 Modified: head/share/man/man9/seqc.9 ============================================================================== --- head/share/man/man9/seqc.9 Fri Aug 7 08:41:14 2020 (r364005) +++ head/share/man/man9/seqc.9 Fri Aug 7 08:57:31 2020 (r364006) @@ -98,6 +98,7 @@ obj->var2 = 2; seqc_write_end(&obj->seqc); unlock_exclusive(&obj->lock); .Ed +.Pp The following example for a reader reads the .Va var1 and From owner-svn-src-head@freebsd.org Fri Aug 7 10:20: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 8588A3B74BA; Fri, 7 Aug 2020 10:20:40 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNLwS32XJz4GLn; Fri, 7 Aug 2020 10:20:40 +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 4BAE816588; Fri, 7 Aug 2020 10:20:40 +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 077AKeSb012820; Fri, 7 Aug 2020 10:20:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077AKehf012819; Fri, 7 Aug 2020 10:20:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008071020.077AKehf012819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 7 Aug 2020 10:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364009 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 364009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 10:20:40 -0000 Author: manu Date: Fri Aug 7 10:20:39 2020 New Revision: 364009 URL: https://svnweb.freebsd.org/changeset/base/364009 Log: pkgbase: Fix dependancies The package name is converted with _ instead of - as we have some variables that cannot contain - Convert back the dependancies with - instead of _ Modified: head/release/packages/generate-ucl.sh Modified: head/release/packages/generate-ucl.sh ============================================================================== --- head/release/packages/generate-ucl.sh Fri Aug 7 09:51:24 2020 (r364008) +++ head/release/packages/generate-ucl.sh Fri Aug 7 10:20:39 2020 (r364009) @@ -97,6 +97,8 @@ main() { outname="${outname%%_*}" + pkgdeps="$(echo ${pkgdeps} | tr '_' '-')" + desc="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESC)" comment="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_COMMENT)" From owner-svn-src-head@freebsd.org Fri Aug 7 12:19: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 5D9A03B9894; Fri, 7 Aug 2020 12:19:22 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNPYQ1Qrfz4MBt; Fri, 7 Aug 2020 12:19:22 +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 10FDA17AAC; Fri, 7 Aug 2020 12:19:22 +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 077CJLkk085412; Fri, 7 Aug 2020 12:19:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077CJLbH085411; Fri, 7 Aug 2020 12:19:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008071219.077CJLbH085411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 7 Aug 2020 12:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364010 - head/sbin/iscontrol X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sbin/iscontrol X-SVN-Commit-Revision: 364010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 12:19:22 -0000 Author: manu Date: Fri Aug 7 12:19:21 2020 New Revision: 364010 URL: https://svnweb.freebsd.org/changeset/base/364010 Log: pkgbase: We can't easily have a package with either a - or a _ Rename iscsi_legacy to iscsilegacy, having - or _ in a package name cause problems when we process them and generate the ucl. Modified: head/sbin/iscontrol/Makefile Modified: head/sbin/iscontrol/Makefile ============================================================================== --- head/sbin/iscontrol/Makefile Fri Aug 7 10:20:39 2020 (r364009) +++ head/sbin/iscontrol/Makefile Fri Aug 7 12:19:21 2020 (r364010) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=iscsi_legacy +PACKAGE=iscsilegacy SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c misc.c PROG= iscontrol LIBADD= cam md From owner-svn-src-head@freebsd.org Fri Aug 7 12:24: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 9B90C3B976F; Fri, 7 Aug 2020 12:24:24 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNPgD2xxrz4MNQ; Fri, 7 Aug 2020 12:24:24 +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 4843C178F8; Fri, 7 Aug 2020 12:24:24 +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 077COOjf091378; Fri, 7 Aug 2020 12:24:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077CONJv091374; Fri, 7 Aug 2020 12:24:23 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008071224.077CONJv091374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 7 Aug 2020 12:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364011 - in head: sbin/ifconfig share/man/man4 sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man4 sys/net80211 X-SVN-Commit-Revision: 364011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 12:24:24 -0000 Author: bz Date: Fri Aug 7 12:24:23 2020 New Revision: 364011 URL: https://svnweb.freebsd.org/changeset/base/364011 Log: net80211/ifconfig: print hardware device name for wlan interfaces Add IEEE80211_IOC_IC_NAME to query the ic_name field and in ifconfig to print the parent interface again. This functionality was lost around r287197. It helps in case of multiple wlan interfaces and multiple underlying hardware devices to keep track which wlan interface belongs to which physical device. Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Reviewed by: adrian, Idwer Vollering MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25832 Modified: head/sbin/ifconfig/ifieee80211.c head/share/man/man4/net80211.4 head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_ioctl.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Aug 7 12:19:21 2020 (r364010) +++ head/sbin/ifconfig/ifieee80211.c Fri Aug 7 12:24:23 2020 (r364011) @@ -4779,6 +4779,23 @@ getid(int s, int ix, void *data, size_t len, int *plen return 0; } +static int +getdevicename(int s, void *data, size_t len, int *plen) +{ + struct ieee80211req ireq; + + (void) memset(&ireq, 0, sizeof(ireq)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_IC_NAME; + ireq.i_val = -1; + ireq.i_data = data; + ireq.i_len = len; + if (ioctl(s, SIOCG80211, &ireq) < 0) + return (-1); + *plen = ireq.i_len; + return (0); +} + static void ieee80211_status(int s) { @@ -5501,6 +5518,12 @@ end: LINE_CHECK("hwmpmaxhops %u", val); } } + + LINE_BREAK(); + + if (getdevicename(s, data, sizeof(data), &len) < 0) + return; + LINE_CHECK("parent interface: %s", data); LINE_BREAK(); } Modified: head/share/man/man4/net80211.4 ============================================================================== --- head/share/man/man4/net80211.4 Fri Aug 7 12:19:21 2020 (r364010) +++ head/share/man/man4/net80211.4 Fri Aug 7 12:24:23 2020 (r364011) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2009 +.Dd August 7, 2020 .Dt NET80211 4 .Os .Sh NAME @@ -393,6 +393,16 @@ Valid values are: and .Dv IEEE80211_HWMP_ROOTMODE_RANN (send broadcast Root Announcement (RANN) frames). +.It Dv IEEE80211_IOC_IC_NAME +Return the underlying hardware +.Xr device 9 +name in the buffer pointed to by +.Va i_data +and the name length including terminating NUL character in +.Va i_len . +If the buffer length is too small to hold the full name +.Er EINVAL +will be returned. .It Dv IEEE80211_IOC_INACTIVITY Return whether or not the system handles inactivity processing in .Va i_val . Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Fri Aug 7 12:19:21 2020 (r364010) +++ head/sys/net80211/ieee80211_ioctl.c Fri Aug 7 12:24:23 2020 (r364011) @@ -785,6 +785,13 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_l int error = 0; switch (ireq->i_type) { + case IEEE80211_IOC_IC_NAME: + len = strlen(ic->ic_name) + 1; + if (len > ireq->i_len) + return (EINVAL); + ireq->i_len = len; + error = copyout(ic->ic_name, ireq->i_data, ireq->i_len); + break; case IEEE80211_IOC_SSID: switch (vap->iv_state) { case IEEE80211_S_INIT: Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Fri Aug 7 12:19:21 2020 (r364010) +++ head/sys/net80211/ieee80211_ioctl.h Fri Aug 7 12:24:23 2020 (r364011) @@ -743,6 +743,9 @@ struct ieee80211req { #define IEEE80211_IOC_QUIET_OFFSET 207 /* Quiet Offset */ #define IEEE80211_IOC_QUIET_DUR 208 /* Quiet Duration */ #define IEEE80211_IOC_QUIET_COUNT 209 /* Quiet Count */ + +#define IEEE80211_IOC_IC_NAME 210 /* HW device name. */ + /* * Parameters for controlling a scan requested with * IEEE80211_IOC_SCAN_REQ. From owner-svn-src-head@freebsd.org Fri Aug 7 12:47:01 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 319903B9AC6; Fri, 7 Aug 2020 12:47:01 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNQ9K0FFNz4NH3; Fri, 7 Aug 2020 12:47:01 +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 DBAD818023; Fri, 7 Aug 2020 12:47:00 +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 077Cl0QG003894; Fri, 7 Aug 2020 12:47:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077Cl0Po003893; Fri, 7 Aug 2020 12:47:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008071247.077Cl0Po003893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 7 Aug 2020 12:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364012 - head/lib/lib80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/lib/lib80211 X-SVN-Commit-Revision: 364012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 12:47:01 -0000 Author: bz Date: Fri Aug 7 12:47:00 2020 New Revision: 364012 URL: https://svnweb.freebsd.org/changeset/base/364012 Log: lib80211: fix indentation of comments for some netbands. Whitespace only; no functional changes. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Modified: head/lib/lib80211/lib80211_regdomain.h Modified: head/lib/lib80211/lib80211_regdomain.h ============================================================================== --- head/lib/lib80211/lib80211_regdomain.h Fri Aug 7 12:24:23 2020 (r364011) +++ head/lib/lib80211/lib80211_regdomain.h Fri Aug 7 12:47:00 2020 (r364012) @@ -73,10 +73,10 @@ struct regdomain { netband_head bands_11b; /* 11b operation */ netband_head bands_11g; /* 11g operation */ netband_head bands_11a; /* 11a operation */ - netband_head bands_11ng;/* 11ng operation */ - netband_head bands_11na;/* 11na operation */ - netband_head bands_11ac;/* 11ac 5GHz operation */ - netband_head bands_11acg;/* 11ac 2GHz operation */ + netband_head bands_11ng; /* 11ng operation */ + netband_head bands_11na; /* 11na operation */ + netband_head bands_11ac; /* 11ac 5GHz operation */ + netband_head bands_11acg; /* 11ac 2GHz operation */ LIST_ENTRY(regdomain) next; }; From owner-svn-src-head@freebsd.org Fri Aug 7 13:35: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 C4EE13BAEBA; Fri, 7 Aug 2020 13:35:34 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNRFL4PRvz4RQH; Fri, 7 Aug 2020 13:35:34 +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 7A312187D3; Fri, 7 Aug 2020 13:35:34 +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 077DZYC6034698; Fri, 7 Aug 2020 13:35:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077DZYa1034697; Fri, 7 Aug 2020 13:35:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008071335.077DZYa1034697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Aug 2020 13:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364013 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 364013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 13:35:34 -0000 Author: mav Date: Fri Aug 7 13:35:34 2020 New Revision: 364013 URL: https://svnweb.freebsd.org/changeset/base/364013 Log: Allow ACPI APEI driver build without PCI. On x86 it seems difficult to build ACPI without PCI, but some aarch64 users appears to be doing it. MFC after: 3 days Modified: head/sys/dev/acpica/acpi_apei.c Modified: head/sys/dev/acpica/acpi_apei.c ============================================================================== --- head/sys/dev/acpica/acpi_apei.c Fri Aug 7 12:47:00 2020 (r364012) +++ head/sys/dev/acpica/acpi_apei.c Fri Aug 7 13:35:34 2020 (r364013) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_pci.h" #include #include @@ -207,8 +208,10 @@ static int apei_pcie_handler(ACPI_HEST_GENERIC_DATA *ged) { struct apei_pcie_error *p = (struct apei_pcie_error *)(ged + 1); + int h = 0, off; +#ifdef DEV_PCI device_t dev; - int h = 0, off, sev; + int sev; if ((p->ValidationBits & 0x8) == 0x8) { mtx_lock(&Giant); @@ -235,6 +238,7 @@ apei_pcie_handler(ACPI_HEST_GENERIC_DATA *ged) } if (h) return (h); +#endif printf("APEI %s PCIe Error:\n", apei_severity(ged->ErrorSeverity)); if (p->ValidationBits & 0x01) From owner-svn-src-head@freebsd.org Fri Aug 7 15:13: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 946E73BCFCE; Fri, 7 Aug 2020 15:13:54 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNTQp3NDxz4X34; Fri, 7 Aug 2020 15:13:54 +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 56F6F19DE4; Fri, 7 Aug 2020 15:13:54 +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 077FDsLM095254; Fri, 7 Aug 2020 15:13:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077FDrYC095252; Fri, 7 Aug 2020 15:13:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008071513.077FDrYC095252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 7 Aug 2020 15:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364018 - in head/sys: netinet netinet6 sys X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: netinet netinet6 sys X-SVN-Commit-Revision: 364018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 15:13:54 -0000 Author: bz Date: Fri Aug 7 15:13:53 2020 New Revision: 364018 URL: https://svnweb.freebsd.org/changeset/base/364018 Log: IPV6_PKTINFO support for v4-mapped IPv6 sockets When using v4-mapped IPv6 sockets with IPV6_PKTINFO we do not respect the given v4-mapped src address on the IPv4 socket. Implement the needed functionality. This allows single-socket UDP applications (such as OpenVPN) to work better on FreeBSD. Requested by: Gert Doering (gert greenie.net), pfsense Tested by: Gert Doering (gert greenie.net) Reviewed by: melifaro MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24135 Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/protosw.h Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Aug 7 15:11:27 2020 (r364017) +++ head/sys/netinet/udp_usrreq.c Fri Aug 7 15:13:53 2020 (r364018) @@ -163,7 +163,7 @@ VNET_PCPUSTAT_SYSUNINIT(udpstat); #ifdef INET static void udp_detach(struct socket *so); static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, - struct mbuf *, struct thread *); + struct mbuf *, struct thread *, int); #endif static void @@ -1083,9 +1083,65 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) } #ifdef INET +#ifdef INET6 +/* The logic here is derived from ip6_setpktopt(). See comments there. */ static int +udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, + struct inpcb *inp, int flags) +{ + struct ifnet *ifp; + struct in6_pktinfo *pktinfo; + struct in_addr ia; + + if ((flags & PRUS_IPV6) == 0) + return (0); + + if (cm->cmsg_level != IPPROTO_IPV6) + return (0); + + if (cm->cmsg_type != IPV6_2292PKTINFO && + cm->cmsg_type != IPV6_PKTINFO) + return (0); + + if (cm->cmsg_len != + CMSG_LEN(sizeof(struct in6_pktinfo))) + return (EINVAL); + + pktinfo = (struct in6_pktinfo *)CMSG_DATA(cm); + if (!IN6_IS_ADDR_V4MAPPED(&pktinfo->ipi6_addr) && + !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) + return (EINVAL); + + /* Validate the interface index if specified. */ + if (pktinfo->ipi6_ifindex > V_if_index) + return (ENXIO); + + ifp = NULL; + if (pktinfo->ipi6_ifindex) { + ifp = ifnet_byindex(pktinfo->ipi6_ifindex); + if (ifp == NULL) + return (ENXIO); + } + if (ifp != NULL && !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) { + + ia.s_addr = pktinfo->ipi6_addr.s6_addr32[3]; + if (in_ifhasaddr(ifp, ia) == 0) + return (EADDRNOTAVAIL); + } + + bzero(src, sizeof(*src)); + src->sin_family = AF_INET; + src->sin_len = sizeof(*src); + src->sin_port = inp->inp_lport; + src->sin_addr.s_addr = pktinfo->ipi6_addr.s6_addr32[3]; + + return (0); +} +#endif + +static int udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, - struct mbuf *control, struct thread *td) + struct mbuf *control, struct thread *td, int flags) { struct udpiphdr *ui; int len = m->m_pkthdr.len; @@ -1149,6 +1205,11 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s error = EINVAL; break; } +#ifdef INET6 + error = udp_v4mapped_pktinfo(cm, &src, inp, flags); + if (error != 0) + break; +#endif if (cm->cmsg_level != IPPROTO_IP) continue; @@ -1696,7 +1757,7 @@ udp_send(struct socket *so, int flags, struct mbuf *m, inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_send: inp == NULL")); - return (udp_output(inp, m, addr, control, td)); + return (udp_output(inp, m, addr, control, td, flags)); } #endif /* INET */ Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Aug 7 15:11:27 2020 (r364017) +++ head/sys/netinet6/udp6_usrreq.c Fri Aug 7 15:13:53 2020 (r364018) @@ -784,7 +784,7 @@ udp6_output(struct socket *so, int flags_arg, struct m in6_sin6_2_sin_in_sock((struct sockaddr *)sin6); pru = inetsw[ip_protox[nxt]].pr_usrreqs; /* addr will just be freed in sendit(). */ - return ((*pru->pru_send)(so, flags_arg, m, + return ((*pru->pru_send)(so, flags_arg | PRUS_IPV6, m, (struct sockaddr *)sin6, control, td)); } } else Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Fri Aug 7 15:11:27 2020 (r364017) +++ head/sys/sys/protosw.h Fri Aug 7 15:13:53 2020 (r364018) @@ -210,6 +210,7 @@ struct pr_usrreqs { #define PRUS_EOF 0x2 #define PRUS_MORETOCOME 0x4 #define PRUS_NOTREADY 0x8 +#define PRUS_IPV6 0x10 int (*pru_ready)(struct socket *so, struct mbuf *m, int count); int (*pru_sense)(struct socket *so, struct stat *sb); int (*pru_shutdown)(struct socket *so); From owner-svn-src-head@freebsd.org Fri Aug 7 15:26: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 CB78A3BCFF8; Fri, 7 Aug 2020 15:26:04 +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 4BNThr1QlFz4XTp; Fri, 7 Aug 2020 15:26:02 +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 077FQ0gB017441; Fri, 7 Aug 2020 08:26:00 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 077FQ0uQ017440; Fri, 7 Aug 2020 08:26:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202008071526.077FQ0uQ017440@gndrsh.dnsmgr.net> Subject: Re: svn commit: r364010 - head/sbin/iscontrol In-Reply-To: <202008071219.077CJLbH085411@repo.freebsd.org> To: Emmanuel Vadot Date: Fri, 7 Aug 2020 08:26:00 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BNThr1QlFz4XTp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 15:26:04 -0000 > Author: manu > Date: Fri Aug 7 12:19:21 2020 > New Revision: 364010 > URL: https://svnweb.freebsd.org/changeset/base/364010 > > Log: > pkgbase: We can't easily have a package with either a - or a _ Wow, hopefully this is short term. I would think a package name can be any valid file name, and to remove - and _ from that set is going to cause lots of POLA. > > Rename iscsi_legacy to iscsilegacy, having - or _ in a package name cause > problems when we process them and generate the ucl. > > Modified: > head/sbin/iscontrol/Makefile > > Modified: head/sbin/iscontrol/Makefile > ============================================================================== > --- head/sbin/iscontrol/Makefile Fri Aug 7 10:20:39 2020 (r364009) > +++ head/sbin/iscontrol/Makefile Fri Aug 7 12:19:21 2020 (r364010) > @@ -1,6 +1,6 @@ > # $FreeBSD$ > > -PACKAGE=iscsi_legacy > +PACKAGE=iscsilegacy > SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c misc.c > PROG= iscontrol > LIBADD= cam md > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Aug 7 15:32: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 F34C73BD49A; Fri, 7 Aug 2020 15:32:28 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNTr80Pw7z4YFc; Fri, 7 Aug 2020 15:32:23 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1596814335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eiT7jRmvfVn4atOVc8w9cXblcfkE5Bkiox6Lunfvs14=; b=GCaljEMBfBiVOaPIc56FizmYOMGB5f8TgHBNnl6YddlgI2MY+qKTzZYnj1jk5MIXQ6lrPR J4FXDOplE5Gh7BcqzVP7m9gwFVouPNCNJ+DEJATMT8hhuR7a+/kJ+/N2fa/Cacxaxa/QBl rdb0la5iwZRajzSNafkzQwCJyPQaPDk= Received: from amy.home (lfbn-idf2-1-1138-237.w90-92.abo.wanadoo.fr [90.92.20.237]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 141bba98 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 7 Aug 2020 15:32:15 +0000 (UTC) Date: Fri, 7 Aug 2020 17:32:14 +0200 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364010 - head/sbin/iscontrol Message-Id: <20200807173214.0f831da5ab649eec811b2466@bidouilliste.com> In-Reply-To: <202008071526.077FQ0uQ017440@gndrsh.dnsmgr.net> References: <202008071219.077CJLbH085411@repo.freebsd.org> <202008071526.077FQ0uQ017440@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BNTr80Pw7z4YFc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=GCaljEMB; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-0.98)[-0.984]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.84)[-0.839]; NEURAL_HAM_MEDIUM(-1.01)[-1.010]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 15:32:29 -0000 On Fri, 7 Aug 2020 08:26:00 -0700 (PDT) "Rodney W. Grimes" wrote: > > Author: manu > > Date: Fri Aug 7 12:19:21 2020 > > New Revision: 364010 > > URL: https://svnweb.freebsd.org/changeset/base/364010 > > > > Log: > > pkgbase: We can't easily have a package with either a - or a _ > > Wow, hopefully this is short term. Not really. > I would think a package name can be any valid file name, and to remove - and _ from that set is going > to cause lots of POLA. The package file itself contain '-', they are named FreeBSD--{dbg,lib32,dev,}-. it's just that we used - and _ when building them to get some variable which contain the description, nothing that can't be patched by this is clearly not my priority. > > > > > Rename iscsi_legacy to iscsilegacy, having - or _ in a package name cause > > problems when we process them and generate the ucl. > > > > Modified: > > head/sbin/iscontrol/Makefile > > > > Modified: head/sbin/iscontrol/Makefile > > ============================================================================== > > --- head/sbin/iscontrol/Makefile Fri Aug 7 10:20:39 2020 (r364009) > > +++ head/sbin/iscontrol/Makefile Fri Aug 7 12:19:21 2020 (r364010) > > @@ -1,6 +1,6 @@ > > # $FreeBSD$ > > > > -PACKAGE=iscsi_legacy > > +PACKAGE=iscsilegacy > > SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c misc.c > > PROG= iscontrol > > LIBADD= cam md > > > > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Aug 7 15:32: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 E08693BD521; Fri, 7 Aug 2020 15:32:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNTrV5ZTmz4Y9Y; Fri, 7 Aug 2020 15:32:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A385F19FA9; Fri, 7 Aug 2020 15:32:42 +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 077FWgXV007367; Fri, 7 Aug 2020 15:32:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077FWgeb007366; Fri, 7 Aug 2020 15:32:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008071532.077FWgeb007366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 7 Aug 2020 15:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364019 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 15:32:42 -0000 Author: hselasky Date: Fri Aug 7 15:32:42 2020 New Revision: 364019 URL: https://svnweb.freebsd.org/changeset/base/364019 Log: Add full support support for dynamic allocation and freeing of epoch's. Make sure to reclaim epoch structures when they are freed to support dynamic allocation and freeing of epoch structures. While at it, move the 64 supported epoch control structures to the static memory domain. This overall simplifies the management and debugging of system epoch's. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D25960 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Aug 7 15:13:53 2020 (r364018) +++ head/sys/kern/subr_epoch.c Fri Aug 7 15:32:42 2020 (r364019) @@ -58,8 +58,6 @@ __FBSDID("$FreeBSD$"); #include -static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); - #ifdef __amd64__ #define EPOCH_ALIGN CACHE_LINE_SIZE*2 #else @@ -79,7 +77,7 @@ typedef struct epoch_record { struct epoch { struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); epoch_record_t e_pcpu_record; - int e_idx; + int e_in_use; int e_flags; struct sx e_drain_sx; struct mtx e_drain_mtx; @@ -128,19 +126,23 @@ TAILQ_HEAD (threadlist, thread); CK_STACK_CONTAINER(struct ck_epoch_entry, stack_entry, ck_epoch_entry_container) -epoch_t allepochs[MAX_EPOCHS]; +static struct epoch epoch_array[MAX_EPOCHS]; DPCPU_DEFINE(struct grouptask, epoch_cb_task); DPCPU_DEFINE(int, epoch_cb_count); static __read_mostly int inited; -static __read_mostly int epoch_count; __read_mostly epoch_t global_epoch; __read_mostly epoch_t global_epoch_preempt; static void epoch_call_task(void *context __unused); static uma_zone_t pcpu_zone_record; +static struct sx epoch_sx; + +#define EPOCH_LOCK() sx_xlock(&epoch_sx) +#define EPOCH_UNLOCK() sx_xunlock(&epoch_sx) + #ifdef EPOCH_TRACE struct stackentry { RB_ENTRY(stackentry) se_node; @@ -281,6 +283,7 @@ epoch_init(void *arg __unused) #ifdef EPOCH_TRACE SLIST_INIT(&thread0.td_epochs); #endif + sx_init(&epoch_sx, "epoch-sx"); inited = 1; global_epoch = epoch_alloc("Global", 0); global_epoch_preempt = epoch_alloc("Global preemptible", EPOCH_PREEMPT); @@ -326,19 +329,48 @@ epoch_t epoch_alloc(const char *name, int flags) { epoch_t epoch; + int i; + MPASS(name != NULL); + if (__predict_false(!inited)) panic("%s called too early in boot", __func__); - epoch = malloc(sizeof(struct epoch), M_EPOCH, M_ZERO | M_WAITOK); + + EPOCH_LOCK(); + + /* + * Find a free index in the epoch array. If no free index is + * found, try to use the index after the last one. + */ + for (i = 0;; i++) { + /* + * If too many epochs are currently allocated, + * return NULL. + */ + if (i == MAX_EPOCHS) { + epoch = NULL; + goto done; + } + if (epoch_array[i].e_in_use == 0) + break; + } + + epoch = epoch_array + i; ck_epoch_init(&epoch->e_epoch); epoch_ctor(epoch); - MPASS(epoch_count < MAX_EPOCHS - 2); epoch->e_flags = flags; - epoch->e_idx = epoch_count; epoch->e_name = name; sx_init(&epoch->e_drain_sx, "epoch-drain-sx"); mtx_init(&epoch->e_drain_mtx, "epoch-drain-mtx", NULL, MTX_DEF); - allepochs[epoch_count++] = epoch; + + /* + * Set e_in_use last, because when this field is set the + * epoch_call_task() function will start scanning this epoch + * structure. + */ + atomic_store_rel_int(&epoch->e_in_use, 1); +done: + EPOCH_UNLOCK(); return (epoch); } @@ -346,13 +378,24 @@ void epoch_free(epoch_t epoch) { + EPOCH_LOCK(); + + MPASS(epoch->e_in_use != 0); + epoch_drain_callbacks(epoch); - allepochs[epoch->e_idx] = NULL; + + atomic_store_rel_int(&epoch->e_in_use, 0); + /* + * Make sure the epoch_call_task() function see e_in_use equal + * to zero, by calling epoch_wait() on the global_epoch: + */ epoch_wait(global_epoch); uma_zfree_pcpu(pcpu_zone_record, epoch->e_pcpu_record); mtx_destroy(&epoch->e_drain_mtx); sx_destroy(&epoch->e_drain_sx); - free(epoch, M_EPOCH); + memset(epoch, 0, sizeof(*epoch)); + + EPOCH_UNLOCK(); } static epoch_record_t @@ -705,8 +748,10 @@ epoch_call_task(void *arg __unused) ck_stack_init(&cb_stack); critical_enter(); epoch_enter(global_epoch); - for (total = i = 0; i < epoch_count; i++) { - if (__predict_false((epoch = allepochs[i]) == NULL)) + for (total = i = 0; i != MAX_EPOCHS; i++) { + epoch = epoch_array + i; + if (__predict_false( + atomic_load_acq_int(&epoch->e_in_use) == 0)) continue; er = epoch_currecord(epoch); record = &er->er_record; From owner-svn-src-head@freebsd.org Fri Aug 7 15:45: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 433EC3BD91E for ; Fri, 7 Aug 2020 15:45:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNV6t5fdRz4YjL for ; Fri, 7 Aug 2020 15:45:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1596815109; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=YMRmI9XrzsFSFLTKQ6HFLWv4M6EHMwcZ9KKUl8gzvim9gdYmNO+y9h79gPmQYOgXVrfqEnvlCzNvC 7AY9OULg4e7r2MmpArfItoARj/0xHysIbO2SKe2nmMVLTPDgTPlqD4j/qw69c9p7+tch4i5xOYH+cm OK8FlI5sg2ouVGK8uGovuSRcj29+ucAL99xMYE2JGDmhkfRbgWp7HzZ7woxLNb/p8XfN7hT0GHv8OV uWFVVcp6hrUOwKElNwgHCeVExDSXpvmi3hrKr9CHF0S1Jq8qNpPzxOZl+/TMa3RFXd3BLThC4Aa5SS Vuq5iJDSr+8ZaB6G6vSSTc4VDh/7K6w== 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=KWrKMNPXqmdZ9AZpnK1McNnLDacj8A80QxBYlZNDlm4=; b=I0SZ9nQ2qBdsFFo8pZVAh+9JtVN+dGBBQ0wascqd68SeMi/S0ia9T8l3hC3OIREFFpzsIM5pLTy+y aAS8YAjJfj3fwHwbO8QxY2cCbKJHlFEYab2zx1MESeViOpQbDwwXX10qt8cGvHDghIE9aEB3343Fb4 QYUShjyjKochbBgHy7zqLvmZdF0mxZ/aym5q/EZechw7uVgwCPiZlb0Lb6d5P1MteJWN5pqxPEHIcC HLEEq6BL25lyEJC/20IMFRcxOqUa6HsVjTuiU3tes0La0KBxhWv+d4bJoRjTJP2pkuNmAVUnkvci5l 6VvF39+EKuT6FCzDBD5+C+ORSxwO4vg== 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=KWrKMNPXqmdZ9AZpnK1McNnLDacj8A80QxBYlZNDlm4=; b=MlUHc9jVfDFB4e3q+FLg13BDDgQcdj/brmEdC2vYqDnxqAAnGYQE2D66aIM8DCvWNUCUkIrIFicdn MCoCmxS7LpCUsfsyu5enyS1GkTx7MBumD+XOQw4Nw+ZCKNym8iNfGc2C+Z8fXdClzPFv7U4DkUACjV jhTbtU69blEQrz7eo8jUiWUkNf3tlWhWJNvTNvnhV05/MzRyTsVAVR2PSp/8lUHLioMUiO2Terbr73 nvYsgQ665CtqmXQ3cxY1R34ezdHg3anBDQVHNqe5vYhpeSQu4kWKGxJl8oMdmUvALR2dcRkkGsqDqQ S57MHA5TwPoykQknM9cRQU56wYbACQQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: f6f943d3-d8c4-11ea-b630-6b8aa7872eb8 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 (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id f6f943d3-d8c4-11ea-b630-6b8aa7872eb8; Fri, 07 Aug 2020 15:45:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 077Fj5oG042620; Fri, 7 Aug 2020 09:45:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <5456249cc4128924a57729905b561ad39bc8663e.camel@freebsd.org> Subject: Re: svn commit: r364010 - head/sbin/iscontrol From: Ian Lepore To: Emmanuel Vadot , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 07 Aug 2020 09:45:05 -0600 In-Reply-To: <20200807173214.0f831da5ab649eec811b2466@bidouilliste.com> References: <202008071219.077CJLbH085411@repo.freebsd.org> <202008071526.077FQ0uQ017440@gndrsh.dnsmgr.net> <20200807173214.0f831da5ab649eec811b2466@bidouilliste.com> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BNV6t5fdRz4YjL X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; 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.33 Precedence: list List-Id: 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, 07 Aug 2020 15:45:11 -0000 On Fri, 2020-08-07 at 17:32 +0200, Emmanuel Vadot wrote: > On Fri, 7 Aug 2020 08:26:00 -0700 (PDT) > "Rodney W. Grimes" wrote: > > > > Author: manu > > > Date: Fri Aug 7 12:19:21 2020 > > > New Revision: 364010 > > > URL: https://svnweb.freebsd.org/changeset/base/364010 > > > > > > Log: > > > pkgbase: We can't easily have a package with either a - or a _ > > > > Wow, hopefully this is short term. > > Not really. > > > I would think a package name can be any valid file name, and to > > remove - and _ from that set is going > > to cause lots of POLA. > > The package file itself contain '-', they are named > FreeBSD--{dbg,lib32,dev,}-. it's just that we used - > and > _ when building them to get some variable which contain the > description, nothing that can't be patched by this is clearly not my > priority. > This should be easy to fix. Use sed instead of tr, and translate - to __ to remove dashes, and then translate __ back to - to restore them, and you've properly preserved single _ usage in names. -- Ian > > > > > > > > Rename iscsi_legacy to iscsilegacy, having - or _ in a package > > > name cause > > > problems when we process them and generate the ucl. > > > > > > Modified: > > > head/sbin/iscontrol/Makefile > > > > > > Modified: head/sbin/iscontrol/Makefile > > > ================================================================= > > > ============= > > > --- head/sbin/iscontrol/Makefile Fri Aug 7 10:20:39 2020 ( > > > r364009) > > > +++ head/sbin/iscontrol/Makefile Fri Aug 7 12:19:21 2020 ( > > > r364010) > > > @@ -1,6 +1,6 @@ > > > # $FreeBSD$ > > > > > > -PACKAGE=iscsi_legacy > > > +PACKAGE=iscsilegacy > > > SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c > > > misc.c > > > PROG= iscontrol > > > LIBADD= cam md > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Fri Aug 7 15:51: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 09FF93BDBDD; Fri, 7 Aug 2020 15:51:39 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVGK0hPSz4ZMj; Fri, 7 Aug 2020 15:51:36 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1596815495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SNS/9qO2ProL4Zc4ua394pTE1hocjCRID6/XmvAcuzg=; b=Vd85g3io6HMArXW2MFYrOJHgKUJXeARqp++v3SVSSmdG/ZLgjf8B7Tm9lESvQsEQUCIuaL QsUCkzyhIDeisWM7SfqiAUQcTo5YZRhT0bTMIvAiLaoZPFFdmem4C78SZP5Q2Xwp9e8JXC J1NfB59kZl2GAEf2az1XQCk2ekbQXa4= Received: from amy.home (lfbn-idf2-1-1138-237.w90-92.abo.wanadoo.fr [90.92.20.237]) by mx.blih.net (OpenSMTPD) with ESMTPSA id f627b2ad (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 7 Aug 2020 15:51:35 +0000 (UTC) Date: Fri, 7 Aug 2020 17:51:35 +0200 From: Emmanuel Vadot To: Ian Lepore Cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364010 - head/sbin/iscontrol Message-Id: <20200807175135.077394491bcb290739fe2655@bidouilliste.com> In-Reply-To: <5456249cc4128924a57729905b561ad39bc8663e.camel@freebsd.org> References: <202008071219.077CJLbH085411@repo.freebsd.org> <202008071526.077FQ0uQ017440@gndrsh.dnsmgr.net> <20200807173214.0f831da5ab649eec811b2466@bidouilliste.com> <5456249cc4128924a57729905b561ad39bc8663e.camel@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BNVGK0hPSz4ZMj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=Vd85g3io; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.04 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.983]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.56)[-0.558]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 15:51:39 -0000 On Fri, 07 Aug 2020 09:45:05 -0600 Ian Lepore wrote: > On Fri, 2020-08-07 at 17:32 +0200, Emmanuel Vadot wrote: > > On Fri, 7 Aug 2020 08:26:00 -0700 (PDT) > > "Rodney W. Grimes" wrote: > > > > > > Author: manu > > > > Date: Fri Aug 7 12:19:21 2020 > > > > New Revision: 364010 > > > > URL: https://svnweb.freebsd.org/changeset/base/364010 > > > > > > > > Log: > > > > pkgbase: We can't easily have a package with either a - or a _ > > > > > > Wow, hopefully this is short term. > > > > Not really. > > > > > I would think a package name can be any valid file name, and to > > > remove - and _ from that set is going > > > to cause lots of POLA. > > > > The package file itself contain '-', they are named > > FreeBSD--{dbg,lib32,dev,}-. it's just that we used - > > and > > _ when building them to get some variable which contain the > > description, nothing that can't be patched by this is clearly not my > > priority. > > > > This should be easy to fix. Use sed instead of tr, and translate - to > __ to remove dashes, and then translate __ back to - to restore them, > and you've properly preserved single _ usage in names. > > -- Ian > Yes it's easy to fix but that would required renaming the variables in release/packages/Makefile.packages and since I don't like how this part of pkgbase is done right now I prefer to not touch this part for now otherwise I would rewrite everything. There is more urgent work to be done. > > > > > > > > > > > Rename iscsi_legacy to iscsilegacy, having - or _ in a package > > > > name cause > > > > problems when we process them and generate the ucl. > > > > > > > > Modified: > > > > head/sbin/iscontrol/Makefile > > > > > > > > Modified: head/sbin/iscontrol/Makefile > > > > ================================================================= > > > > ============= > > > > --- head/sbin/iscontrol/Makefile Fri Aug 7 10:20:39 2020 ( > > > > r364009) > > > > +++ head/sbin/iscontrol/Makefile Fri Aug 7 12:19:21 2020 ( > > > > r364010) > > > > @@ -1,6 +1,6 @@ > > > > # $FreeBSD$ > > > > > > > > -PACKAGE=iscsi_legacy > > > > +PACKAGE=iscsilegacy > > > > SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c > > > > misc.c > > > > PROG= iscontrol > > > > LIBADD= cam md > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Aug 7 16:01: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 BA86F3BE117; Fri, 7 Aug 2020 16:01:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVTF4Ywgz4b9g; Fri, 7 Aug 2020 16:01:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FE8B1A3F9; Fri, 7 Aug 2020 16:01:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G15qK021092; Fri, 7 Aug 2020 16:01:05 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G15KT021091; Fri, 7 Aug 2020 16:01:05 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008071601.077G15KT021091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 7 Aug 2020 16:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364021 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 364021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:01:05 -0000 Author: gbe (doc committer) Date: Fri Aug 7 16:01:05 2020 New Revision: 364021 URL: https://svnweb.freebsd.org/changeset/base/364021 Log: grep(1): correct typos for 'if a name patches' to 'if a name matches' PR: 237635 Submitted by: durin42 Reviewed by: kevans Approved by: kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D25994 Modified: head/usr.bin/grep/grep.1 Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Fri Aug 7 15:58:23 2020 (r364020) +++ head/usr.bin/grep/grep.1 Fri Aug 7 16:01:05 2020 (r364021) @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd August 21, 2018 +.Dd August 7, 2020 .Dt GREP 1 .Os .Sh NAME @@ -209,7 +209,7 @@ Note that and .Fl Fl include patterns are processed in the order given. -If a name patches multiple patterns, the latest matching rule wins. +If a name matches multiple patterns, the latest matching rule wins. If no .Fl Fl include pattern is specified, all files are searched that are @@ -228,7 +228,7 @@ Note that and .Fl Fl include-dir patterns are processed in the order given. -If a name patches multiple patterns, the latest matching rule wins. +If a name matches multiple patterns, the latest matching rule wins. If no .Fl Fl include-dir pattern is specified, all directories are searched that are @@ -284,7 +284,7 @@ Note that and .Fl Fl exclude patterns are processed in the order given. -If a name patches multiple patterns, the latest matching rule wins. +If a name matches multiple patterns, the latest matching rule wins. Patterns are matched to the full path specified, not only to the filename component. .It Fl Fl include-dir Ar pattern @@ -298,7 +298,7 @@ Note that and .Fl Fl exclude-dir patterns are processed in the order given. -If a name patches multiple patterns, the latest matching rule wins. +If a name matches multiple patterns, the latest matching rule wins. .It Fl L , Fl Fl files-without-match Only the names of files not containing selected lines are written to standard output. From owner-svn-src-head@freebsd.org Fri Aug 7 16:03: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 EF7973BE0E8; Fri, 7 Aug 2020 16:03:56 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVXX61q1z4bPH; Fri, 7 Aug 2020 16:03:56 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1C291A2EC; Fri, 7 Aug 2020 16:03:56 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G3uIa025907; Fri, 7 Aug 2020 16:03:56 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G3tTv025902; Fri, 7 Aug 2020 16:03:55 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071603.077G3tTv025902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364022 - in head: cddl/contrib/opensolaris/lib/libctf/common cddl/contrib/opensolaris/tools/ctf/cvt sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libctf/common cddl/contrib/opensolaris/tools/ctf/cvt sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Commit-Revision: 364022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:03:57 -0000 Author: arichardson Date: Fri Aug 7 16:03:55 2020 New Revision: 364022 URL: https://svnweb.freebsd.org/changeset/base/364022 Log: Fix cddl tools bootstrapping on macOS and Linux Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25979 Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h head/sys/cddl/compat/opensolaris/sys/stat.h head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Aug 7 16:01:05 2020 (r364021) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Aug 7 16:03:55 2020 (r364022) @@ -27,6 +27,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" #include +#include #include #include #include Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Fri Aug 7 16:01:05 2020 (r364021) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Fri Aug 7 16:03:55 2020 (r364022) @@ -38,6 +38,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -63,6 +64,15 @@ extern "C" { #ifndef MIN #define MIN(a, b) ((a) > (b) ? (b) : (a)) +#endif + +/* Sanity check for cross-build bootstrap tools */ +#if !defined(BYTE_ORDER) +#error "Missing BYTE_ORDER defines" +#elif !defined(_LITTLE_ENDIAN) +#error "Missing _LITTLE_ENDIAN defines" +#elif !defined(_BIG_ENDIAN) +#error "Missing _BIG_ENDIAN defines" #endif #define TRUE 1 Modified: head/sys/cddl/compat/opensolaris/sys/stat.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/stat.h Fri Aug 7 16:01:05 2020 (r364021) +++ head/sys/cddl/compat/opensolaris/sys/stat.h Fri Aug 7 16:03:55 2020 (r364022) @@ -32,11 +32,19 @@ #include_next +/* + * When bootstrapping on Linux a stat64/fstat64 functions exists in both + * glibc and musl libc. To avoid compilation errors, use those functions instead + * of redefining them to stat/fstat. + * Similarly, macOS provides (deprecated) stat64 functions that we can use + * for now. + */ +#if !defined(__linux__) && !defined(__APPLE__) #define stat64 stat #define MAXOFFSET_T OFF_MAX -#ifndef _KERNEL +#if !defined(_KERNEL) #include static __inline int @@ -51,6 +59,7 @@ fstat64(int fd, struct stat *sb) } return (ret); } -#endif +#endif /* !defined(_KERNEL) */ +#endif /* !defined(__linux__) && !defined(__APPLE__) */ #endif /* !_COMPAT_OPENSOLARIS_SYS_STAT_H_ */ Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Fri Aug 7 16:01:05 2020 (r364021) +++ head/sys/cddl/compat/opensolaris/sys/time.h Fri Aug 7 16:03:55 2020 (r364022) @@ -29,6 +29,7 @@ #ifndef _OPENSOLARIS_SYS_TIME_H_ #define _OPENSOLARIS_SYS_TIME_H_ +#include #include_next #define SEC 1 Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri Aug 7 16:01:05 2020 (r364021) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri Aug 7 16:03:55 2020 (r364022) @@ -46,8 +46,12 @@ extern "C" { /* * Disk blocks (sectors) and bytes. */ +#ifndef dtob #define dtob(DD) ((DD) << DEV_BSHIFT) +#endif +#ifndef btod #define btod(BB) (((BB) + DEV_BSIZE - 1) >> DEV_BSHIFT) +#endif #define btodt(BB) ((BB) >> DEV_BSHIFT) #define lbtod(BB) (((offset_t)(BB) + DEV_BSIZE - 1) >> DEV_BSHIFT) @@ -220,9 +224,12 @@ extern unsigned char bcd_to_byte[256]; /* * Macros for counting and rounding. */ +#ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#ifndef roundup #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - +#endif /* * Macro to determine if value is a power of 2 */ From owner-svn-src-head@freebsd.org Fri Aug 7 16:04: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 AA7EF3BE22C; Fri, 7 Aug 2020 16:04:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVXf389Dz4bRL; Fri, 7 Aug 2020 16:04:02 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C919F1A4AF; Fri, 7 Aug 2020 16:04:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G41B7025963; Fri, 7 Aug 2020 16:04:01 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G41dj025962; Fri, 7 Aug 2020 16:04:01 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071604.077G41dj025962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364023 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 364023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:04:05 -0000 Author: arichardson Date: Fri Aug 7 16:04:01 2020 New Revision: 364023 URL: https://svnweb.freebsd.org/changeset/base/364023 Log: Always install usr.bin/grep as grep when bootstrapping We have to bootstrap grep when cross-building from macOS/Linux. Modified: head/usr.bin/grep/Makefile Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Fri Aug 7 16:03:55 2020 (r364022) +++ head/usr.bin/grep/Makefile Fri Aug 7 16:04:01 2020 (r364023) @@ -4,7 +4,7 @@ .include -.if ${MK_BSD_GREP} == "yes" +.if ${MK_BSD_GREP} == "yes" || defined(BOOTSTRAPPING) PROG= grep MAN1= grep.1 zgrep.1 .else @@ -50,7 +50,7 @@ MLINKS= zgrep.1 zfgrep.1 \ CFLAGS.gcc+= --param max-inline-insns-single=500 -.if ${MK_BSD_GREP} == "yes" +.if ${MK_BSD_GREP} == "yes" || defined(BOOTSTRAPPING) LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/fgrep \ ${BINDIR}/grep ${BINDIR}/rgrep \ From owner-svn-src-head@freebsd.org Fri Aug 7 16:04:06 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 E55383BE2BD; Fri, 7 Aug 2020 16:04:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVXk5q3Zz4bWl; Fri, 7 Aug 2020 16:04:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9B841A43E; Fri, 7 Aug 2020 16:04:06 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G4687026016; Fri, 7 Aug 2020 16:04:06 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G46TT026015; Fri, 7 Aug 2020 16:04:06 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071604.077G46TT026015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364024 - head/usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 364024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:04:07 -0000 Author: arichardson Date: Fri Aug 7 16:04:06 2020 New Revision: 364024 URL: https://svnweb.freebsd.org/changeset/base/364024 Log: makefs: Drop unnecessary sys/clock.h include This breaks the build on macOS where this header doesn't exist. I could also add a compat header to tools/build/cross-build but since it's not needed removing it seems like the better solution. Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Fri Aug 7 16:04:01 2020 (r364023) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Fri Aug 7 16:04:06 2020 (r364024) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include From owner-svn-src-head@freebsd.org Fri Aug 7 16:04: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 081D43BE482; Fri, 7 Aug 2020 16:04:14 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVXs3Nkxz4blq; Fri, 7 Aug 2020 16:04:11 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 610121A25D; Fri, 7 Aug 2020 16:04:11 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G4B1n026070; Fri, 7 Aug 2020 16:04:11 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G4BLx026069; Fri, 7 Aug 2020 16:04:11 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071604.077G4BLx026069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364025 - head/usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/tzsetup X-SVN-Commit-Revision: 364025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:04:19 -0000 Author: arichardson Date: Fri Aug 7 16:04:10 2020 New Revision: 364025 URL: https://svnweb.freebsd.org/changeset/base/364025 Log: Don't link against libdialog/ncurses when bootstrapping tzsetup Modified: head/usr.sbin/tzsetup/Makefile Modified: head/usr.sbin/tzsetup/Makefile ============================================================================== --- head/usr.sbin/tzsetup/Makefile Fri Aug 7 16:04:06 2020 (r364024) +++ head/usr.sbin/tzsetup/Makefile Fri Aug 7 16:04:10 2020 (r364025) @@ -7,7 +7,7 @@ MAN= tzsetup.8 CFLAGS+= -I. -.if ${MK_DIALOG} != no +.if ${MK_DIALOG} != no && !defined(BOOTSTRAPPING) WARNS?= 3 CFLAGS+= -I${SRCTOP}/contrib/dialog -DHAVE_DIALOG LIBADD= dialog ncursesw From owner-svn-src-head@freebsd.org Fri Aug 7 16:04: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 317CD3BE067; Fri, 7 Aug 2020 16:04:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVXw3bKfz4bm7; Fri, 7 Aug 2020 16:04:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39CFC1A6CA; Fri, 7 Aug 2020 16:04:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G4FND026124; Fri, 7 Aug 2020 16:04:15 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G4FXr026123; Fri, 7 Aug 2020 16:04:15 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071604.077G4FXr026123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364026 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:04:19 -0000 Author: arichardson Date: Fri Aug 7 16:04:15 2020 New Revision: 364026 URL: https://svnweb.freebsd.org/changeset/base/364026 Log: Fix duplicate assignment of _localedef in Makefile.inc1 The same .if exists a few lines below. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 7 16:04:10 2020 (r364025) +++ head/Makefile.inc1 Fri Aug 7 16:04:15 2020 (r364026) @@ -2179,9 +2179,6 @@ _yacc= usr.bin/yacc _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif -.if ${MK_LOCALES} != "no" -_localedef= usr.bin/localedef -.endif # We need to build tblgen when we're building clang or lld, either as # bootstrap tools, or as the part of the normal build. From owner-svn-src-head@freebsd.org Fri Aug 7 16:04: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 46C4C3BE070; Fri, 7 Aug 2020 16:04:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVY60N2yz4bps; Fri, 7 Aug 2020 16:04:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A6461A2F0; Fri, 7 Aug 2020 16:04:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077G4MMS026180; Fri, 7 Aug 2020 16:04:22 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077G4LMh026177; Fri, 7 Aug 2020 16:04:21 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008071604.077G4LMh026177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 7 Aug 2020 16:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364027 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 364027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:04:27 -0000 Author: arichardson Date: Fri Aug 7 16:04:21 2020 New Revision: 364027 URL: https://svnweb.freebsd.org/changeset/base/364027 Log: Fix linker error in libuutil with recent LLVM Not marking the function as static can result in a linker error: undefined reference to __assfail [--no-allow-shlib-undefined] I noticed this error after updating our CHERI LLVM to the latest upstream LLVM HEAD revision. This change effectively reverts r329984 and marks dmu_buf_init_user as static (which keeps the GCC build happy). Reviewed By: #zfs, asomers, freqlabs, mav Differential Revision: https://reviews.freebsd.org/D25663 Modified: head/sys/cddl/compat/opensolaris/sys/assfail.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/compat/opensolaris/sys/assfail.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/assfail.h Fri Aug 7 16:04:15 2020 (r364026) +++ head/sys/cddl/compat/opensolaris/sys/assfail.h Fri Aug 7 16:04:21 2020 (r364027) @@ -48,9 +48,7 @@ void assfail3(const char *, uintmax_t, const char *, u #ifndef HAVE_ASSFAIL extern int aok; -__inline int __assfail(const char *expr, const char *file, int line); - -__inline int +static __inline int __assfail(const char *expr, const char *file, int line) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Aug 7 16:04:15 2020 (r364026) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Aug 7 16:04:21 2020 (r364027) @@ -175,13 +175,6 @@ static int __dbuf_hold_impl(struct dbuf_hold_impl_data static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx); static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx); -#ifndef __lint -extern inline void dmu_buf_init_user(dmu_buf_user_t *dbu, - dmu_buf_evict_func_t *evict_func_sync, - dmu_buf_evict_func_t *evict_func_async, - dmu_buf_t **clear_on_evict_dbufp); -#endif /* ! __lint */ - /* * Global data structures and functions for the dbuf cache. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Aug 7 16:04:15 2020 (r364026) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Aug 7 16:04:21 2020 (r364027) @@ -610,7 +610,7 @@ typedef struct dmu_buf_user { * To allow enforcement of this, dbu must already be zeroed on entry. */ /*ARGSUSED*/ -inline void +static inline void dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync, dmu_buf_evict_func_t *evict_func_async, dmu_buf_t **clear_on_evict_dbufp) { From owner-svn-src-head@freebsd.org Fri Aug 7 16:06: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 DFE553BE476; Fri, 7 Aug 2020 16:06:48 +0000 (UTC) (envelope-from kevans@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNVbr5cjPz4cDC; Fri, 7 Aug 2020 16:06:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EB12154FD; Fri, 7 Aug 2020 16:06:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f172.google.com with SMTP id p25so2186088qkp.2; Fri, 07 Aug 2020 09:06:48 -0700 (PDT) X-Gm-Message-State: AOAM532TjUAHYoHDHvT/1nyBOHSsQuRdMvATdmLFYTbGIHjGoeBHzh7x dC8qhdrsWQqR7I1cZOWvR9qCef3ocVhk6ZvP5ls= X-Google-Smtp-Source: ABdhPJxVtYjAKEl2pcCGQfKue1LM7tgUBfg4Woqi6e4NjPKCHCYW0Nyf8OeMt1QYhV3JU0vl1xtEcdxT9EqwaFupMYU= X-Received: by 2002:a37:d83:: with SMTP id 125mr14708207qkn.430.1596816408025; Fri, 07 Aug 2020 09:06:48 -0700 (PDT) MIME-Version: 1.0 References: <202008071604.077G41dj025962@repo.freebsd.org> In-Reply-To: <202008071604.077G41dj025962@repo.freebsd.org> From: Kyle Evans Date: Fri, 7 Aug 2020 11:06:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364023 - head/usr.bin/grep To: Alex Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:06:48 -0000 On Fri, Aug 7, 2020 at 11:04 AM Alex Richardson wrote: > > Author: arichardson > Date: Fri Aug 7 16:04:01 2020 > New Revision: 364023 > URL: https://svnweb.freebsd.org/changeset/base/364023 > > Log: > Always install usr.bin/grep as grep when bootstrapping > > We have to bootstrap grep when cross-building from macOS/Linux. > What's going on here that it isn't bootstrapping gnugrep over in gnu/usr.bin/grep as grep? My gut instinct is that we're missing something else and this isn't quite the right place to have addressed this. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Aug 7 16:15: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 7D1303BE728; Fri, 7 Aug 2020 16:15: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVp91ghvz4ckx; Fri, 7 Aug 2020 16:15: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 1E23A1A796; Fri, 7 Aug 2020 16:15: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 077GFiuY032230; Fri, 7 Aug 2020 16:15:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077GFign032228; Fri, 7 Aug 2020 16:15:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008071615.077GFign032228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 7 Aug 2020 16:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364028 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 364028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:15:45 -0000 Author: hselasky Date: Fri Aug 7 16:15:44 2020 New Revision: 364028 URL: https://svnweb.freebsd.org/changeset/base/364028 Log: Implement radix_tree_store() in the LinuxKPI for use with the coming extensible arrays implementation. While at it add some more comments explaining the current radix_tree_insert() function and make sure to clean the root node when the radix tree reaches the maximum height. This can happen if the index passed is too big when the tree is empty. The radix_tree_store() function is basically a copy of the radix_tree_insert() function with some added functionality. The radix_tree_store() function is local to FreeBSD and does not yet exist in Linux. Reviewed by: kib MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/radix-tree.h head/sys/compat/linuxkpi/common/src/linux_radix.c Modified: head/sys/compat/linuxkpi/common/include/linux/radix-tree.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/radix-tree.h Fri Aug 7 16:04:21 2020 (r364027) +++ head/sys/compat/linuxkpi/common/include/linux/radix-tree.h Fri Aug 7 16:15:44 2020 (r364028) @@ -78,6 +78,7 @@ radix_tree_exception(void *arg) void *radix_tree_lookup(struct radix_tree_root *, unsigned long); void *radix_tree_delete(struct radix_tree_root *, unsigned long); int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); +int radix_tree_store(struct radix_tree_root *, unsigned long, void **); bool radix_tree_iter_find(struct radix_tree_root *, struct radix_tree_iter *, void ***); void radix_tree_iter_delete(struct radix_tree_root *, struct radix_tree_iter *, void **); Modified: head/sys/compat/linuxkpi/common/src/linux_radix.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_radix.c Fri Aug 7 16:04:21 2020 (r364027) +++ head/sys/compat/linuxkpi/common/src/linux_radix.c Fri Aug 7 16:15:44 2020 (r364028) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2020 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,17 @@ radix_pos(long id, int height) return (id >> (RADIX_TREE_MAP_SHIFT * height)) & RADIX_TREE_MAP_MASK; } +static void +radix_tree_clean_root_node(struct radix_tree_root *root) +{ + /* Check if the root node should be freed */ + if (root->rnode->count == 0) { + free(root->rnode, M_RADIX); + root->rnode = NULL; + root->height = 0; + } +} + void * radix_tree_lookup(struct radix_tree_root *root, unsigned long index) { @@ -197,8 +208,10 @@ radix_tree_insert(struct radix_tree_root *root, unsign while (radix_max(root) < index) { /* check if the radix tree is getting too big */ - if (root->height == RADIX_TREE_MAX_HEIGHT) + if (root->height == RADIX_TREE_MAX_HEIGHT) { + radix_tree_clean_root_node(root); return (-E2BIG); + } /* * If the root radix level is not empty, we need to @@ -206,8 +219,16 @@ radix_tree_insert(struct radix_tree_root *root, unsign */ if (node->count != 0) { node = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); - if (node == NULL) + if (node == NULL) { + /* + * Freeing the already allocated radix + * levels, if any, will be handled by + * the radix_tree_delete() function. + * This code path can only happen when + * the tree is not empty. + */ return (-ENOMEM); + } node->slots[0] = root->rnode; node->count++; root->rnode = node; @@ -231,14 +252,9 @@ radix_tree_insert(struct radix_tree_root *root, unsign temp[idx] = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); if (temp[idx] == NULL) { - while(idx--) + while (idx--) free(temp[idx], M_RADIX); - /* Check if we should free the root node as well. */ - if (root->rnode->count == 0) { - free(root->rnode, M_RADIX); - root->rnode = NULL; - root->height = 0; - } + radix_tree_clean_root_node(root); return (-ENOMEM); } } @@ -260,5 +276,112 @@ radix_tree_insert(struct radix_tree_root *root, unsign node->slots[idx] = item; node->count++; + return (0); +} + +int +radix_tree_store(struct radix_tree_root *root, unsigned long index, void **ppitem) +{ + struct radix_tree_node *node; + struct radix_tree_node *temp[RADIX_TREE_MAX_HEIGHT - 1]; + void *pitem; + int height; + int idx; + + /* + * Inserting a NULL item means delete it. The old pointer is + * stored at the location pointed to by "ppitem". + */ + if (*ppitem == NULL) { + *ppitem = radix_tree_delete(root, index); + return (0); + } + + /* get root node, if any */ + node = root->rnode; + + /* allocate root node, if any */ + if (node == NULL) { + node = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); + if (node == NULL) + return (-ENOMEM); + root->rnode = node; + root->height++; + } + + /* expand radix tree as needed */ + while (radix_max(root) < index) { + + /* check if the radix tree is getting too big */ + if (root->height == RADIX_TREE_MAX_HEIGHT) { + radix_tree_clean_root_node(root); + return (-E2BIG); + } + + /* + * If the root radix level is not empty, we need to + * allocate a new radix level: + */ + if (node->count != 0) { + node = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); + if (node == NULL) { + /* + * Freeing the already allocated radix + * levels, if any, will be handled by + * the radix_tree_delete() function. + * This code path can only happen when + * the tree is not empty. + */ + return (-ENOMEM); + } + node->slots[0] = root->rnode; + node->count++; + root->rnode = node; + } + root->height++; + } + + /* get radix tree height index */ + height = root->height - 1; + + /* walk down the tree until the first missing node, if any */ + for ( ; height != 0; height--) { + idx = radix_pos(index, height); + if (node->slots[idx] == NULL) + break; + node = node->slots[idx]; + } + + /* allocate the missing radix levels, if any */ + for (idx = 0; idx != height; idx++) { + temp[idx] = malloc(sizeof(*node), M_RADIX, + root->gfp_mask | M_ZERO); + if (temp[idx] == NULL) { + while (idx--) + free(temp[idx], M_RADIX); + radix_tree_clean_root_node(root); + return (-ENOMEM); + } + } + + /* setup new radix levels, if any */ + for ( ; height != 0; height--) { + idx = radix_pos(index, height); + node->slots[idx] = temp[height - 1]; + node->count++; + node = node->slots[idx]; + } + + /* + * Insert and adjust count if the item does not already exist. + */ + idx = radix_pos(index, 0); + /* swap */ + pitem = node->slots[idx]; + node->slots[idx] = *ppitem; + *ppitem = pitem; + + if (pitem == NULL) + node->count++; return (0); } From owner-svn-src-head@freebsd.org Fri Aug 7 16:20: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 4284A3BE74B; Fri, 7 Aug 2020 16:20:08 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNVvD13Bxz4cqD; Fri, 7 Aug 2020 16:20:08 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0332E1A799; Fri, 7 Aug 2020 16:20:08 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077GK7bF032588; Fri, 7 Aug 2020 16:20:07 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077GK7jQ032587; Fri, 7 Aug 2020 16:20:07 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008071620.077GK7jQ032587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 7 Aug 2020 16:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364029 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 364029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:20:08 -0000 Author: gbe (doc committer) Date: Fri Aug 7 16:20:07 2020 New Revision: 364029 URL: https://svnweb.freebsd.org/changeset/base/364029 Log: tmpnam(3): Also mention tmpfile in the ENVIRONMENT section PR: 181785 Submitted by: Kevin P. Neal MFC after: 1 week Modified: head/lib/libc/stdio/tmpnam.3 Modified: head/lib/libc/stdio/tmpnam.3 ============================================================================== --- head/lib/libc/stdio/tmpnam.3 Fri Aug 7 16:15:44 2020 (r364028) +++ head/lib/libc/stdio/tmpnam.3 Fri Aug 7 16:20:07 2020 (r364029) @@ -32,7 +32,7 @@ .\" @(#)tmpnam.3 8.2 (Berkeley) 11/17/93 .\" $FreeBSD$ .\" -.Dd March 18, 2007 +.Dd August 7, 2020 .Dt TMPFILE 3 .Os .Sh NAME @@ -156,6 +156,8 @@ on error. .Bl -tag -width Ds .It Ev TMPDIR .Pf [ Fn tempnam +and +.Fn tmpfile only] If set, the directory in which the temporary file is stored. From owner-svn-src-head@freebsd.org Fri Aug 7 16:22: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 7E1B13BED08; Fri, 7 Aug 2020 16:22:49 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNVyK1Flnz4dGQ; Fri, 7 Aug 2020 16:22:48 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f46.google.com with SMTP id bo3so2656133ejb.11; Fri, 07 Aug 2020 09:22:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EvAwgak/2IWgwQvQKk8yxp//pobirLHb1YFzINofxJo=; b=M7qULUfyOjKcGIRIMNDA7UzSneIBs7DW5aW/TKJUVMj/0eTLZPuRCXITv6J7LUCVHz oHOnhSVzOwX//PC6bysdIKKqj9iDY8zBvy2X71rCOFRf/1GfT8jAc436YsxgBHud4STr 1Y/UsIFdJRfhN7oeq2r5bPuWgxPYUXCs0gimM3BQxYgdhM2y9O0eHNSvv7miBPsLJfMW sHLs+fT1oIsAZ+lrF6gWTpuO/naanzHjH8t07NDGaHrALXNhH2UyMYyzfQW4fEINQwhR 9AIWehh//xPce4Wj/M7ByuzZs8rB9Quc8N9kXdfJefCJFYuqsblWfG5unzuXm1zQUa4m 5s6g== X-Gm-Message-State: AOAM530NYva/BvDGe2e35ZUNh1EwzgHg5IhFcfUsHNWtXzQnehk6pSdE mXb3A67wQmYGmkOQ7PemXSv07bNDzFc= X-Google-Smtp-Source: ABdhPJyFKo47JWNZO7QzNLPM711s1gtjF0PdcaBXAqHHgMTNcZc6BRoy15/IEYBXePUgTgNufofg8A== X-Received: by 2002:a17:906:3b97:: with SMTP id u23mr10447514ejf.31.1596817367020; Fri, 07 Aug 2020 09:22:47 -0700 (PDT) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id sb3sm6304613ejb.113.2020.08.07.09.22.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 09:22:46 -0700 (PDT) Received: by mail-wm1-f42.google.com with SMTP id k20so2384885wmi.5; Fri, 07 Aug 2020 09:22:46 -0700 (PDT) X-Received: by 2002:a1c:9a02:: with SMTP id c2mr14730855wme.16.1596817366427; Fri, 07 Aug 2020 09:22:46 -0700 (PDT) MIME-Version: 1.0 References: <202008071604.077G41dj025962@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Fri, 7 Aug 2020 17:22:35 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364023 - head/usr.bin/grep To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BNVyK1Flnz4dGQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:22:49 -0000 On Fri, 7 Aug 2020 at 17:06, Kyle Evans wrote: > > On Fri, Aug 7, 2020 at 11:04 AM Alex Richardson wrote: > > > > Author: arichardson > > Date: Fri Aug 7 16:04:01 2020 > > New Revision: 364023 > > URL: https://svnweb.freebsd.org/changeset/base/364023 > > > > Log: > > Always install usr.bin/grep as grep when bootstrapping > > > > We have to bootstrap grep when cross-building from macOS/Linux. > > > > What's going on here that it isn't bootstrapping gnugrep over in > gnu/usr.bin/grep as grep? My gut instinct is that we're missing > something else and this isn't quite the right place to have addressed > this. > The logic in Makefile.inc1 builds usr.bin/grep as the bootstrap grep when BOOTSTRAP_ALL_TOOLS is set (e.g. when building on macOS/Linux). If you think this should be gnu/usr.bin/grep instead I can revert this change and update Makefile.inc1. We have been using usr.bin/grep for bootstrap in CheriBSD for a long time now and it works fine so I'm not sure whether we need to use GNU grep for bootstrapping? Alex From owner-svn-src-head@freebsd.org Fri Aug 7 16:26: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 F041F3BEDA0; Fri, 7 Aug 2020 16:26:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNW3567xnz4dPw; Fri, 7 Aug 2020 16:26:57 +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 B73671A99C; Fri, 7 Aug 2020 16:26:57 +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 077GQvWv038729; Fri, 7 Aug 2020 16:26:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077GQvd8038727; Fri, 7 Aug 2020 16:26:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008071626.077GQvd8038727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Aug 2020 16:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364030 - in head: . tools/build X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . tools/build X-SVN-Commit-Revision: 364030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:26:58 -0000 Author: imp Date: Fri Aug 7 16:26:56 2020 New Revision: 364030 URL: https://svnweb.freebsd.org/changeset/base/364030 Log: The practice of creating symbolic links is somewhat fragile. Always make copies instead. There's too many times that we can't run the new binaries with old libraries. Making the links when things are known to be 'safe' is a nice optimization, but a copy of all the binaries is only 30MB, so saving the copies at the cost of increased support when new symbols are added and used as part of the bootstrap seems to be unwise. There may be additional optimizations possible here, especially for !FreeBSD hosts. However, that's beyond the scope of the problem I'm trying to fix with make failing mid-way through an installworld across change r363679. This optimization there caused us to run a new binary with an old library once a new make was installed due to the symbolic link. One could just copy make, but then other binaries fail as well, so rather than play whack-a-mole, I opted to take us back to the old way. Before r340157 or so we did copies (thogh of a lot fewer artifacts), and we didn't have issues like this. Reviewed by: arichards@ Differential Revision: https://reviews.freebsd.org/D25967 Modified: head/Makefile.inc1 head/UPDATING head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 7 16:20:07 2020 (r364029) +++ head/Makefile.inc1 Fri Aug 7 16:26:56 2020 (r364030) @@ -2293,13 +2293,12 @@ ${_bt}-links: .PHONY .for _tool in ${_bootstrap_tools_links} ${_bt}-link-${_tool}: .PHONY .MAKE - @if [ ! -e "${WORLDTMP}/legacy/bin/${_tool}" ]; then \ - source_path=`which ${_tool}`; \ - if [ ! -e "$${source_path}" ] ; then \ - echo "Cannot find host tool '${_tool}'"; false; \ - fi; \ - ln -sfnv "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"; \ - fi + @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \ + source_path=`which ${_tool}`; \ + if [ ! -e "$${source_path}" ] ; then \ + echo "Cannot find host tool '${_tool}'"; false; \ + fi; \ + cp -f "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}" ${_bt}-links: ${_bt}-link-${_tool} .endfor Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Aug 7 16:20:07 2020 (r364029) +++ head/UPDATING Fri Aug 7 16:26:56 2020 (r364030) @@ -26,6 +26,12 @@ 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".) +20200807: + Makefile.inc has been updated to work around the issue documented in + 20200729. It was a case where the optimization of using symbolic links + to point to binaries created a situation where we'd run new binaries + with old libraries starting midway through the installworld process. + 20200729: r363679 has redefined some undefined behavior in regcomp(3); notably, extraneous escapes of most ordinary characters will no longer be Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Fri Aug 7 16:20:07 2020 (r364029) +++ head/tools/build/Makefile Fri Aug 7 16:26:56 2020 (r364030) @@ -119,26 +119,25 @@ _host_abs_tools_to_symlink= ${_make_abs}:make ${_make_ host-symlinks: @echo "Linking host tools into ${DESTDIR}/bin" .for _tool in ${_host_tools_to_symlink} - @if [ ! -e "${DESTDIR}/bin/${_tool}" ]; then \ - source_path=`which ${_tool}`; \ - if [ ! -e "$${source_path}" ] ; then \ - echo "Cannot find host tool '${_tool}'"; false; \ - fi; \ - ln -sfnv "$${source_path}" "${DESTDIR}/bin/${_tool}"; \ - fi + @source_path=`which ${_tool}`; \ + if [ ! -e "$${source_path}" ] ; then \ + echo "Cannot find host tool '${_tool}'"; false; \ + fi; \ + rm -f "${DESTDIR}/bin/${_tool}"; \ + cp -f "$${source_path}" "${DESTDIR}/bin/${_tool}" .endfor .for _tool in ${_host_abs_tools_to_symlink} @source_path="${_tool:S/:/ /:[1]}"; \ target_path="${DESTDIR}/bin/${_tool:S/:/ /:[2]}"; \ - if [ ! -e "$${target_path}" ] ; then \ - if [ ! -e "$${source_path}" ] ; then \ - echo "Host tool '${src_path}' is missing"; false; \ - fi; \ - ln -sfnv "$${source_path}" "$${target_path}"; \ - fi + if [ ! -e "$${source_path}" ] ; then \ + echo "Host tool '${src_path}' is missing"; false; \ + fi; \ + rm -f "$${target_path}"; \ + cp -f "$${source_path}" "$${target_path}" .endfor .if exists(/usr/libexec/flua) - ln -sf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua + rm -f ${DESTDIR}/usr/libexec/flua + cp -f /usr/libexec/flua ${DESTDIR}/usr/libexec/flua .endif # Create all the directories that are needed during the legacy, bootstrap-tools From owner-svn-src-head@freebsd.org Fri Aug 7 16:56: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 37E683BF213; Fri, 7 Aug 2020 16:56:44 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNWjR70jxz4fVv; Fri, 7 Aug 2020 16:56:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D449E1AC50; Fri, 7 Aug 2020 16:56:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077GuhAt056709; Fri, 7 Aug 2020 16:56:43 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077Guhgb056708; Fri, 7 Aug 2020 16:56:43 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008071656.077Guhgb056708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 7 Aug 2020 16:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364031 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 364031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:56:44 -0000 Author: gbe (doc committer) Date: Fri Aug 7 16:56:43 2020 New Revision: 364031 URL: https://svnweb.freebsd.org/changeset/base/364031 Log: mbsrtowcs(3): Clarify the RETURN VALUES section PR: 215848 Submitted by: Andrew Stevenson MFC after: 1 week Modified: head/lib/libc/locale/mbsrtowcs.3 Modified: head/lib/libc/locale/mbsrtowcs.3 ============================================================================== --- head/lib/libc/locale/mbsrtowcs.3 Fri Aug 7 16:26:56 2020 (r364030) +++ head/lib/libc/locale/mbsrtowcs.3 Fri Aug 7 16:56:43 2020 (r364031) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 21, 2004 +.Dd August 7, 2020 .Dt MBSRTOWCS 3 .Os .Sh NAME @@ -98,15 +98,29 @@ except that conversion stops after reading at most bytes from the buffer pointed to by .Fa src . .Sh RETURN VALUES -The +If successful, and +.Fa dst +is not NULL, the .Fn mbsrtowcs and .Fn mbsnrtowcs functions return the number of wide characters stored in the array pointed to by +.Fa dst . +.Pp +If .Fa dst -if successful, otherwise it returns -.Po Vt size_t Pc Ns \-1 . +was NULL then the functions +.Fn mbsrtowcs +and +.Fn mbsnrtowcs +return the number of wide characters that would have been stored where +.Fa dst +points to an infinitely large array. +.Pp +If either one of the functions is not successful then +.Po Vt size_t Pc Ns \-1 +is returned. .Sh ERRORS The .Fn mbsrtowcs From owner-svn-src-head@freebsd.org Fri Aug 7 16:57: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 D5C0D3BF235; Fri, 7 Aug 2020 16:57:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNWkQ5FNvz4gCL; Fri, 7 Aug 2020 16:57:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 92A5215C13; Fri, 7 Aug 2020 16:57:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id 77so2329746qkm.5; Fri, 07 Aug 2020 09:57:34 -0700 (PDT) X-Gm-Message-State: AOAM53001AWpHa/K0HODnDJbxA8pYJlQGVUPHphun4lZv880aQh55Jd5 bcipJKKnER0Cv53gJ6o0LoNLV4zVdBZccGpyFUY= X-Google-Smtp-Source: ABdhPJzpOB2iIK/I1gkRNbrdFKwM24Cs+rLeKeuEU61bFrRXqN1dtANn6a0JxoSQ7BAi6q4J49kkcAIDi6VuV2Wrshs= X-Received: by 2002:a37:d83:: with SMTP id 125mr14929838qkn.430.1596819454129; Fri, 07 Aug 2020 09:57:34 -0700 (PDT) MIME-Version: 1.0 References: <202008071604.077G41dj025962@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Fri, 7 Aug 2020 11:57:21 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364023 - head/usr.bin/grep To: Alexander Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 16:57:34 -0000 On Fri, Aug 7, 2020 at 11:22 AM Alexander Richardson wrote: > > On Fri, 7 Aug 2020 at 17:06, Kyle Evans wrote: > > > > On Fri, Aug 7, 2020 at 11:04 AM Alex Richardson wrote: > > > > > > Author: arichardson > > > Date: Fri Aug 7 16:04:01 2020 > > > New Revision: 364023 > > > URL: https://svnweb.freebsd.org/changeset/base/364023 > > > > > > Log: > > > Always install usr.bin/grep as grep when bootstrapping > > > > > > We have to bootstrap grep when cross-building from macOS/Linux. > > > > > > > What's going on here that it isn't bootstrapping gnugrep over in > > gnu/usr.bin/grep as grep? My gut instinct is that we're missing > > something else and this isn't quite the right place to have addressed > > this. > > > > The logic in Makefile.inc1 builds usr.bin/grep as the bootstrap grep > when BOOTSTRAP_ALL_TOOLS is set (e.g. when building on macOS/Linux). > If you think this should be gnu/usr.bin/grep instead I can revert this > change and update Makefile.inc1. > We have been using usr.bin/grep for bootstrap in CheriBSD for a long > time now and it works fine so I'm not sure whether we need to use GNU > grep for bootstrapping? > I suspect that the correct path should've forced WITH_BSD_GREP at the top-level if it's going to explicitly use usr.bin/grep, but now that I think about it- let's not put any more thought into this... Ultimately, I'm going to be reverting this in due time as I flip the WITH_BSD_GREP switch to default and ultimately remove the whole conditional altogether not too long after that. This will remove the need completely. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Aug 7 17:25: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 DB4C53BFF22; Fri, 7 Aug 2020 17:25:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNXM85VHpz3SnG; Fri, 7 Aug 2020 17:25:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FF871B517; Fri, 7 Aug 2020 17:25:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077HPuf0075362; Fri, 7 Aug 2020 17:25:56 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077HPujs075361; Fri, 7 Aug 2020 17:25:56 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008071725.077HPujs075361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 7 Aug 2020 17:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364032 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 364032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 17:25:56 -0000 Author: gbe (doc committer) Date: Fri Aug 7 17:25:56 2020 New Revision: 364032 URL: https://svnweb.freebsd.org/changeset/base/364032 Log: setlocale(3): Add an EXAMPLES section and add LANG category PR: 41824 Submitted by: Slaven Rezic Obtained from: NetBSD MFC after: 1 week Modified: head/lib/libc/locale/setlocale.3 Modified: head/lib/libc/locale/setlocale.3 ============================================================================== --- head/lib/libc/locale/setlocale.3 Fri Aug 7 16:56:43 2020 (r364031) +++ head/lib/libc/locale/setlocale.3 Fri Aug 7 17:25:56 2020 (r364032) @@ -31,7 +31,7 @@ .\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 9, 2019 +.Dd August 7, 2020 .Dt SETLOCALE 3 .Os .Sh NAME @@ -98,6 +98,10 @@ as well as values returned by Set a locale for formatting dates and times using the .Fn strftime function. +.It Dv LANG +Sets the generic locale category for native language, local customs +and coded character set in the absence of more specific locale +variables. .El .Pp Only three locales are defined by default, @@ -153,6 +157,25 @@ if the given combination of and .Fa locale makes no sense. +.Sh EXAMPLES +The following code illustrates how a program can initialize the +international environment for one language, while selectively +modifying the program's locale such that regular expressions and +string operations can be applied to text recorded in a different +language: +.Bd -literal + setlocale(LC_ALL, "de"); + setlocale(LC_COLLATE, "fr"); +.Ed +.Pp +When a process is started, its current locale is set to the C or POSIX +locale. +An internationalized program that depends on locale data not defined in +the C or POSIX locale must invoke the setlocale subroutine in the +following manner before using any of the locale-specific information: +.Bd -literal + setlocale(LC_ALL, ""); +.Ed .Sh FILES .Bl -tag -width /usr/share/locale/locale/category -compact .It Pa $PATH_LOCALE/ Ns Em locale/category From owner-svn-src-head@freebsd.org Fri Aug 7 18:21: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 C5B363710D9; Fri, 7 Aug 2020 18:21: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNYbc4wPLz3WMd; Fri, 7 Aug 2020 18:21: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 8D04A1BE47; Fri, 7 Aug 2020 18:21: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 077ILmB5009617; Fri, 7 Aug 2020 18:21:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077ILm9v009616; Fri, 7 Aug 2020 18:21:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008071821.077ILm9v009616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 7 Aug 2020 18:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364036 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 18:21:48 -0000 Author: imp Date: Fri Aug 7 18:21:48 2020 New Revision: 364036 URL: https://svnweb.freebsd.org/changeset/base/364036 Log: Remove obsolete part of comment. It was cut and pasted from the old version of this function, and was never relevant to the new version. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Aug 7 18:14:41 2020 (r364035) +++ head/sys/kern/subr_bus.c Fri Aug 7 18:21:48 2020 (r364036) @@ -860,8 +860,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) * The devctl protocol relies on quoted strings having matching quotes. * This routine quotes any internal quotes so the resulting string * is safe to pass to snprintf to construct, for example pnp info strings. - * Strings are always terminated with a NUL, but may be truncated if longer - * than @p len bytes after quotes. * * @param sb sbuf to place the characters into * @param src Original buffer. From owner-svn-src-head@freebsd.org Fri Aug 7 18:38: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 3FE7E371803; Fri, 7 Aug 2020 18:38:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNYyW0mz2z3Wvr; Fri, 7 Aug 2020 18:38:11 +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 F30E51C1AE; Fri, 7 Aug 2020 18:38:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077IcA1D019151; Fri, 7 Aug 2020 18:38:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077IcAQM019150; Fri, 7 Aug 2020 18:38:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008071838.077IcAQM019150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Aug 2020 18:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364037 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 364037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 18:38:11 -0000 Author: mav Date: Fri Aug 7 18:38:10 2020 New Revision: 364037 URL: https://svnweb.freebsd.org/changeset/base/364037 Log: Add some more checks to make APEI driver more robust. MFC after: 5 days Modified: head/sys/dev/acpica/acpi_apei.c Modified: head/sys/dev/acpica/acpi_apei.c ============================================================================== --- head/sys/dev/acpica/acpi_apei.c Fri Aug 7 18:21:48 2020 (r364036) +++ head/sys/dev/acpica/acpi_apei.c Fri Aug 7 18:38:10 2020 (r364037) @@ -348,7 +348,7 @@ apei_ge_handler(struct apei_ge *ge, bool copy) uint32_t sev; int i, c, off; - if (ges->BlockStatus == 0) + if (ges == NULL || ges->BlockStatus == 0) return (0); c = (ges->BlockStatus >> 4) & 0x3ff; @@ -363,7 +363,8 @@ apei_ge_handler(struct apei_ge *ge, bool copy) /* Acknowledge the error has been processed. */ ges->BlockStatus = 0; - if (!copy && ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { + if (!copy && ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2 && + ge->res2) { uint64_t val = READ8(ge->res2, 0); val &= ge->v2.ReadAckPreserve; val |= ge->v2.ReadAckWrite; @@ -395,7 +396,7 @@ apei_nmi_handler(void) return (0); ges = (ACPI_HEST_GENERIC_STATUS *)ge->buf; - if (ges->BlockStatus == 0) + if (ges == NULL || ges->BlockStatus == 0) return (0); /* If ACPI told the error is fatal -- make it so. */ @@ -409,7 +410,8 @@ apei_nmi_handler(void) /* Acknowledge the error has been processed. */ ges->BlockStatus = 0; - if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { + if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2 && + ge->res2) { uint64_t val = READ8(ge->res2, 0); val &= ge->v2.ReadAckPreserve; val |= ge->v2.ReadAckWrite; @@ -608,13 +610,19 @@ apei_attach(device_t dev) ge->res_rid = rid++; acpi_bus_alloc_gas(dev, &ge->res_type, &ge->res_rid, &ge->v1.ErrorStatusAddress, &ge->res, 0); + if (ge->res) { + ge->buf = pmap_mapdev_attr(READ8(ge->res, 0), + ge->v1.ErrorBlockLength, VM_MEMATTR_WRITE_COMBINING); + } else { + device_printf(dev, "Can't allocate status resource.\n"); + } if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { ge->res2_rid = rid++; acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid, &ge->v2.ReadAckRegister, &ge->res2, 0); + if (ge->res2 == NULL) + device_printf(dev, "Can't allocate ack resource.\n"); } - ge->buf = pmap_mapdev_attr(READ8(ge->res, 0), - ge->v1.ErrorBlockLength, VM_MEMATTR_WRITE_COMBINING); if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) { callout_init(&ge->poll, 1); callout_reset(&ge->poll, @@ -652,7 +660,10 @@ apei_detach(device_t dev) while ((ge = TAILQ_FIRST(&sc->ges)) != NULL) { TAILQ_REMOVE(&sc->ges, ge, link); - bus_release_resource(dev, ge->res_type, ge->res_rid, ge->res); + if (ge->res) { + bus_release_resource(dev, ge->res_type, + ge->res_rid, ge->res); + } if (ge->res2) { bus_release_resource(dev, ge->res2_type, ge->res2_rid, ge->res2); @@ -663,7 +674,10 @@ apei_detach(device_t dev) swi_remove(&ge->swi_ih); free(ge->copybuf, M_DEVBUF); } - pmap_unmapdev((vm_offset_t)ge->buf, ge->v1.ErrorBlockLength); + if (ge->buf) { + pmap_unmapdev((vm_offset_t)ge->buf, + ge->v1.ErrorBlockLength); + } free(ge, M_DEVBUF); } return (0); From owner-svn-src-head@freebsd.org Fri Aug 7 18:40: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 9832637162F; Fri, 7 Aug 2020 18:40:57 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNZ1j3Zlbz3X8v; Fri, 7 Aug 2020 18:40:57 +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 5F3E91C1BA; Fri, 7 Aug 2020 18:40:57 +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 077Iev9P019340; Fri, 7 Aug 2020 18:40:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077Iev6Q019339; Fri, 7 Aug 2020 18:40:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008071840.077Iev6Q019339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Aug 2020 18:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364038 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 364038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 18:40:57 -0000 Author: mav Date: Fri Aug 7 18:40:56 2020 New Revision: 364038 URL: https://svnweb.freebsd.org/changeset/base/364038 Log: Enable hw.pci.enable_aspm tunable by default. While effects on power saving is only a guess, effects on hot-plug are clearly visible. Lets try to enable it and see what happen. MFC after: 3 months Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Aug 7 18:38:10 2020 (r364037) +++ head/sys/dev/pci/pci.c Fri Aug 7 18:40:56 2020 (r364038) @@ -408,7 +408,7 @@ static int pci_enable_ari = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, 0, "Enable support for PCIe Alternative RID Interpretation"); -int pci_enable_aspm; +int pci_enable_aspm = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, &pci_enable_aspm, 0, "Enable support for PCIe Active State Power Management"); From owner-svn-src-head@freebsd.org Fri Aug 7 18:48: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 4D3FC371C04; Fri, 7 Aug 2020 18:48:57 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNZBx1G5Gz3Xhn; Fri, 7 Aug 2020 18:48:57 +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 0E6381C173; Fri, 7 Aug 2020 18:48:57 +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 077Imu20025750; Fri, 7 Aug 2020 18:48:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077ImuGX025749; Fri, 7 Aug 2020 18:48:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008071848.077ImuGX025749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 7 Aug 2020 18:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364039 - head/usr.bin/script X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/script X-SVN-Commit-Revision: 364039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 18:48:57 -0000 Author: markj Date: Fri Aug 7 18:48:56 2020 New Revision: 364039 URL: https://svnweb.freebsd.org/changeset/base/364039 Log: script: Put the terminal in raw mode when playing back a session. Otherwise recorded sessions of some interactive programs do not play back properly. PR: 248377 Submitted by: Soumendra Ganguly <0.gangzta@gmail.com> MFC after: 1 week Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Fri Aug 7 18:40:56 2020 (r364038) +++ head/usr.bin/script/script.c Fri Aug 7 18:48:56 2020 (r364039) @@ -428,6 +428,33 @@ consume(FILE *fp, off_t len, char *buf, int reg) } while (0/*CONSTCOND*/) static void +termset(void) +{ + struct termios traw; + + if (tcgetattr(STDOUT_FILENO, &tt) == -1) { + if (errno == EBADF) + err(1, "%d not valid fd", STDOUT_FILENO); + /* errno == ENOTTY */ + return; + } + ttyflg = 1; + traw = tt; + cfmakeraw(&traw); + traw.c_lflag |= ISIG; + (void)tcsetattr(STDOUT_FILENO, TCSANOW, &traw); +} + +static void +termreset(void) +{ + if (ttyflg) { + tcsetattr(STDOUT_FILENO, TCSADRAIN, &tt); + ttyflg = 0; + } +} + +static void playback(FILE *fp) { struct timespec tsi, tso; @@ -470,8 +497,11 @@ playback(FILE *fp) ctime(&tclock)); tsi = tso; (void)consume(fp, stamp.scr_len, buf, reg); + termset(); + atexit(termreset); break; case 'e': + termreset(); if (!qflg) (void)printf("\nScript done on %s", ctime(&tclock)); From owner-svn-src-head@freebsd.org Fri Aug 7 19:32: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 9DC0F372CAE; Fri, 7 Aug 2020 19:32:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNb9g2z47z3b5B; Fri, 7 Aug 2020 19:32:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 498C71CB60; Fri, 7 Aug 2020 19:32:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077JWt4S056428; Fri, 7 Aug 2020 19:32:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077JWtcG056427; Fri, 7 Aug 2020 19:32:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008071932.077JWtcG056427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 7 Aug 2020 19:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364040 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 364040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 19:32:55 -0000 Author: dim Date: Fri Aug 7 19:32:54 2020 New Revision: 364040 URL: https://svnweb.freebsd.org/changeset/base/364040 Log: Fix clang 11 inline asm constraint error when building powerpc GENERIC64 kernels: sys/powerpc/aim/mmu_radix.c:728:19: error: invalid operand for inline asm constraint 'i' __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) ^ sys/powerpc/aim/mmu_radix.c:149:3: note: expanded from macro 'PPC_TLBIEL' __XSTRING(.long PPC_INST_TLBIEL | \ ^ sys/sys/cdefs.h:161:22: note: expanded from macro '__XSTRING' #define __XSTRING(x) __STRING(x) /* expand x, then stringify */ ^ sys/sys/cdefs.h:160:21: note: expanded from macro '__STRING' #define __STRING(x) #x /* stringify without expanding x */ ^ :112:1: note: expanded from here ".long 0x7c000224 | (((%0) & 0x1f) << 11) | (((%1) & 0x1f) << 21) | (((%2) & 0x3) << 18) | (((%3) & 0x1) << 17) | (((1) & 0x1) << 16)" ^ This is solved by making the affected inline functions __always_inline. Suggested by: jhibbits MFC after: 3 days Modified: head/sys/powerpc/aim/mmu_radix.c Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Fri Aug 7 18:48:56 2020 (r364039) +++ head/sys/powerpc/aim/mmu_radix.c Fri Aug 7 19:32:54 2020 (r364040) @@ -183,7 +183,7 @@ ttusync(void) * Invalidate a range of translations */ -static __inline void +static __always_inline void radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, uint32_t pid, uint32_t lpid, vm_offset_t va, uint16_t ap) { @@ -715,7 +715,7 @@ static struct md_page pv_dummy; static int powernv_enabled = 1; -static inline void +static __always_inline void tlbiel_radix_set_isa300(uint32_t set, uint32_t is, uint32_t pid, uint32_t ric, uint32_t prs) { From owner-svn-src-head@freebsd.org Fri Aug 7 19:36: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 1EFB7372F38; Fri, 7 Aug 2020 19:36:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNbFN73NCz3bNL; Fri, 7 Aug 2020 19:36:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D576F1CE80; Fri, 7 Aug 2020 19:36:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 077Ja8T3056735; Fri, 7 Aug 2020 19:36:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077Ja831056734; Fri, 7 Aug 2020 19:36:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008071936.077Ja831056734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Aug 2020 19:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364042 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 19:36:09 -0000 Author: mjg Date: Fri Aug 7 19:36:08 2020 New Revision: 364042 URL: https://svnweb.freebsd.org/changeset/base/364042 Log: vfs: release the interlock after failing to set VHOLD_NO_SMR While here add more comments. Diagnosed by: markj Reported by: pho Fixes: r362827 ("vfs: protect vnodes with smr") Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 7 19:33:54 2020 (r364041) +++ head/sys/kern/vfs_subr.c Fri Aug 7 19:36:08 2020 (r364042) @@ -3683,19 +3683,24 @@ vdropl(struct vnode *vp) } if (!VN_IS_DOOMED(vp)) { vdrop_deactivate(vp); + /* + * Also unlocks the interlock. We can't assert on it as we + * released our hold and by now the vnode might have been + * freed. + */ return; } /* - * We may be racing against vhold_smr. + * Set the VHOLD_NO_SMR flag. * - * If they win we can just pretend we never got this far, they will - * vdrop later. + * We may be racing against vhold_smr. If they win we can just pretend + * we never got this far, they will vdrop later. */ if (!atomic_cmpset_int(&vp->v_holdcnt, 0, VHOLD_NO_SMR)) { + VI_UNLOCK(vp); /* - * We lost the aforementioned race. Note that any subsequent - * access is invalid as they might have managed to vdropl on - * their own. + * We lost the aforementioned race. Any subsequent access is + * invalid as they might have managed to vdropl on their own. */ return; } From owner-svn-src-head@freebsd.org Fri Aug 7 19:58: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 132023734DC; Fri, 7 Aug 2020 19:58: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNbkw6ml3z3cCG; Fri, 7 Aug 2020 19:58:16 +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 CCA481D1B3; Fri, 7 Aug 2020 19:58:16 +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 077JwGos069031; Fri, 7 Aug 2020 19:58:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077JwG9L069030; Fri, 7 Aug 2020 19:58:16 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008071958.077JwG9L069030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 7 Aug 2020 19:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364043 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 364043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 19:58:17 -0000 Author: bz Date: Fri Aug 7 19:58:16 2020 New Revision: 364043 URL: https://svnweb.freebsd.org/changeset/base/364043 Log: mmc_da: fix memory leak in sddaregister() In case we are failing to allocate mmcdata, we are returning with a softc allocated but not attached to anything and thus leak the memory. Reviewed by: scottl MFC after: 2 weeks X-MFC: only if we also mfc other mmccam changes? Differential Revision: https://reviews.freebsd.org/D25987 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Fri Aug 7 19:36:08 2020 (r364042) +++ head/sys/cam/mmc/mmc_da.c Fri Aug 7 19:58:16 2020 (r364043) @@ -789,7 +789,6 @@ sddaregister(struct cam_periph *periph, void *arg) softc = (struct sdda_softc *)malloc(sizeof(*softc), M_DEVBUF, M_NOWAIT|M_ZERO); - if (softc == NULL) { printf("sddaregister: Unable to probe new device. " "Unable to allocate softc\n"); @@ -802,6 +801,7 @@ sddaregister(struct cam_periph *periph, void *arg) if (softc->mmcdata == NULL) { printf("sddaregister: Unable to probe new device. " "Unable to allocate mmcdata\n"); + free(softc, M_DEVBUF); return (CAM_REQ_CMP_ERR); } periph->softc = softc; From owner-svn-src-head@freebsd.org Fri Aug 7 23:06: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 0B2DE376B3C; Fri, 7 Aug 2020 23:06:43 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNgwL6lccz42Vw; Fri, 7 Aug 2020 23:06:42 +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 C676E1F5B9; Fri, 7 Aug 2020 23:06:42 +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 077N6gYm084669; Fri, 7 Aug 2020 23:06:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077N6fjP084661; Fri, 7 Aug 2020 23:06:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008072306.077N6fjP084661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Aug 2020 23:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys X-SVN-Commit-Revision: 364044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 23:06:43 -0000 Author: mjg Date: Fri Aug 7 23:06:40 2020 New Revision: 364044 URL: https://svnweb.freebsd.org/changeset/base/364044 Log: vfs: add VOP_STAT The current scheme of calling VOP_GETATTR adds avoidable overhead. An example with tmpfs doing fstat (ops/s): before: 7488958 after: 7913833 Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D25910 Modified: head/share/man/man9/Makefile head/share/man/man9/VOP_ATTRIB.9 head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/kern/vfs_default.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/security/audit/audit_arg.c head/sys/sys/vnode.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Aug 7 19:58:16 2020 (r364043) +++ head/share/man/man9/Makefile Fri Aug 7 23:06:40 2020 (r364044) @@ -2308,7 +2308,8 @@ MLINKS+=vm_page_insert.9 vm_page_remove.9 MLINKS+=vm_page_wire.9 vm_page_unwire.9 MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9 MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ - VOP_ATTRIB.9 VOP_SETATTR.9 + VOP_ATTRIB.9 VOP_SETATTR.9 \ + VOP_ATTRIB.9 VOP_STAT.9 MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \ VOP_CREATE.9 VOP_MKNOD.9 \ VOP_CREATE.9 VOP_SYMLINK.9 Modified: head/share/man/man9/VOP_ATTRIB.9 ============================================================================== --- head/share/man/man9/VOP_ATTRIB.9 Fri Aug 7 19:58:16 2020 (r364043) +++ head/share/man/man9/VOP_ATTRIB.9 Fri Aug 7 23:06:40 2020 (r364044) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2008 +.Dd August 8, 2020 .Dt VOP_ATTRIB 9 .Os .Sh NAME @@ -42,21 +42,51 @@ .Fn VOP_GETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred" .Ft int .Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred" +.Ft int +.Fn VOP_STAT "struct vnode *vp" "struct stat *sb" "struct ucred *active_cred" \ +"struct ucred *file_cred" "struct thread *td" .Sh DESCRIPTION These entry points manipulate various attributes of a file or directory, including file permissions, owner, group, size, access time and modification time. .Pp -The arguments are: +.Fn VOP_STAT +returns data in a format suitable for the +.Xr stat 2 +system call and by default is implemented as a wrapper around +.Fn VOP_GETATTR . +Filesystems may want to implement their own variant for performance reasons. +.Pp +For +.Fn VOP_GETATTR +and +.Fn VOP_SETATTR +the arguments are: .Bl -tag -width cred .It Fa vp The vnode of the file. .It Fa vap The attributes of the file. .It Fa cred -The user credentials of the calling process. +The user credentials of the calling thread. .El .Pp +For +.Fn VOP_STAT +the arguments are: +.Bl -tag -width active_cred +.It Fa vp +The vnode of the file. +.It Fa sb +The attributes of the file. +.It Fa active_cred +The user credentials of the calling thread. +.It Fa file_cred +The credentials installed on the file description pointing to the vnode or NOCRED. +.It Fa td +The calling thread. +.El +.Pp Attributes which are not being modified by .Fn VOP_SETATTR should be set to the value @@ -67,8 +97,11 @@ the contents of .Fa *vap prior to setting specific values. .Sh LOCKS +Both .Fn VOP_GETATTR -expects the vnode to be locked on entry and will leave the vnode locked on +and +.Fn VOP_STAT +expect the vnode to be locked on entry and will leave the vnode locked on return. The lock type can be either shared or exclusive. .Pp @@ -84,6 +117,10 @@ otherwise an appropriate error is returned. .Fn VOP_SETATTR returns zero if the attributes were changed successfully, otherwise an appropriate error is returned. +.Fn VOP_STAT +returns 0 if it was able to retrieve the attribute data +.Fa *sb , +otherwise an appropriate error is returned. .Sh ERRORS .Bl -tag -width Er .It Bq Er EPERM Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Aug 7 23:06:40 2020 (r364044) @@ -1691,7 +1691,7 @@ linux_file_stat(struct file *fp, struct stat *sb, stru vp = filp->f_vnode; vn_lock(vp, LK_SHARED | LK_RETRY); - error = vn_stat(vp, sb, td->td_ucred, NOCRED, td); + error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td); VOP_UNLOCK(vp); return (error); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/kern/vfs_default.c Fri Aug 7 23:06:40 2020 (r364044) @@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include @@ -87,6 +90,7 @@ static int vop_stdadd_writecount(struct vop_add_writec static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); +static int vop_stdstat(struct vop_stat_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -114,6 +118,7 @@ struct vop_vector default_vnodeops = { .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, + .vop_stat = vop_stdstat, .vop_fdatasync = vop_stdfdatasync, .vop_getpages = vop_stdgetpages, .vop_getpages_async = vop_stdgetpages_async, @@ -1460,4 +1465,112 @@ vop_sigdefer(struct vop_vector *vop, struct vop_generi rc = bp(a); sigallowstop(prev_stops); return (rc); +} + +static int +vop_stdstat(struct vop_stat_args *a) +{ + struct vattr vattr; + struct vattr *vap; + struct vnode *vp; + struct stat *sb; + int error; + u_short mode; + + vp = a->a_vp; + sb = a->a_sb; + + error = vop_stat_helper_pre(a); + if (error != 0) + return (error); + + vap = &vattr; + + /* + * Initialize defaults for new and unusual fields, so that file + * systems which don't support these fields don't need to know + * about them. + */ + vap->va_birthtime.tv_sec = -1; + vap->va_birthtime.tv_nsec = 0; + vap->va_fsid = VNOVAL; + vap->va_rdev = NODEV; + + error = VOP_GETATTR(vp, vap, a->a_active_cred); + if (error) + goto out; + + /* + * Zero the spare stat fields + */ + bzero(sb, sizeof *sb); + + /* + * Copy from vattr table + */ + if (vap->va_fsid != VNOVAL) + sb->st_dev = vap->va_fsid; + else + sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; + sb->st_ino = vap->va_fileid; + mode = vap->va_mode; + switch (vap->va_type) { + case VREG: + mode |= S_IFREG; + break; + case VDIR: + mode |= S_IFDIR; + break; + case VBLK: + mode |= S_IFBLK; + break; + case VCHR: + mode |= S_IFCHR; + break; + case VLNK: + mode |= S_IFLNK; + break; + case VSOCK: + mode |= S_IFSOCK; + break; + case VFIFO: + mode |= S_IFIFO; + break; + default: + error = EBADF; + goto out; + } + sb->st_mode = mode; + sb->st_nlink = vap->va_nlink; + sb->st_uid = vap->va_uid; + sb->st_gid = vap->va_gid; + sb->st_rdev = vap->va_rdev; + if (vap->va_size > OFF_MAX) { + error = EOVERFLOW; + goto out; + } + sb->st_size = vap->va_size; + sb->st_atim.tv_sec = vap->va_atime.tv_sec; + sb->st_atim.tv_nsec = vap->va_atime.tv_nsec; + sb->st_mtim.tv_sec = vap->va_mtime.tv_sec; + sb->st_mtim.tv_nsec = vap->va_mtime.tv_nsec; + sb->st_ctim.tv_sec = vap->va_ctime.tv_sec; + sb->st_ctim.tv_nsec = vap->va_ctime.tv_nsec; + sb->st_birthtim.tv_sec = vap->va_birthtime.tv_sec; + sb->st_birthtim.tv_nsec = vap->va_birthtime.tv_nsec; + + /* + * According to www.opengroup.org, the meaning of st_blksize is + * "a filesystem-specific preferred I/O block size for this + * object. In some filesystem types, this may vary from file + * to file" + * Use minimum/default of PAGE_SIZE (e.g. for VCHR). + */ + + sb->st_blksize = max(PAGE_SIZE, vap->va_blocksize); + sb->st_flags = vap->va_flags; + sb->st_blocks = vap->va_bytes / S_BLKSIZE; + sb->st_gen = vap->va_gen; +out: + return (vop_stat_helper_post(a, error)); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/kern/vfs_syscalls.c Fri Aug 7 23:06:40 2020 (r364044) @@ -1867,7 +1867,7 @@ restart: if (vp->v_type == VDIR && oldinum == 0) { error = EPERM; /* POSIX */ } else if (oldinum != 0 && - ((error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && + ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && sb.st_ino != oldinum) { error = EIDRM; /* Identifier removed */ } else if (fp != NULL && fp->f_vnode != vp) { @@ -2381,7 +2381,7 @@ kern_statat(struct thread *td, int flag, int fd, const if ((error = namei(&nd)) != 0) return (error); - error = vn_stat(nd.ni_vp, sbp, td->td_ucred, NOCRED, td); + error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED, td); if (error == 0) { SDT_PROBE2(vfs, , stat, mode, path, sbp->st_mode); if (S_ISREG(sbp->st_mode)) @@ -4566,7 +4566,7 @@ kern_fhstat(struct thread *td, struct fhandle fh, stru vfs_unbusy(mp); if (error != 0) return (error); - error = vn_stat(vp, sb, td->td_ucred, NOCRED, td); + error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td); vput(vp); return (error); } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/kern/vfs_vnops.c Fri Aug 7 23:06:40 2020 (r364044) @@ -1455,121 +1455,10 @@ vn_statfile(struct file *fp, struct stat *sb, struct u int error; vn_lock(vp, LK_SHARED | LK_RETRY); - error = vn_stat(vp, sb, active_cred, fp->f_cred, td); + error = VOP_STAT(vp, sb, active_cred, fp->f_cred, td); VOP_UNLOCK(vp); return (error); -} - -/* - * Stat a vnode; implementation for the stat syscall - */ -int -vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred, - struct ucred *file_cred, struct thread *td) -{ - struct vattr vattr; - struct vattr *vap; - int error; - u_short mode; - - AUDIT_ARG_VNODE1(vp); -#ifdef MAC - error = mac_vnode_check_stat(active_cred, file_cred, vp); - if (error) - return (error); -#endif - - vap = &vattr; - - /* - * Initialize defaults for new and unusual fields, so that file - * systems which don't support these fields don't need to know - * about them. - */ - vap->va_birthtime.tv_sec = -1; - vap->va_birthtime.tv_nsec = 0; - vap->va_fsid = VNOVAL; - vap->va_rdev = NODEV; - - error = VOP_GETATTR(vp, vap, active_cred); - if (error) - return (error); - - /* - * Zero the spare stat fields - */ - bzero(sb, sizeof *sb); - - /* - * Copy from vattr table - */ - if (vap->va_fsid != VNOVAL) - sb->st_dev = vap->va_fsid; - else - sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; - sb->st_ino = vap->va_fileid; - mode = vap->va_mode; - switch (vap->va_type) { - case VREG: - mode |= S_IFREG; - break; - case VDIR: - mode |= S_IFDIR; - break; - case VBLK: - mode |= S_IFBLK; - break; - case VCHR: - mode |= S_IFCHR; - break; - case VLNK: - mode |= S_IFLNK; - break; - case VSOCK: - mode |= S_IFSOCK; - break; - case VFIFO: - mode |= S_IFIFO; - break; - default: - return (EBADF); - } - sb->st_mode = mode; - sb->st_nlink = vap->va_nlink; - sb->st_uid = vap->va_uid; - sb->st_gid = vap->va_gid; - sb->st_rdev = vap->va_rdev; - if (vap->va_size > OFF_MAX) - return (EOVERFLOW); - sb->st_size = vap->va_size; - sb->st_atim.tv_sec = vap->va_atime.tv_sec; - sb->st_atim.tv_nsec = vap->va_atime.tv_nsec; - sb->st_mtim.tv_sec = vap->va_mtime.tv_sec; - sb->st_mtim.tv_nsec = vap->va_mtime.tv_nsec; - sb->st_ctim.tv_sec = vap->va_ctime.tv_sec; - sb->st_ctim.tv_nsec = vap->va_ctime.tv_nsec; - sb->st_birthtim.tv_sec = vap->va_birthtime.tv_sec; - sb->st_birthtim.tv_nsec = vap->va_birthtime.tv_nsec; - - /* - * According to www.opengroup.org, the meaning of st_blksize is - * "a filesystem-specific preferred I/O block size for this - * object. In some filesystem types, this may vary from file - * to file" - * Use minimum/default of PAGE_SIZE (e.g. for VCHR). - */ - - sb->st_blksize = max(PAGE_SIZE, vap->va_blocksize); - - sb->st_flags = vap->va_flags; - if (priv_check_cred_vfs_generation(td->td_ucred)) - sb->st_gen = 0; - else - sb->st_gen = vap->va_gen; - - sb->st_blocks = vap->va_bytes / S_BLKSIZE; - return (0); } /* Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/kern/vnode_if.src Fri Aug 7 23:06:40 2020 (r364044) @@ -177,6 +177,17 @@ vop_accessx { }; +%% stat vp L L L + +vop_stat { + IN struct vnode *vp; + OUT struct stat *sb; + IN struct ucred *active_cred; + IN struct ucred *file_cred; + IN struct thread *td; +}; + + %% getattr vp L L L vop_getattr { Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/security/audit/audit_arg.c Fri Aug 7 23:06:40 2020 (r364044) @@ -854,7 +854,7 @@ audit_arg_upath2_canon(char *upath) * It is assumed that the caller will hold any vnode locks necessary to * perform a VOP_GETATTR() on the passed vnode. * - * XXX: The attr code is very similar to vfs_vnops.c:vn_stat(), but always + * XXX: The attr code is very similar to vfs_default.c:vop_stdstat(), but always * provides access to the generation number as we need that to construct the * BSM file ID. * Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Aug 7 19:58:16 2020 (r364043) +++ head/sys/sys/vnode.h Fri Aug 7 23:06:40 2020 (r364044) @@ -737,8 +737,6 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, struct thread *td); int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio, struct thread *td); -int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred, - struct ucred *file_cred, struct thread *td); int vn_start_write(struct vnode *vp, struct mount **mpp, int flags); int vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags); @@ -892,6 +890,22 @@ void vop_need_inactive_debugpost(void *a, int rc); #endif void vop_rename_fail(struct vop_rename_args *ap); + +#define vop_stat_helper_pre(ap) ({ \ + int _error; \ + AUDIT_ARG_VNODE1(ap->a_vp); \ + _error = mac_vnode_check_stat(ap->a_active_cred, ap->a_file_cred, ap->a_vp);\ + if (__predict_true(_error == 0)) \ + bzero(ap->a_sb, sizeof(*ap->a_sb)); \ + _error; \ +}) + +#define vop_stat_helper_post(ap, error) ({ \ + int _error = (error); \ + if (priv_check_cred_vfs_generation(ap->a_td->td_ucred)) \ + ap->a_sb->st_gen = 0; \ + _error; \ +}) #define VOP_WRITE_PRE(ap) \ struct vattr va; \ From owner-svn-src-head@freebsd.org Fri Aug 7 23:07: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 CB55F376AF6; Fri, 7 Aug 2020 23:07: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNgxc54S7z42sS; Fri, 7 Aug 2020 23:07:48 +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 92B8A1F5BA; Fri, 7 Aug 2020 23:07:48 +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 077N7mSn084768; Fri, 7 Aug 2020 23:07:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077N7mdo084767; Fri, 7 Aug 2020 23:07:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008072307.077N7mdo084767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Aug 2020 23:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364045 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 364045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 23:07:48 -0000 Author: mjg Date: Fri Aug 7 23:07:47 2020 New Revision: 364045 URL: https://svnweb.freebsd.org/changeset/base/364045 Log: tmpfs: add VOP_STAT handler Modified: head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.h Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Aug 7 23:06:40 2020 (r364044) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Aug 7 23:07:47 2020 (r364045) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -406,6 +408,52 @@ out: } int +tmpfs_stat(struct vop_stat_args *v) +{ + struct vnode *vp = v->a_vp; + struct stat *sb = v->a_sb; + vm_object_t obj; + struct tmpfs_node *node; + int error; + + node = VP_TO_TMPFS_NODE(vp); + + tmpfs_update_getattr(vp); + + error = vop_stat_helper_pre(v); + if (__predict_false(error)) + return (error); + + sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; + sb->st_ino = node->tn_id; + sb->st_mode = node->tn_mode | VTTOIF(vp->v_type); + sb->st_nlink = node->tn_links; + sb->st_uid = node->tn_uid; + sb->st_gid = node->tn_gid; + sb->st_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? + node->tn_rdev : NODEV; + sb->st_size = node->tn_size; + sb->st_atim.tv_sec = node->tn_atime.tv_sec; + sb->st_atim.tv_nsec = node->tn_atime.tv_nsec; + sb->st_mtim.tv_sec = node->tn_mtime.tv_sec; + sb->st_mtim.tv_nsec = node->tn_mtime.tv_nsec; + sb->st_ctim.tv_sec = node->tn_ctime.tv_sec; + sb->st_ctim.tv_nsec = node->tn_ctime.tv_nsec; + sb->st_birthtim.tv_sec = node->tn_birthtime.tv_sec; + sb->st_birthtim.tv_nsec = node->tn_birthtime.tv_nsec; + sb->st_blksize = PAGE_SIZE; + sb->st_flags = node->tn_flags; + sb->st_gen = node->tn_gen; + if (vp->v_type == VREG) { + obj = node->tn_reg.tn_aobj; + sb->st_blocks = (u_quad_t)obj->resident_page_count * PAGE_SIZE; + } else + sb->st_blocks = node->tn_size; + sb->st_blocks /= S_BLKSIZE; + return (vop_stat_helper_post(v, error)); +} + +int tmpfs_getattr(struct vop_getattr_args *v) { struct vnode *vp = v->a_vp; @@ -1675,6 +1723,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_close = tmpfs_close, .vop_fplookup_vexec = tmpfs_fplookup_vexec, .vop_access = tmpfs_access, + .vop_stat = tmpfs_stat, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, .vop_read = tmpfs_read, Modified: head/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.h Fri Aug 7 23:06:40 2020 (r364044) +++ head/sys/fs/tmpfs/tmpfs_vnops.h Fri Aug 7 23:07:47 2020 (r364045) @@ -50,6 +50,7 @@ extern struct vop_vector tmpfs_vnodeop_nonc_entries; vop_access_t tmpfs_access; vop_fplookup_vexec_t tmpfs_fplookup_vexec; +vop_stat_t tmpfs_stat; vop_getattr_t tmpfs_getattr; vop_setattr_t tmpfs_setattr; vop_pathconf_t tmpfs_pathconf; From owner-svn-src-head@freebsd.org Fri Aug 7 23:08: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 0DFBF376B9D; Fri, 7 Aug 2020 23:08:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNgy96bBYz434J; Fri, 7 Aug 2020 23:08: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 C57F91F5BC; Fri, 7 Aug 2020 23:08: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 077N8HEi084839; Fri, 7 Aug 2020 23:08:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 077N8Hek084838; Fri, 7 Aug 2020 23:08:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008072308.077N8Hek084838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 7 Aug 2020 23:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364046 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 364046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 07 Aug 2020 23:08:18 -0000 Author: mjg Date: Fri Aug 7 23:08:17 2020 New Revision: 364046 URL: https://svnweb.freebsd.org/changeset/base/364046 Log: ufs: add VOP_STAT handler Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Aug 7 23:07:47 2020 (r364045) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Aug 7 23:08:17 2020 (r364046) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include /* XXX */ @@ -107,6 +108,7 @@ static int ufs_chmod(struct vnode *, int, struct ucred static int ufs_chown(struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); static vop_close_t ufs_close; static vop_create_t ufs_create; +static vop_stat_t ufs_stat; static vop_getattr_t ufs_getattr; static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; @@ -467,6 +469,65 @@ ufs_fplookup_vexec(ap) /* ARGSUSED */ static int +ufs_stat(struct vop_stat_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct inode *ip = VTOI(vp); + struct stat *sb = ap->a_sb; + int error; + + error = vop_stat_helper_pre(ap); + if (__predict_false(error)) + return (error); + + VI_LOCK(vp); + ufs_itimes_locked(vp); + if (I_IS_UFS1(ip)) { + sb->st_atim.tv_sec = ip->i_din1->di_atime; + sb->st_atim.tv_nsec = ip->i_din1->di_atimensec; + } else { + sb->st_atim.tv_sec = ip->i_din2->di_atime; + sb->st_atim.tv_nsec = ip->i_din2->di_atimensec; + } + VI_UNLOCK(vp); + + sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; + sb->st_ino = ip->i_number; + sb->st_mode = (ip->i_mode & ~IFMT) | VTTOIF(vp->v_type); + sb->st_nlink = ip->i_effnlink; + sb->st_uid = ip->i_uid; + sb->st_gid = ip->i_gid; + if (I_IS_UFS1(ip)) { + sb->st_rdev = ip->i_din1->di_rdev; + sb->st_size = ip->i_din1->di_size; + sb->st_mtim.tv_sec = ip->i_din1->di_mtime; + sb->st_mtim.tv_nsec = ip->i_din1->di_mtimensec; + sb->st_ctim.tv_sec = ip->i_din1->di_ctime; + sb->st_ctim.tv_nsec = ip->i_din1->di_ctimensec; + sb->st_birthtim.tv_sec = -1; + sb->st_birthtim.tv_nsec = 0; + sb->st_blocks = dbtob((u_quad_t)ip->i_din1->di_blocks) / S_BLKSIZE; + } else { + sb->st_rdev = ip->i_din2->di_rdev; + sb->st_size = ip->i_din2->di_size; + sb->st_mtim.tv_sec = ip->i_din2->di_mtime; + sb->st_mtim.tv_nsec = ip->i_din2->di_mtimensec; + sb->st_ctim.tv_sec = ip->i_din2->di_ctime; + sb->st_ctim.tv_nsec = ip->i_din2->di_ctimensec; + sb->st_birthtim.tv_sec = ip->i_din2->di_birthtime; + sb->st_birthtim.tv_nsec = ip->i_din2->di_birthnsec; + sb->st_blocks = dbtob((u_quad_t)ip->i_din2->di_blocks) / S_BLKSIZE; + } + + sb->st_blksize = max(PAGE_SIZE, vp->v_mount->mnt_stat.f_iosize); + sb->st_flags = ip->i_flags; + sb->st_gen = ip->i_gen; + + return (vop_stat_helper_post(ap, error)); +} + +/* ARGSUSED */ +static int ufs_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; @@ -2822,6 +2883,7 @@ struct vop_vector ufs_vnodeops = { .vop_cachedlookup = ufs_lookup, .vop_close = ufs_close, .vop_create = ufs_create, + .vop_stat = ufs_stat, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, .vop_ioctl = ufs_ioctl, From owner-svn-src-head@freebsd.org Sat Aug 8 01:14: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 BF0FE37913A; Sat, 8 Aug 2020 01:14:54 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNkmF74Rbz4813; Sat, 8 Aug 2020 01:14:53 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pj1-x1031.google.com with SMTP id t6so1888898pjr.0; Fri, 07 Aug 2020 18:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TBwvVDYvSfUGk+lhViplOXHaGP/eoF2Inc2cvE5JjwY=; b=vYMGN538uDzLa3y3VOFxat56dNQhsF0CExo+HfA/bFMyTNJW9Gs2aOEkIn5bWNYdBP aU/dyGmIIKNybCr2yaihuIdaZ+Mk2WLdczy6lPjstXb5vkoLY/IiJHuW283BeO/I+y9U cPCtwq6BvHbPjpXGQt1HT40ieZkiHA2b05MRUjEGcW12jtUg6CkJOW5mM+wloepQkgMv D7F7U5pZ5iP4UgZIXNO0j0bL+NZa3S9QEGq1qwA7QLJdNABEPRle+SdTCyKL3gcFKvOm ibRLRcsFPJCphHbKwf0OlVbqFd8EVkOTSgG557ywlfS/Bi7sdRceUPjXznJcUhbfXuYF 7Esw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=TBwvVDYvSfUGk+lhViplOXHaGP/eoF2Inc2cvE5JjwY=; b=itwhV9WHGcTc3AXON4xZ2ZP0+iMJ75qlbWfQ6et1p/dlzjZB3I4nnZrrj6YXjTFuKQ XEeLBey9uFf07BoqsOIIDqyQLoMVLygdbE+UFafECOw8mKaa1FBs2Tybtj9c3wR7Od4W tyQ3p91WJdozo9JNG/fXcKymYTbXx93VKUJGBW9G2wdPGcXhrekRYZQUH2i/qkZwdvu0 dsF5O+S3c+gxpDwc0ut6vdIp96SEEzIteOc2ObDuW1bB6DmOiF6PYizyv11k3+Sm6yxn 4wfeFL26N2GxvlUckrV16MBDpdeoVzbZmCbSyeL5k0IkRkxZ8RlI8yK4MFgfsVklDmRp WSBg== X-Gm-Message-State: AOAM5310YB0SB0zL3JNzzNpnWaMHs1t8MNVYeU7UBNiSBb7vNWyiGD9X Wy9QDX+GMJUsyisJpL50WTcdj8UV X-Google-Smtp-Source: ABdhPJzUI9gd4Enip9ywcrUeZJ25Vw2qR6D4e2BF9fQML28DNSGLBXiRN9NyYUW7RRqtcLhtMvH5bA== X-Received: by 2002:a17:902:7082:: with SMTP id z2mr7458882plk.301.1596849292008; Fri, 07 Aug 2020 18:14:52 -0700 (PDT) Received: from ?IPv6:2403:5800:7100:5d01:8415:93d0:c4d5:986b? (2403-5800-7100-5d01-8415-93d0-c4d5-986b.ip6.aussiebb.net. [2403:5800:7100:5d01:8415:93d0:c4d5:986b]) by smtp.gmail.com with ESMTPSA id a199sm10832857pfa.201.2020.08.07.18.14.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 18:14:51 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r364038 - head/sys/dev/pci To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008071840.077Iev6Q019339@repo.freebsd.org> From: Kubilay Kocak Message-ID: <1113e4f6-3bb9-3944-74d1-b467d71c8dd8@FreeBSD.org> Date: Sat, 8 Aug 2020 11:14:47 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Thunderbird/80.0 MIME-Version: 1.0 In-Reply-To: <202008071840.077Iev6Q019339@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BNkmF74Rbz4813 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=vYMGN538; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::1031 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-2.12 / 15.00]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.00)[-0.005]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.924]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.991]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1031:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:14:54 -0000 On 8/08/2020 4:40 am, Alexander Motin wrote: > Author: mav > Date: Fri Aug 7 18:40:56 2020 > New Revision: 364038 > URL: https://svnweb.freebsd.org/changeset/base/364038 > > Log: > Enable hw.pci.enable_aspm tunable by default. > > While effects on power saving is only a guess, effects on hot-plug are > clearly visible. Lets try to enable it and see what happen. > > MFC after: 3 months > > Modified: > head/sys/dev/pci/pci.c > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Fri Aug 7 18:38:10 2020 (r364037) > +++ head/sys/dev/pci/pci.c Fri Aug 7 18:40:56 2020 (r364038) > @@ -408,7 +408,7 @@ static int pci_enable_ari = 1; > SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, > 0, "Enable support for PCIe Alternative RID Interpretation"); > > -int pci_enable_aspm; > +int pci_enable_aspm = 1; > SYSCTL_INT(_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, &pci_enable_aspm, > 0, "Enable support for PCIe Active State Power Management"); > > _______________________________________________ > 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" > relnotes: Yes? From owner-svn-src-head@freebsd.org Sat Aug 8 01:19: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 B18E13797CE; Sat, 8 Aug 2020 01:19:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNks86hMHz484S; Sat, 8 Aug 2020 01:19:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id a15so3158629wrh.10; Fri, 07 Aug 2020 18:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=URt+Lt50CxXdzjg17fe7YEW8ImjI8fZAj7tdDrqexqg=; b=gTxiFl44DXpFZHY+/MF22kkdL872qTR+P4FEnTY1nu+8HtjtK0OOide8P3bBbV9i/H LtK/0If+s6TFWpgaaa1T/HvlPMVB/YmSXvL6AlCOPHtHmUzI9B5ImiOmlN49c/yjEEXc ZU67pSJBGIBnEGlVyWvo385JnJWqWYknLLiVeYpn5SvNUFkmvuOzlusTpMasdmcvCmpT ehLWw2U7fw22GJCG/rTh1af4ERuS7TVU9VYS5ckBJ82jZrp71+mY8DwjYRrzFW68cGNd dwYELJePcZcaqYVmmz5r/rQf6oKoXi/uepByiV6YKGAHIXxSDCmWfT/KBgQBV8s8ocn7 5OHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=URt+Lt50CxXdzjg17fe7YEW8ImjI8fZAj7tdDrqexqg=; b=rQcC5V6+CC67yJ82in/7EFzDtNi/aq77C83lXeWhQjcnxYCRhq30/UARiM3GlU90Vh /GRNzLAeC3K/6sjSYLEM6GVQZBZVJe6+3HtaDlauMJiY+BCP0w5Hx6HbTL92gEkDyFMC J9W+++HYvr1PpxBfR8SunGa18sKlzHEfeBViZ7+5uMQRwwawX6yrxeTArG0XRWMBj/r1 IGc0+SuuAYQHvgwPMeo9K+7MEnbA0BXLjX1bV9M5MhHhSlEYMBWXVgvTE85Uoi7PZBnY VQuR7PCZ4mJmU0ewm8AmU9Ahtz13OKT94NPkJk3xVWVIDKwqmh65zzqv/rnlzHXac+AO tFiQ== X-Gm-Message-State: AOAM531Y2w+gD8BJBlmjATIFyZw1NYSbjAXInsMUivtUrBDINT/CAIEL gMNUiq/PxFZSXbKOOKEZHNGIDHIBL0j0eUd1C7KMKQ== X-Google-Smtp-Source: ABdhPJy5XihmnbN7nyPDdlul/DmFMSixybI85zvRLI0k/bj0W8ac0wz/PpGfDkN819EkWPb4w/d0KPZUg7znh/pSNa4= X-Received: by 2002:adf:f8d0:: with SMTP id f16mr15309331wrq.66.1596849546683; Fri, 07 Aug 2020 18:19:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Fri, 7 Aug 2020 18:19:05 -0700 (PDT) In-Reply-To: <202008062046.076KkDSc013901@repo.freebsd.org> References: <202008062046.076KkDSc013901@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 8 Aug 2020 03:19:05 +0200 Message-ID: Subject: Re: svn commit: r363992 - head/usr.sbin/pwd_mkdb To: Alex Richardson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BNks86hMHz484S X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gTxiFl44; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.29 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.945]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.983]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::442:from]; NEURAL_HAM_SHORT(-0.37)[-0.366]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:19:09 -0000 This broke i386 builds: /usr/src/usr.bin/chpass/field.c:175:15: error: incompatible pointer types passing '_bootstrap_time_t *' (aka 'unsigned long long *') to parameter of type 'time_t *' (aka 'int *') [-Werror,-Wincompatible-pointer-types] if (!atot(p, &pw->pw_change)) ^~~~~~~~~~~~~~ /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to parameter here int atot(char *, time_t *); ^ /usr/src/usr.bin/chpass/field.c:185:15: error: incompatible pointer types passing '_bootstrap_time_t *' (aka 'unsigned long long *') to parameter of type 'time_t *' (aka 'int *') [-Werror,-Wincompatible-pointer-types] if (!atot(p, &pw->pw_expire)) ^~~~~~~~~~~~~~ /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to parameter here int atot(char *, time_t *); ^ On 8/6/20, Alex Richardson wrote: > Author: arichardson > Date: Thu Aug 6 20:46:13 2020 > New Revision: 363992 > URL: https://svnweb.freebsd.org/changeset/base/363992 > > Log: > Allow bootstrapping pwd_mkdb on Linux/macOS > > We need to provide a struct passwd that is compatible with the target > system and this is not the case when cross-building from macOS/Linux. > It should also be a problem when bootstrapping for an i386 target from a > FreeBSD amd64 host since time_t does not match across those systems. > However, pwd_mkdb always truncates integer values to 32-bit so this > difference does not result in different databases. > > Reviewed By: brooks > Differential Revision: https://reviews.freebsd.org/D25931 > > Added: > head/usr.sbin/pwd_mkdb/pwd.h (contents, props changed) > Modified: > head/usr.sbin/pwd_mkdb/Makefile > > Modified: head/usr.sbin/pwd_mkdb/Makefile > ============================================================================== > --- head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:44:40 2020 (r363991) > +++ head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:46:13 2020 (r363992) > @@ -9,5 +9,8 @@ MAN= pwd_mkdb.8 > SRCS= pw_scan.c pwd_mkdb.c > > CFLAGS+= -I${SRCTOP}/lib/libc/gen # for pw_scan.h > +.if defined(BOOTSTRAPPING) > +CFLAGS+=-I${.CURDIR} > +.endif > > .include > > Added: head/usr.sbin/pwd_mkdb/pwd.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/pwd_mkdb/pwd.h Thu Aug 6 20:46:13 2020 (r363992) > @@ -0,0 +1,66 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright 2018-2020 Alex Richardson > + * > + * This software was developed by SRI International and the University of > + * Cambridge Computer Laboratory (Department of Computer Science and > + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of > the > + * DARPA SSITH research programme. > + * > + * This software was developed by SRI International and the University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract > (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +/* > + * When building pwd_mkdb we need to use target systems definition of > + * struct passwd. This protects against future changes to struct passwd > and > + * is essential to allow cross-building from Linux/macOS hosts since the > + * structure is not compatible there. > + */ > +#include > +#include > +/* > + * Note: pwd_mkdb always stores uint32_t for all integer fields (including > + * time_t!) so these definitions do not need to match sys/sys/_types.h > + */ > +typedef uint32_t _bootstrap_gid_t; > +typedef uint32_t _bootstrap_uid_t; > +typedef uint64_t _bootstrap_time_t; > +#define _GID_T_DECLARED > +#define _TIME_T_DECLARED > +#define _UID_T_DECLARED > +#define _SIZE_T_DECLARED > + > +#define gid_t _bootstrap_gid_t > +#define uid_t _bootstrap_uid_t > +#define time_t _bootstrap_time_t > +#define passwd _bootstrap_passwd > +#include "../../include/pwd.h" > +#undef gid_t > +#undef uid_t > +#undef time_t > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 8 01:30: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 7140B379957; Sat, 8 Aug 2020 01:30:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNl6b2dsFz48l6; Sat, 8 Aug 2020 01:30:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f52.google.com with SMTP id x24so3061601otp.3; Fri, 07 Aug 2020 18:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FGAsNu8Kl2Ys8GTtOrfdARhEV2oL0WnSxytVRDmF7Zs=; b=nj+nmyZ3SkbLi9fqAcPlcuRVPFq+vHdt5npBUAK2odzGy5wG1BZD4mMkeCyQAq8kHL DuXfzVamT2/0thROHfEyN4s+o2ynJGCgl1G+wULGEAuF9SoCyyvWb0ILB66tDNyZxFlN IQdMjFgwMSBNwE3ZQAChPCAQDVXH4ReyxymEHXEABUfWDU2XNxvh8Fymlz6mYpJ1HhdG w1sSyCaCsw8KFCyk3JR4sINvVVY2YP7cS9R2CI39z+VPtHZqGX6zoEFKBbW7pSGwmFKg Z2lygwUXot3y+HChhNFKFFd3uQ0YwOafme9Z1tFbbZzg/LhoEYZEB9EXD0n7uk67mz3u bisA== X-Gm-Message-State: AOAM530RQgQ4Bejxe/KGnDPvuiVXRWkw7WQ2DZADDArSQbolV0niRBv6 6BC8/+4ulU7Zlf7eqJ7FvxxMPuuH4rZTnk710PQ4WHRa X-Google-Smtp-Source: ABdhPJwyQ6pRQHSABijfprpPDC/Rw8xD7P2CJJRh+xoFuyqQ0MR56qryuWJIxeMec9ME0KiWZX1t3TMXekt+H2kg7U0= X-Received: by 2002:a05:6830:1612:: with SMTP id g18mr13246762otr.251.1596850245838; Fri, 07 Aug 2020 18:30:45 -0700 (PDT) MIME-Version: 1.0 References: <202008072306.077N6fjP084661@repo.freebsd.org> In-Reply-To: <202008072306.077N6fjP084661@repo.freebsd.org> From: Alan Somers Date: Fri, 7 Aug 2020 19:30:34 -0600 Message-ID: Subject: Re: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BNl6b2dsFz48l6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:30:48 -0000 On Fri, Aug 7, 2020 at 5:06 PM Mateusz Guzik wrote: > Author: mjg > Date: Fri Aug 7 23:06:40 2020 > New Revision: 364044 > URL: https://svnweb.freebsd.org/changeset/base/364044 > > Log: > vfs: add VOP_STAT > > The current scheme of calling VOP_GETATTR adds avoidable overhead. > > An example with tmpfs doing fstat (ops/s): > before: 7488958 > after: 7913833 > > Reviewed by: kib (previous version) > Differential Revision: https://reviews.freebsd.org/D25910 > > Modified: > head/share/man/man9/Makefile > head/share/man/man9/VOP_ATTRIB.9 > head/sys/compat/linuxkpi/common/src/linux_compat.c > head/sys/kern/vfs_default.c > head/sys/kern/vfs_syscalls.c > head/sys/kern/vfs_vnops.c > head/sys/kern/vnode_if.src > head/sys/security/audit/audit_arg.c > head/sys/sys/vnode.h > What avoidable overhead? The tmpfs_stat handler that you added in your next commit looks pretty much the same as vop_getattr. I'm missing where the performance improvement comes from. Could you please fill me in? -Alan From owner-svn-src-head@freebsd.org Sat Aug 8 01:39: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 E5A1F379A55; Sat, 8 Aug 2020 01:39:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNlJQ41hWz494Q; Sat, 8 Aug 2020 01:39:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id d190so3140480wmd.4; Fri, 07 Aug 2020 18:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AA6ZGx0ZIx28lmvzUwfqC35TLB43PfGTyHhJGeTS3cw=; b=vFNSaXx7NFfX498BeBhAbqlHQWIWoEmiXZ0GoADBRaFm5lbmJDryEI+Rn7XmKCWD7H 0E42OOta/Af8EEhAG0EHIxkYXOghR0IMLJ8PA4nZRSF0/T1Z5t5nvUMpp1VacMFTHVfQ LG/bxrVTnvuI4DV+fNc4iP1NyHqbZF/YLda/sOpTDz7J5ByAyUK90zPqdcR7cKcyWblG u1PNn3sHJ3LbNNK1F1YU0keVWyeWkU+L6TDGlHENcY7LafS9v5u1p5q6uMcHh9GyWMLk orcIzFpnNc69knzvc12cz+zAnrxwqR4gEPPEjfzxzgtfz3Lxd+8xfIVovV60WZO0d/Y2 NxxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AA6ZGx0ZIx28lmvzUwfqC35TLB43PfGTyHhJGeTS3cw=; b=IiSzq8qA+U+9bCgWzIEbBnILUnigFBD97++H0xy1Ks8x0BO5YQouueVl+9UFau8808 mOvs2GZLLKO39UlEueybSruWikZYjj/pNEqw8zh9hAtbQxWUE64EBQ8y5zOmohTIAyN2 qK2jZ5A7zT7FCKdurMXhdd5ebEuV/NXO+m9whGN9b33Zmai17510y6prkhkdwL/0r2q7 pj1cpjJ19x8l9EjFWeTaEhuh+tzsDroiy2+O8eR8GoUJMkEMEW+SJ5/VbGzotSW2iBhR 9dLFlU4/uEw3a0fu/m+MzlF+sY2mY2u7MziiyVAU1RBK38GlUg7N8ss8tDbKu/yjCE7A Rwhg== X-Gm-Message-State: AOAM5314WIRSHXmjVkWNcg5786jW9G5eZy3fNJCYAMrtpXqo6rxO8kFB 8o97ua6MZi9FVKFJzJSbZPvXfDamkhFfg5XRRy5bLw== X-Google-Smtp-Source: ABdhPJyKa1XrA5fEcLIQxi5zVToUc7DAnGmVdDbifFXprZ31J2y/IIuqKKBpPtHOyf73YlqmDNPJNcwL3ZVFGkGcgTc= X-Received: by 2002:a7b:cb98:: with SMTP id m24mr15803591wmi.10.1596850756205; Fri, 07 Aug 2020 18:39:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Fri, 7 Aug 2020 18:39:15 -0700 (PDT) In-Reply-To: References: <202008072306.077N6fjP084661@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 8 Aug 2020 03:39:15 +0200 Message-ID: Subject: Re: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BNlJQ41hWz494Q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:39:19 -0000 tmpfs_getattr fills > 100 bytes worth of data into struct vattr, which then has to be converted to struct stat format. The conversion happens to copy some of it as it is and branch on other stuff. tmpfs_stat elides the entire process. On 8/8/20, Alan Somers wrote: > On Fri, Aug 7, 2020 at 5:06 PM Mateusz Guzik wrote: > >> Author: mjg >> Date: Fri Aug 7 23:06:40 2020 >> New Revision: 364044 >> URL: https://svnweb.freebsd.org/changeset/base/364044 >> >> Log: >> vfs: add VOP_STAT >> >> The current scheme of calling VOP_GETATTR adds avoidable overhead. >> >> An example with tmpfs doing fstat (ops/s): >> before: 7488958 >> after: 7913833 >> >> Reviewed by: kib (previous version) >> Differential Revision: https://reviews.freebsd.org/D25910 >> >> Modified: >> head/share/man/man9/Makefile >> head/share/man/man9/VOP_ATTRIB.9 >> head/sys/compat/linuxkpi/common/src/linux_compat.c >> head/sys/kern/vfs_default.c >> head/sys/kern/vfs_syscalls.c >> head/sys/kern/vfs_vnops.c >> head/sys/kern/vnode_if.src >> head/sys/security/audit/audit_arg.c >> head/sys/sys/vnode.h >> > > What avoidable overhead? The tmpfs_stat handler that you added in your next > commit looks pretty much the same as vop_getattr. I'm missing where the > performance improvement comes from. Could you please fill me in? > -Alan > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 8 01:40: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 153DE379A6A; Sat, 8 Aug 2020 01:40:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNlL32Sr0z49Jf; Sat, 8 Aug 2020 01:40:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id p20so3208497wrf.0; Fri, 07 Aug 2020 18:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vTIUR68/SQ1Cla7XXXP4lPp0cNLmfyXoZ8UVRn/D/vQ=; b=grvdjNlxJEqZtBcx/ro15XTMpJ4k9MHEEPdkK1cGL4FchGEpCLW2rGCgLRrwSZ2108 Sda9B0qXUdySksJdxJwuS7+14+LuB4sEh1rmANk0eAnp2CrEv2pUWr//Qdh5yK56QwaP cO5oVVZRpIGGGZRznoi2kOsL9KlPDta88nVdNUxz8HBt2pXTgYeGsNlBlpJ9uUscAXtt 9FgxHdH1dwUUKt2+4fF8EU6A/STFb/irE7bos4yBj7958y1iZUjLaTRccPQo5DNM2SA+ l5x9aJhk5RKpIFoTdWwjKad6pqWAgVW9VEhdewF9vWBWCIfIeh1QaIGQpe8KoDReNWTa odpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vTIUR68/SQ1Cla7XXXP4lPp0cNLmfyXoZ8UVRn/D/vQ=; b=kSliypzLtjtWDZFO8pMsSevXonU6xX5UjIukKPaREECVJPJn/DtFHdtVDGqUrEhM0Y 4jqIi/OKZviHFtYG1AcHEKpWnrICrhjed345Vbitijdidvch6LM87QIuQvk8e+rgSZxz Lnj+ZCCzNmYdWtN3mMawm5ouFExIkNVHzMLQuLMebksWlsT48BgEsOxaE4d4sbmbYVmr GfAka48qDD/B3NpF3zDhx1cM+e6/cCJ5/NDisRfND3QBCZPQHWbDgGPwInQvut9gwKkb gNugrjaQa1fNF/VNRJH3x2cgIogGoMnVyBpKDSMVEsisxC2N4UkttkzT8HkvgVsgHAS7 yHrA== X-Gm-Message-State: AOAM5336sveRlWs9WwFrD3Ggzh/zvEKCpPHCJ2jv3Am7/5K6+7TKbB7A pHnHYtIpIQ78sxGH8QMf02n0vngI/4QX6tjqzGF7vg== X-Google-Smtp-Source: ABdhPJzH51WtEUqHiMgImkgFPXxsWmIDtjzmhl2wpmSy8w/KdrwiejrLPdCGqMB7SKXhNcJxcRrl3K+YpizM5CTMgoY= X-Received: by 2002:adf:e94c:: with SMTP id m12mr14411738wrn.109.1596850841679; Fri, 07 Aug 2020 18:40:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Fri, 7 Aug 2020 18:40:41 -0700 (PDT) In-Reply-To: References: <202008072306.077N6fjP084661@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 8 Aug 2020 03:40:41 +0200 Message-ID: Subject: Re: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BNlL32Sr0z49Jf X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=grvdjNlx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.25 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.895]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-0.98)[-0.982]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::442:from]; NEURAL_HAM_SHORT(-0.37)[-0.369]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:40:44 -0000 or to put differently, the difference is disapperance of vn_stat from the codepath. On 8/8/20, Mateusz Guzik wrote: > tmpfs_getattr fills > 100 bytes worth of data into struct vattr, which > then has to be converted to struct stat format. The conversion happens > to copy some of it as it is and branch on other stuff. tmpfs_stat > elides the entire process. > > On 8/8/20, Alan Somers wrote: >> On Fri, Aug 7, 2020 at 5:06 PM Mateusz Guzik wrote: >> >>> Author: mjg >>> Date: Fri Aug 7 23:06:40 2020 >>> New Revision: 364044 >>> URL: https://svnweb.freebsd.org/changeset/base/364044 >>> >>> Log: >>> vfs: add VOP_STAT >>> >>> The current scheme of calling VOP_GETATTR adds avoidable overhead. >>> >>> An example with tmpfs doing fstat (ops/s): >>> before: 7488958 >>> after: 7913833 >>> >>> Reviewed by: kib (previous version) >>> Differential Revision: https://reviews.freebsd.org/D25910 >>> >>> Modified: >>> head/share/man/man9/Makefile >>> head/share/man/man9/VOP_ATTRIB.9 >>> head/sys/compat/linuxkpi/common/src/linux_compat.c >>> head/sys/kern/vfs_default.c >>> head/sys/kern/vfs_syscalls.c >>> head/sys/kern/vfs_vnops.c >>> head/sys/kern/vnode_if.src >>> head/sys/security/audit/audit_arg.c >>> head/sys/sys/vnode.h >>> >> >> What avoidable overhead? The tmpfs_stat handler that you added in your >> next >> commit looks pretty much the same as vop_getattr. I'm missing where the >> performance improvement comes from. Could you please fill me in? >> -Alan >> > > > -- > Mateusz Guzik > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 8 01:51: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 3A48137A184; Sat, 8 Aug 2020 01:51:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNlZd0s9kz4BCN; Sat, 8 Aug 2020 01:51:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f50.google.com with SMTP id a65so3044532otc.8; Fri, 07 Aug 2020 18:51:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P+/Gi6TXXCwKwAKQZtpj2Cla+rJnZGUntsq1UFB1R/A=; b=L6QIPkjHnbuhytzt+q4DS9MlNE1+TLVwrBs5uJA9TXK6Ckj79+QC7EGD4yXKvsxww5 IyVyASWqvhY+ZhxmkdIZfRWFGa3eHH4c2rmHBA26ffcMxtWT6+nkzQ7WMj3bzIvHFlMi mZ9zz6RXGqzIyYNS0hvEypunPaeTzBKhUYPEQSuF9xkSmc6tANCc7TZijA1VpLKTfzxW 3HdvZAgcXIKISxvuHPpKPEJ2MiFO1XuU3tnwNN4flSJ4Sp4DcGbmf6Y+wyLxfrfy/VG6 j30znYafDRJaNiwZQlIN/UUYqwRD4iRCAzGbYg52VTWGCDfFe5qFgoPpwf+yKoBM1419 qm8Q== X-Gm-Message-State: AOAM533WXUVvTpzufbAI3jZWIEFAEpXrl1TM/1Aj17KD/5m2fzl7/ZDi dkL6CDY3tIkkYrgpzWjOfJ3LH8VwO8s+shm2PEBBjyvH X-Google-Smtp-Source: ABdhPJyW5YIFSaDciMUNP2k4AuQhttZ+BHrtwPX0I6R2DsJMA4EDl33OOovpDhQy6suRhRmYhJwB6OH3KVH8r6bi0yg= X-Received: by 2002:a9d:4b82:: with SMTP id k2mr14646875otf.18.1596851495977; Fri, 07 Aug 2020 18:51:35 -0700 (PDT) MIME-Version: 1.0 References: <202008072306.077N6fjP084661@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Fri, 7 Aug 2020 19:51:24 -0600 Message-ID: Subject: Re: svn commit: r364044 - in head: share/man/man9 sys/compat/linuxkpi/common/src sys/kern sys/security/audit sys/sys To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BNlZd0s9kz4BCN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.50 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-0.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.27)[-0.274]; 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:c]; NEURAL_HAM_LONG(-0.54)[-0.539]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.50:from]; NEURAL_SPAM_SHORT(0.13)[0.130]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.50:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 01:51:38 -0000 So it's just the struct copy, then? I'm impressed that it made that much difference to remove it. -Alan On Fri, Aug 7, 2020 at 7:40 PM Mateusz Guzik wrote: > or to put differently, the difference is disapperance of vn_stat from > the codepath. > > On 8/8/20, Mateusz Guzik wrote: > > tmpfs_getattr fills > 100 bytes worth of data into struct vattr, which > > then has to be converted to struct stat format. The conversion happens > > to copy some of it as it is and branch on other stuff. tmpfs_stat > > elides the entire process. > > > > On 8/8/20, Alan Somers wrote: > >> On Fri, Aug 7, 2020 at 5:06 PM Mateusz Guzik wrote: > >> > >>> Author: mjg > >>> Date: Fri Aug 7 23:06:40 2020 > >>> New Revision: 364044 > >>> URL: https://svnweb.freebsd.org/changeset/base/364044 > >>> > >>> Log: > >>> vfs: add VOP_STAT > >>> > >>> The current scheme of calling VOP_GETATTR adds avoidable overhead. > >>> > >>> An example with tmpfs doing fstat (ops/s): > >>> before: 7488958 > >>> after: 7913833 > >>> > >>> Reviewed by: kib (previous version) > >>> Differential Revision: https://reviews.freebsd.org/D25910 > >>> > >>> Modified: > >>> head/share/man/man9/Makefile > >>> head/share/man/man9/VOP_ATTRIB.9 > >>> head/sys/compat/linuxkpi/common/src/linux_compat.c > >>> head/sys/kern/vfs_default.c > >>> head/sys/kern/vfs_syscalls.c > >>> head/sys/kern/vfs_vnops.c > >>> head/sys/kern/vnode_if.src > >>> head/sys/security/audit/audit_arg.c > >>> head/sys/sys/vnode.h > >>> > >> > >> What avoidable overhead? The tmpfs_stat handler that you added in your > >> next > >> commit looks pretty much the same as vop_getattr. I'm missing where the > >> performance improvement comes from. Could you please fill me in? > >> -Alan > >> > > > > > > -- > > Mateusz Guzik > > > > > -- > Mateusz Guzik > From owner-svn-src-head@freebsd.org Sat Aug 8 02:50: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 6086037B468; Sat, 8 Aug 2020 02:50:27 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNmtT2WWFz4DL9; Sat, 8 Aug 2020 02:50:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id 77so3535172qkm.5; Fri, 07 Aug 2020 19:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f58sBsHTxnwAFUNfy+KjykxV4GFKpsLiyGNwmJpZ3H4=; b=em4+F5fWRjjiJiTLLpRyj1n8ZTbjkGBrV0sWddbpIwPdfp/p50b5N4dB2jdBRyJ1jC 5QLOn4Wyv0PCe1bTAlSYPsbWTglj9ELfCYKiAX9DaAUPgna6bq0GdUqvLc3CaNmDm+g0 gVk5aTXHiX6qZA41OfbXqOkZ02gGiS5vfxN18BGeH9dkGkw7QhYgmWVTTSeAhRqwLF7b EmHFbG/HBG//y0RwyTLqHw3/jhYIP+UoWHZCjNbMhjZSBzx66g0t3wxqRErqiXOv5bgi UiskOzuBCGbMt6VHoyKnb84WdqkOuiubxN3ypdyTTi7NtqMDUOV55Svao64D55eWZLkl 4qyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=f58sBsHTxnwAFUNfy+KjykxV4GFKpsLiyGNwmJpZ3H4=; b=QMjKEdDEz7JmepfmP3BuywUNEWB1h7Stp6wMTiE+NdYqVz2fvQGWIn3MPrMhcdSQk6 dhzF3AiDAhUNEcUGs2Z79DnR/zpit4U4plh3H4QTntL39GKrhWx3gax/VXMWg++57YAE vNjJmtFpD5pXkyrL1VQ//nkf9HmLpLEkNijlWIteOo0wK9K8SMxRNr0s5nR466Acmwiy ZnGDPEFhMKi+rXXXM5RSk7xoECLrwv1x1YtuJUrt+HipwfLHBfD/xJTdGJ/iORut6ksP WmJ9g4it74bv8/Fd+XoaEwOFJB25lSnZiWEyjO6c8MID0/O3uT5/ksO8dE6pf5bPU4vn 1Pjw== X-Gm-Message-State: AOAM531zNRQcAKDZWN2zLhkHb+SEU/Zj+Gg/hdFUAMRWc/5pKA0Z4zAY ebflT1v8ZCqh9cmDWeyQE3QCYQzR X-Google-Smtp-Source: ABdhPJz1hxFpkaurLmVibSbJ32pDIGzYjnSw6/EXDHjUXF+SmJSJT2kiCLbfGfl1xz04CwcGa9X/FA== X-Received: by 2002:a37:9287:: with SMTP id u129mr16006155qkd.238.1596855023693; Fri, 07 Aug 2020 19:50:23 -0700 (PDT) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id w18sm9933292qtk.1.2020.08.07.19.50.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 19:50:23 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r364038 - head/sys/dev/pci To: koobs@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008071840.077Iev6Q019339@repo.freebsd.org> <1113e4f6-3bb9-3944-74d1-b467d71c8dd8@FreeBSD.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <2da6aeeb-fa7e-c30a-da13-e8220f188081@FreeBSD.org> Date: Fri, 7 Aug 2020 22:50:22 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <1113e4f6-3bb9-3944-74d1-b467d71c8dd8@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BNmtT2WWFz4DL9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=em4+F5fW; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.13 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.99)[-0.985]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.84)[-0.842]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.11)[-0.105]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::736:from]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 02:50:27 -0000 On 07.08.2020 21:14, Kubilay Kocak wrote: > On 8/08/2020 4:40 am, Alexander Motin wrote: >> Author: mav >> Date: Fri Aug  7 18:40:56 2020 >> New Revision: 364038 >> URL: https://svnweb.freebsd.org/changeset/base/364038 >> >> Log: >>    Enable hw.pci.enable_aspm tunable by default. >>       While effects on power saving is only a guess, effects on >> hot-plug are >>    clearly visible.  Lets try to enable it and see what happen. >>       MFC after:    3 months >> >> Modified: >>    head/sys/dev/pci/pci.c >> >> Modified: head/sys/dev/pci/pci.c >> ============================================================================== >> >> --- head/sys/dev/pci/pci.c    Fri Aug  7 18:38:10 2020    (r364037) >> +++ head/sys/dev/pci/pci.c    Fri Aug  7 18:40:56 2020    (r364038) >> @@ -408,7 +408,7 @@ static int pci_enable_ari = 1; >>   SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, >> &pci_enable_ari, >>       0, "Enable support for PCIe Alternative RID Interpretation"); >>   -int pci_enable_aspm; >> +int pci_enable_aspm = 1; >>   SYSCTL_INT(_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, >> &pci_enable_aspm, >>       0, "Enable support for PCIe Active State Power Management"); >>   _______________________________________________ >> 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" >> > > relnotes: Yes? If you say so. But since there is no real functionality behind it other then a small lie to ACPI, I am not sure. -- Alexander Motin From owner-svn-src-head@freebsd.org Sat Aug 8 10:05: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 E1FCE3A6807; Sat, 8 Aug 2020 10:05:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNyXS5htxz4ZvJ; Sat, 8 Aug 2020 10:05:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6D0F270E0; Sat, 8 Aug 2020 10:05:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 078A5Sld091623; Sat, 8 Aug 2020 10:05:28 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 078A5StA091621; Sat, 8 Aug 2020 10:05:28 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008081005.078A5StA091621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sat, 8 Aug 2020 10:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364049 - in head: usr.bin/chpass usr.sbin/pwd_mkdb usr.sbin/pwd_mkdb/bootstrap X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: usr.bin/chpass usr.sbin/pwd_mkdb usr.sbin/pwd_mkdb/bootstrap X-SVN-Commit-Revision: 364049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 10:05:28 -0000 Author: arichardson Date: Sat Aug 8 10:05:27 2020 New Revision: 364049 URL: https://svnweb.freebsd.org/changeset/base/364049 Log: Fix i386 build of chpass after r363992 My change to allow bootstrapping pwd_mkdb (r363992) resulted in i386 build failures because the bootstrap header was being included in non-bootstrap chpass. Dropping the no longer required pwd_mkdb include path from chpass fixes the build, but to be certain that the failure doesn't get re-introduced, I've also moved the bootstrap pwd.h into a subdirectory so that adding -I${SRCTOP}/usr.sbin/pwd_mkdb doesn't pull it in. Reported by: mjg Added: head/usr.sbin/pwd_mkdb/bootstrap/ head/usr.sbin/pwd_mkdb/bootstrap/pwd.h (contents, props changed) - copied, changed from r364046, head/usr.sbin/pwd_mkdb/pwd.h Deleted: head/usr.sbin/pwd_mkdb/pwd.h Modified: head/usr.bin/chpass/Makefile head/usr.sbin/pwd_mkdb/Makefile Modified: head/usr.bin/chpass/Makefile ============================================================================== --- head/usr.bin/chpass/Makefile Fri Aug 7 23:32:42 2020 (r364048) +++ head/usr.bin/chpass/Makefile Sat Aug 8 10:05:27 2020 (r364049) @@ -3,7 +3,7 @@ .include -.PATH: ${SRCTOP}/usr.sbin/pwd_mkdb ${SRCTOP}/lib/libc/gen +.PATH: ${SRCTOP}/lib/libc/gen PROG= chpass SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c @@ -15,7 +15,7 @@ CFLAGS+= -DYP .endif #Some people need this, uncomment to activate #CFLAGS+=-DRESTRICT_FULLNAME_CHANGE -CFLAGS+=-I${SRCTOP}/usr.sbin/pwd_mkdb -I${SRCTOP}/lib/libc/gen -I. +CFLAGS+=-I${SRCTOP}/lib/libc/gen -I. LIBADD= crypt util .if ${MK_NIS} != "no" Modified: head/usr.sbin/pwd_mkdb/Makefile ============================================================================== --- head/usr.sbin/pwd_mkdb/Makefile Fri Aug 7 23:32:42 2020 (r364048) +++ head/usr.sbin/pwd_mkdb/Makefile Sat Aug 8 10:05:27 2020 (r364049) @@ -10,7 +10,7 @@ SRCS= pw_scan.c pwd_mkdb.c CFLAGS+= -I${SRCTOP}/lib/libc/gen # for pw_scan.h .if defined(BOOTSTRAPPING) -CFLAGS+=-I${.CURDIR} +CFLAGS+=-I${.CURDIR}/bootstrap .endif .include Copied and modified: head/usr.sbin/pwd_mkdb/bootstrap/pwd.h (from r364046, head/usr.sbin/pwd_mkdb/pwd.h) ============================================================================== From owner-svn-src-head@freebsd.org Sat Aug 8 10:08: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 1D7D53A688C; Sat, 8 Aug 2020 10:08:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNybp4YDxz4Zs4; Sat, 8 Aug 2020 10:08:22 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f67.google.com with SMTP id o23so4581072ejr.1; Sat, 08 Aug 2020 03:08:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=11vwio3iGFDaaXi17K1FmLSgQsB1cWVUC3DkzzofctE=; b=jzHsyBPu6O4uqq10yW6syqSd9yHyWaUuScw2b5o7FBhcJ1qUCtp039n5lsEaTjBZvg IP+rhuN7Ov2YYaJyUzkhH/3Rl0dvV9HQ7VrhHz2M8A7JAGPXq+YodxYfBi04td8EfzVg /cyJ9GyiN26li3bD2wwHYMrduPimjcxFMWzjZhISr3ybmISE85WqHQigEewzTpLGUECx x9g88AdJyTahVGivnhEjYEKIt8loPVoQg6FZXJ1ghr2tMS0tJIbxu2JMiElXonfljmZF AxKqd6AAAXjo6zIx1Qz9K2i56LwLV8kitiMdwk0D8RoTbfU/lb9qQMpztDNZYUtAMcwB jMhg== X-Gm-Message-State: AOAM533cuRbasXMPU5FfqU10RbUefTCKidVbFMfB7q08Dd5FekEMdaNE 8UfV7+EeVlaEsL21rOwVrJ8tfrW42/JfPg== X-Google-Smtp-Source: ABdhPJwm01Y3SAHKJMkQNsSpPtcE9y5jISbYB699JJ4kKfSHqnoHdbuS8IKgAbvi7i67mf5w6PWehA== X-Received: by 2002:a17:906:3e95:: with SMTP id a21mr13305997ejj.388.1596881300313; Sat, 08 Aug 2020 03:08:20 -0700 (PDT) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id g25sm7780049ejh.110.2020.08.08.03.08.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Aug 2020 03:08:20 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id f7so3816073wrw.1; Sat, 08 Aug 2020 03:08:19 -0700 (PDT) X-Received: by 2002:a05:6000:1203:: with SMTP id e3mr16197440wrx.324.1596881299662; Sat, 08 Aug 2020 03:08:19 -0700 (PDT) MIME-Version: 1.0 References: <202008062046.076KkDSc013901@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Sat, 8 Aug 2020 11:08:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363992 - head/usr.sbin/pwd_mkdb To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BNybp4YDxz4Zs4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.218.67 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-1.12 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; 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:c]; NEURAL_HAM_LONG(-0.94)[-0.944]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.67:from]; NEURAL_SPAM_SHORT(0.28)[0.281]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.67:from]; NEURAL_HAM_MEDIUM(-0.45)[-0.453]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 10:08:24 -0000 On Sat, 8 Aug 2020 at 02:19, Mateusz Guzik wrote: > > This broke i386 builds: > > /usr/src/usr.bin/chpass/field.c:175:15: error: incompatible pointer > types passing > '_bootstrap_time_t *' (aka 'unsigned long long *') to parameter > of type 'time_t *' > (aka 'int *') [-Werror,-Wincompatible-pointer-types] > if (!atot(p, &pw->pw_change)) > ^~~~~~~~~~~~~~ > /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to parameter here > int atot(char *, time_t *); > ^ > /usr/src/usr.bin/chpass/field.c:185:15: error: incompatible pointer > types passing > '_bootstrap_time_t *' (aka 'unsigned long long *') to parameter > of type 'time_t *' > (aka 'int *') [-Werror,-Wincompatible-pointer-types] > if (!atot(p, &pw->pw_expire)) > ^~~~~~~~~~~~~~ > /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to parameter here > int atot(char *, time_t *); > ^ Sorry, fixed in r364049. > On 8/6/20, Alex Richardson wrote: > > Author: arichardson > > Date: Thu Aug 6 20:46:13 2020 > > New Revision: 363992 > > URL: https://svnweb.freebsd.org/changeset/base/363992 > > > > Log: > > Allow bootstrapping pwd_mkdb on Linux/macOS > > > > We need to provide a struct passwd that is compatible with the target > > system and this is not the case when cross-building from macOS/Linux. > > It should also be a problem when bootstrapping for an i386 target from a > > FreeBSD amd64 host since time_t does not match across those systems. > > However, pwd_mkdb always truncates integer values to 32-bit so this > > difference does not result in different databases. > > > > Reviewed By: brooks > > Differential Revision: https://reviews.freebsd.org/D25931 > > > > Added: > > head/usr.sbin/pwd_mkdb/pwd.h (contents, props changed) > > Modified: > > head/usr.sbin/pwd_mkdb/Makefile > > > > Modified: head/usr.sbin/pwd_mkdb/Makefile > > ============================================================================== > > --- head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:44:40 2020 (r363991) > > +++ head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:46:13 2020 (r363992) > > @@ -9,5 +9,8 @@ MAN= pwd_mkdb.8 > > SRCS= pw_scan.c pwd_mkdb.c > > > > CFLAGS+= -I${SRCTOP}/lib/libc/gen # for pw_scan.h > > +.if defined(BOOTSTRAPPING) > > +CFLAGS+=-I${.CURDIR} > > +.endif > > > > .include > > > > Added: head/usr.sbin/pwd_mkdb/pwd.h > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/usr.sbin/pwd_mkdb/pwd.h Thu Aug 6 20:46:13 2020 (r363992) > > @@ -0,0 +1,66 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause > > + * > > + * Copyright 2018-2020 Alex Richardson > > + * > > + * This software was developed by SRI International and the University of > > + * Cambridge Computer Laboratory (Department of Computer Science and > > + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of > > the > > + * DARPA SSITH research programme. > > + * > > + * This software was developed by SRI International and the University of > > + * Cambridge Computer Laboratory under DARPA/AFRL contract > > (FA8750-10-C-0237) > > + * ("CTSRD"), as part of the DARPA CRASH research programme. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + * notice, this list of conditions and the following disclaimer in the > > + * documentation and/or other materials provided with the distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > > PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > > CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > > STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > > WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > > + * SUCH DAMAGE. > > + * > > + * $FreeBSD$ > > + */ > > + > > +/* > > + * When building pwd_mkdb we need to use target systems definition of > > + * struct passwd. This protects against future changes to struct passwd > > and > > + * is essential to allow cross-building from Linux/macOS hosts since the > > + * structure is not compatible there. > > + */ > > +#include > > +#include > > +/* > > + * Note: pwd_mkdb always stores uint32_t for all integer fields (including > > + * time_t!) so these definitions do not need to match sys/sys/_types.h > > + */ > > +typedef uint32_t _bootstrap_gid_t; > > +typedef uint32_t _bootstrap_uid_t; > > +typedef uint64_t _bootstrap_time_t; > > +#define _GID_T_DECLARED > > +#define _TIME_T_DECLARED > > +#define _UID_T_DECLARED > > +#define _SIZE_T_DECLARED > > + > > +#define gid_t _bootstrap_gid_t > > +#define uid_t _bootstrap_uid_t > > +#define time_t _bootstrap_time_t > > +#define passwd _bootstrap_passwd > > +#include "../../include/pwd.h" > > +#undef gid_t > > +#undef uid_t > > +#undef time_t > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 8 11:06: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 728193A8F32; Sat, 8 Aug 2020 11:06:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BNztr2Nq2z3Zjm; Sat, 8 Aug 2020 11:06:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3535D27C91; Sat, 8 Aug 2020 11:06:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 078B6S88041884; Sat, 8 Aug 2020 11:06:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 078B6SGg041883; Sat, 8 Aug 2020 11:06:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008081106.078B6SGg041883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 8 Aug 2020 11:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364050 - head/tests/sys/net/routing X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/tests/sys/net/routing X-SVN-Commit-Revision: 364050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 11:06:28 -0000 Author: dim Date: Sat Aug 8 11:06:27 2020 New Revision: 364050 URL: https://svnweb.freebsd.org/changeset/base/364050 Log: Use static inline for iface_{setup,delete}_addr in tests/sys/net/routing. This fixes possible link errors, similar to: ld: error: undefined symbol: iface_setup_addr >>> referenced by test_rtsock_l3.c:111 (tests/sys/net/routing/test_rtsock_l3.c:111) >>> test_rtsock_l3.o:(presetup_ipv4) >>> referenced by test_rtsock_l3.c:79 (tests/sys/net/routing/test_rtsock_l3.c:79) >>> test_rtsock_l3.o:(presetup_ipv6) >>> referenced by test_rtsock_l3.c:512 (tests/sys/net/routing/test_rtsock_l3.c:512) >>> test_rtsock_l3.o:(atfu_rtm_change_v4_gw_success_body) >>> referenced 10 more times In C (not C++), 'naked' inline is almost always a mistake. Either use static inline (this is appropriate for most cases), or extern inline. MFC after: 3 days Modified: head/tests/sys/net/routing/rtsock_common.h Modified: head/tests/sys/net/routing/rtsock_common.h ============================================================================== --- head/tests/sys/net/routing/rtsock_common.h Sat Aug 8 10:05:27 2020 (r364049) +++ head/tests/sys/net/routing/rtsock_common.h Sat Aug 8 11:06:27 2020 (r364050) @@ -204,7 +204,7 @@ iface_open(char *ifname) * Sets primary IPv4 addr. * Returns 0 on success. */ -inline int +static inline int iface_setup_addr(char *ifname, char *addr, int plen) { char cmd[512]; @@ -225,7 +225,7 @@ iface_setup_addr(char *ifname, char *addr, int plen) * Removes primary IPv4 prefix. * Returns 0 on success. */ -inline int +static inline int iface_delete_addr(char *ifname, char *addr) { char cmd[512]; From owner-svn-src-head@freebsd.org Sat Aug 8 16:27: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 EE4473AFD52 for ; Sat, 8 Aug 2020 16:27:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BP71d482dz46l1 for ; Sat, 8 Aug 2020 16:27:49 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1596904066; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=AeqJt+oKgF35kxeZnmSQJ3ggIC81XJ/SrA81pfceY4PnUY7X6q9sqmZzi1WB0krQ6WjyZiiKBsMqD 5im8s9Swpsqc1X9+02Jev9ccuEQ0CQx+9GY4p1jmLEFXFd7JSljPD0X5wwG6Ri8xZVHdADj+AeUL+1 VJpe5bCaT97aSv4B1hxAiCV1RNX4dV5bwWheNPIalxisB4EJQzcFn/h+SSf62bnqVcYxrJ4VxWEp90 9Q/+uIM/6Ddd93wX5XzsWmRfnJj/lfiJiITzIKdmEKCwz7ANr5teY3RGwxiAlBmvKaVEVI8YQ0XHC8 w3Mu+XctPMgSTN274ty7nPdwk4uG51A== 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=evBCfD/xWjoLHAoM71/xESO01zfKbgd2AkaAJmlm5ok=; b=MKe9msF2h/HDJppYms9jS15RO65NIu3O9KHoqEtpReWjaWtK1nY7poXSMVB8nn1sjLHb1udfsuPfJ AyTMVELVy1pG4XyKvpDR7163/0iSCu4VsnRHjACpXMQlMYPt4qEUedL2FRBPd5bA+ZWlicpGwhD8Rd nqSMvxvck9e1I/lj9jBtZKf1W2inBtf+p2dqhIJbG+OLiALbtOcobFjKH2a0NXX3uaZhqkNFZljhDJ zoTWnUVrX9G7cc1o8mrW739wn6NpqU+bSxxNqgFlcCHbYolf6wyxjcpQwyP6kTVYIo3UVNgx5ilvVd ObkPOLVdzF1FXO9JwM4GGIRqk1OE4bg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=evBCfD/xWjoLHAoM71/xESO01zfKbgd2AkaAJmlm5ok=; b=NLV/fqe0nYmWz0spCde1VxXvHEVuUfuzKtddLT6oemgs1A5R5zd2Fb0DwWnKC0Eg4g/hObmkk0omd Om6dwvMuX4aMSPujwBQg8rfd/ElS2mb3Vnf8YX6bN9a7J0xHLQ6TOtVCZEnDqKnMrbQYYyPSubMoOF nXfvePN31vdEyHrNxXTETlh3aqoqvUuoOq0PgwNpG8Kl8z4LXn9m4CIJg08vzjyaKQUr0l8/QeAysq dkC5vbsXwuFl047X7vGYDdBK2LRF+aeXfl59Wu8jmYzLt4i3nXw5a1acTZ2dnPm7nGayck5UrgNRtb GRibsbqgRee8uO4TCrYCr5BE9Bq/ULQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 161127e8-d994-11ea-a2ba-9f0c275c2f69 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 (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 161127e8-d994-11ea-a2ba-9f0c275c2f69; Sat, 08 Aug 2020 16:27:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 078GRhCQ046578; Sat, 8 Aug 2020 10:27:43 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <11fb770c36b3da67506c9a8fb919490d038b98e5.camel@freebsd.org> Subject: Re: svn commit: r363992 - head/usr.sbin/pwd_mkdb From: Ian Lepore To: Alexander Richardson , Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Date: Sat, 08 Aug 2020 10:27:43 -0600 In-Reply-To: References: <202008062046.076KkDSc013901@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BP71d482dz46l1 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 16:27:50 -0000 On Sat, 2020-08-08 at 11:08 +0100, Alexander Richardson wrote: > On Sat, 8 Aug 2020 at 02:19, Mateusz Guzik wrote: > > > > This broke i386 builds: > > > > /usr/src/usr.bin/chpass/field.c:175:15: error: incompatible pointer > > types passing > > '_bootstrap_time_t *' (aka 'unsigned long long *') to > > parameter > > of type 'time_t *' > > (aka 'int *') [-Werror,-Wincompatible-pointer-types] > > if (!atot(p, &pw->pw_change)) > > ^~~~~~~~~~~~~~ > > /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to > > parameter here > > int atot(char *, time_t *); > > ^ > > /usr/src/usr.bin/chpass/field.c:185:15: error: incompatible pointer > > types passing > > '_bootstrap_time_t *' (aka 'unsigned long long *') to > > parameter > > of type 'time_t *' > > (aka 'int *') [-Werror,-Wincompatible-pointer-types] > > if (!atot(p, &pw->pw_expire)) > > ^~~~~~~~~~~~~~ > > /usr/src/usr.bin/chpass/chpass.h:67:27: note: passing argument to > > parameter here > > int atot(char *, time_t *); > > ^ > > Sorry, fixed in r364049. > It may be fixed in terms of compiling, but how about at runtime? _bootstrap_time_t is still typedef'd as 64-bit, but on i386 a time_t is a 32-bit type. -- Ian > > On 8/6/20, Alex Richardson wrote: > > > Author: arichardson > > > Date: Thu Aug 6 20:46:13 2020 > > > New Revision: 363992 > > > URL: https://svnweb.freebsd.org/changeset/base/363992 > > > > > > Log: > > > Allow bootstrapping pwd_mkdb on Linux/macOS > > > > > > We need to provide a struct passwd that is compatible with the > > > target > > > system and this is not the case when cross-building from > > > macOS/Linux. > > > It should also be a problem when bootstrapping for an i386 > > > target from a > > > FreeBSD amd64 host since time_t does not match across those > > > systems. > > > However, pwd_mkdb always truncates integer values to 32-bit so > > > this > > > difference does not result in different databases. > > > > > > Reviewed By: brooks > > > Differential Revision: https://reviews.freebsd.org/D25931 > > > > > > Added: > > > head/usr.sbin/pwd_mkdb/pwd.h (contents, props changed) > > > Modified: > > > head/usr.sbin/pwd_mkdb/Makefile > > > > > > Modified: head/usr.sbin/pwd_mkdb/Makefile > > > ================================================================= > > > ============= > > > --- head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:44:40 > > > 2020 (r363991) > > > +++ head/usr.sbin/pwd_mkdb/Makefile Thu Aug 6 20:46:13 > > > 2020 (r363992) > > > @@ -9,5 +9,8 @@ MAN= pwd_mkdb.8 > > > SRCS= pw_scan.c pwd_mkdb.c > > > > > > CFLAGS+= -I${SRCTOP}/lib/libc/gen # for pw_scan.h > > > +.if defined(BOOTSTRAPPING) > > > +CFLAGS+=-I${.CURDIR} > > > +.endif > > > > > > .include > > > > > > Added: head/usr.sbin/pwd_mkdb/pwd.h > > > ================================================================= > > > ============= > > > --- /dev/null 00:00:00 1970 (empty, because file is newly > > > added) > > > +++ head/usr.sbin/pwd_mkdb/pwd.h Thu Aug 6 20:46:13 > > > 2020 (r363992) > > > @@ -0,0 +1,66 @@ > > > +/*- > > > + * SPDX-License-Identifier: BSD-2-Clause > > > + * > > > + * Copyright 2018-2020 Alex Richardson > > > + * > > > + * This software was developed by SRI International and the > > > University of > > > + * Cambridge Computer Laboratory (Department of Computer Science > > > and > > > + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), > > > as part of > > > the > > > + * DARPA SSITH research programme. > > > + * > > > + * This software was developed by SRI International and the > > > University of > > > + * Cambridge Computer Laboratory under DARPA/AFRL contract > > > (FA8750-10-C-0237) > > > + * ("CTSRD"), as part of the DARPA CRASH research programme. > > > + * > > > + * Redistribution and use in source and binary forms, with or > > > without > > > + * modification, are permitted provided that the following > > > conditions > > > + * are met: > > > + * 1. Redistributions of source code must retain the above > > > copyright > > > + * notice, this list of conditions and the following > > > disclaimer. > > > + * 2. Redistributions in binary form must reproduce the above > > > copyright > > > + * notice, this list of conditions and the following > > > disclaimer in the > > > + * documentation and/or other materials provided with the > > > distribution. > > > + * > > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS > > > IS'' AND > > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED > > > TO, THE > > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > > > PARTICULAR > > > PURPOSE > > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS > > > BE LIABLE > > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > > > CONSEQUENTIAL > > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > > > SUBSTITUTE GOODS > > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > > > INTERRUPTION) > > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > > > CONTRACT, > > > STRICT > > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > > > ARISING IN ANY > > > WAY > > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > > > POSSIBILITY OF > > > + * SUCH DAMAGE. > > > + * > > > + * $FreeBSD$ > > > + */ > > > + > > > +/* > > > + * When building pwd_mkdb we need to use target systems > > > definition of > > > + * struct passwd. This protects against future changes to struct > > > passwd > > > and > > > + * is essential to allow cross-building from Linux/macOS hosts > > > since the > > > + * structure is not compatible there. > > > + */ > > > +#include > > > +#include > > > +/* > > > + * Note: pwd_mkdb always stores uint32_t for all integer fields > > > (including > > > + * time_t!) so these definitions do not need to match > > > sys/sys/_types.h > > > + */ > > > +typedef uint32_t _bootstrap_gid_t; > > > +typedef uint32_t _bootstrap_uid_t; > > > +typedef uint64_t _bootstrap_time_t; > > > +#define _GID_T_DECLARED > > > +#define _TIME_T_DECLARED > > > +#define _UID_T_DECLARED > > > +#define _SIZE_T_DECLARED > > > + > > > +#define gid_t _bootstrap_gid_t > > > +#define uid_t _bootstrap_uid_t > > > +#define time_t _bootstrap_time_t > > > +#define passwd _bootstrap_passwd > > > +#include "../../include/pwd.h" > > > +#undef gid_t > > > +#undef uid_t > > > +#undef time_t > > > > > > > > > -- > > Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 8 16: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 8EBBE378B11; Sat, 8 Aug 2020 16:56:21 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BP7fY2ynFz48XL; Sat, 8 Aug 2020 16:56:21 +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 44F0DB8DD; Sat, 8 Aug 2020 16:56:21 +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 078GuLHM057658; Sat, 8 Aug 2020 16:56:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 078GuLMR057657; Sat, 8 Aug 2020 16:56:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008081656.078GuLMR057657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 8 Aug 2020 16:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364053 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 364053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 16:56:21 -0000 Author: manu Date: Sat Aug 8 16:56:20 2020 New Revision: 364053 URL: https://svnweb.freebsd.org/changeset/base/364053 Log: release: RPI3: Add the RPI2 DTB The RPI2 v1.2 is using the same SoC as the RPI3 so it can boot this image but needs the RPI2 dtb. MFC after: 3 days Modified: head/release/arm64/RPI3.conf Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Sat Aug 8 16:41:28 2020 (r364052) +++ head/release/arm64/RPI3.conf Sat Aug 8 16:56:20 2020 (r364053) @@ -4,7 +4,7 @@ # DTB_DIR="/usr/local/share/rpi-firmware" -DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb" +DTB="bcm2709-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb" EMBEDDED_TARGET_ARCH="aarch64" EMBEDDED_TARGET="arm64" EMBEDDEDBUILD=1 From owner-svn-src-head@freebsd.org Sat Aug 8 19:39: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 68CDE37BDF8; Sat, 8 Aug 2020 19:39:39 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BPCGz20m7z4GcM; Sat, 8 Aug 2020 19:39:39 +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 23A5FDC78; Sat, 8 Aug 2020 19:39:39 +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 078JdcBq056462; Sat, 8 Aug 2020 19:39:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 078Jdciw056461; Sat, 8 Aug 2020 19:39:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202008081939.078Jdciw056461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 8 Aug 2020 19:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364054 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 364054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 19:39:39 -0000 Author: tuexen Date: Sat Aug 8 19:39:38 2020 New Revision: 364054 URL: https://svnweb.freebsd.org/changeset/base/364054 Log: Improve the ECN negotiation when the TCP SYN-cache is used by making sure that * ECN is disabled if the client sends an non-ECN-setup SYN segment. * ECN is disabled is the ECN-setup SYN-ACK segment is retransmitted more than net.inet.tcp.ecn.maxretries times. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26008 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Aug 8 16:56:20 2020 (r364053) +++ head/sys/netinet/tcp_syncache.c Sat Aug 8 19:39:38 2020 (r364054) @@ -510,6 +510,9 @@ syncache_timer(void *xsch) sch->sch_nextc = sc->sc_rxttime; continue; } + if (sc->sc_rxmits > V_tcp_ecn_maxretries) { + sc->sc_flags &= ~SCF_ECN; + } if (sc->sc_rxmits > V_tcp_syncache.rexmt_limit) { if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Retransmits exhausted, " @@ -1505,6 +1508,13 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t sc->sc_tsreflect = to->to_tsval; else sc->sc_flags &= ~SCF_TIMESTAMP; + /* + * Disable ECN if needed. + */ + if ((sc->sc_flags & SCF_ECN) && + ((th->th_flags & (TH_ECE|TH_CWR)) != (TH_ECE|TH_CWR))) { + sc->sc_flags &= ~SCF_ECN; + } #ifdef MAC /* * Since we have already unconditionally allocated label From owner-svn-src-head@freebsd.org Sat Aug 8 19:48: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 F0E1D37C3CE; Sat, 8 Aug 2020 19:48:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BPCSv685rz4H36; Sat, 8 Aug 2020 19:48:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7543DC9C; Sat, 8 Aug 2020 19:48:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 078JmFNh062254; Sat, 8 Aug 2020 19:48:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 078JmFml062253; Sat, 8 Aug 2020 19:48:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008081948.078JmFml062253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Sat, 8 Aug 2020 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364055 - head X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: 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, 08 Aug 2020 19:48:16 -0000 Author: se Date: Sat Aug 8 19:48:15 2020 New Revision: 364055 URL: https://svnweb.freebsd.org/changeset/base/364055 Log: Mention the new implementation of bc and dc which has become the default version in FreeBSD-CURRENT. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Sat Aug 8 19:39:38 2020 (r364054) +++ head/RELNOTES Sat Aug 8 19:48:15 2020 (r364055) @@ -27,6 +27,13 @@ r363180: r363084: nc(1) now implements SCTP mode, enabled by specifying the --sctp option. +r362681: + A new implementation of bc and dc has been imported. It offers + better standards compliance, performance, localization and comes + with extensive test cases that are optionally installed. + Use WITHOUT_GH_BC=yes to build and install the world with the + previous version instead of the new one, if required. + r362158, r362163: struct export_args has changed so that the "user" specified for the -maproot and -mapall exports(5) options may be in more than